]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Dispatch.hh
the massive refactoring effort
[chaz/yoink] / src / Moof / Dispatch.hh
diff --git a/src/Moof/Dispatch.hh b/src/Moof/Dispatch.hh
deleted file mode 100644 (file)
index e357f02..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-
-/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
-**]  All rights reserved.
-*
-* vi:ts=4 sw=4 tw=75
-*
-* Distributable under the terms and conditions of the 2-clause BSD license;
-* see the file COPYING for a complete text of the license.
-*
-**************************************************************************/
-
-#ifndef _MOOF_DISPATCH_HH_
-#define _MOOF_DISPATCH_HH_
-
-#include <string>
-
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
-
-
-namespace Mf {
-
-
-/**
- * Dispatcher of messages to interested parties.
- */
-
-class Dispatch
-{
-       class Impl;
-       boost::shared_ptr<Impl> mImpl;
-
-       void removeTarget(unsigned id);
-
-
-public:
-
-       class Handle
-       {
-       public:
-
-               Handle() :
-                       mId(0) {}
-
-               Handle(boost::weak_ptr<Impl> dispatch, unsigned id) :
-                       mDispatch(dispatch),
-                       mId(id) {}
-
-               Handle(const Handle& handle) :
-                       mDispatch(handle.mDispatch),
-                       mId(handle.mId)
-               {
-                       handle.mId = 0;
-               }
-
-               ~Handle()
-               {
-                       clear();
-               }
-
-               Handle& operator = (const Handle& handle)
-               {
-                       clear();
-                       mDispatch = handle.mDispatch;
-                       mId = handle.mId;
-                       handle.mId = 0;
-                       return *this;
-               }
-
-               unsigned getId() const
-               {
-                       return mId;
-               }
-
-               void clear();
-       
-       private:
-
-               boost::weak_ptr<Impl>   mDispatch;
-               mutable unsigned                mId;
-       };
-
-       typedef boost::function<void(void)> Function;
-
-
-       Dispatch();
-
-       Handle addTarget(const std::string& event, const Function& callback);
-       Handle addTarget(const std::string& event, const Function& callback,
-                                          Handle handle);
-
-       void dispatch(const std::string& event);
-
-       static Dispatch& global();
-};
-
-
-} // namespace Mf
-
-#endif // _MOOF_DISPATCH_HH_
-
This page took 0.022147 seconds and 4 git commands to generate.