summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-27 19:06:56 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-27 19:07:55 (GMT)
commit6810a2896f27e7ee07aee847f5e8dbccd1f6ec89 (patch)
treef7ea87f030e57cb4494a4f897506fb18fc3d2241 /Swiften/EventLoop/MainEventLoop.h
parenta7da393cfc807048d320ddba8a1c7d24ef23a46e (diff)
downloadswift-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.zip
swift-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.tar.bz2
Remove MainEventLoop singleton.
The event loop now needs to be explicitly passed to clients using it.
Diffstat (limited to 'Swiften/EventLoop/MainEventLoop.h')
-rw-r--r--Swiften/EventLoop/MainEventLoop.h47
1 files changed, 0 insertions, 47 deletions
diff --git a/Swiften/EventLoop/MainEventLoop.h b/Swiften/EventLoop/MainEventLoop.h
deleted file mode 100644
index 5789db2..0000000
--- a/Swiften/EventLoop/MainEventLoop.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
- */
-
-#ifndef SWIFTEN_MainEventLoop_H
-#define SWIFTEN_MainEventLoop_H
-
-#include <boost/function.hpp>
-
-#include "Swiften/EventLoop/Deleter.h"
-#include "Swiften/EventLoop/EventLoop.h"
-
-namespace Swift {
- class EventLoop;
- class EventOwner;
-
- class MainEventLoop {
- friend class EventLoop;
-
- public:
- /**
- * Post an event from the given owner to the event loop.
- * If the owner is destroyed, all events should be removed from the
- * loop using removeEventsFromOwner().
- */
- static void postEvent(boost::function<void ()> event, boost::shared_ptr<EventOwner> owner = boost::shared_ptr<EventOwner>());
-
- static void removeEventsFromOwner(boost::shared_ptr<EventOwner> owner);
-
- template<typename T>
- static void deleteLater(T* t) {
- getInstance()->postEvent(Deleter<T>(t), 0);
- }
-
- private:
- static void setInstance(EventLoop*);
- static void resetInstance();
- static EventLoop* getInstance();
-
- private:
- static EventLoop* instance_;
- };
-}
-
-#endif