]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Dispatcher.hh
extreme refactoring
[chaz/yoink] / src / Moof / Dispatcher.hh
similarity index 74%
rename from src/dispatcher.hh
rename to src/Moof/Dispatcher.hh
index 1a7744ae1f8aa689a6506946ee9c0a6738445060..ec143b46fdce105a7021f79cc4a2ecb1027144f4 100644 (file)
 
 *******************************************************************************/
 
-#ifndef _DISPATCHER_HH_
-#define _DISPATCHER_HH_
+#ifndef _MOOF_DISPATCHER_HH_
+#define _MOOF_DISPATCHER_HH_
 
 #include <string>
 
 #include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
 
-#include "singleton.hh"
+#include <Moof/Singleton.hh>
 
 
-namespace dc {
+namespace Mf {
 
 
 /**
  * Interface for a notification class.
  */
 
-class notification
+class Notification
 {
 public:
-       virtual ~notification();
+       virtual ~Notification();
 };
 
 
@@ -55,33 +55,32 @@ public:
  * Dispatcher of notifications to interested parties.
  */
 
-class dispatcher : public singleton<dispatcher>
+class Dispatcher : public Singleton<Dispatcher>
 {
 public:
-       typedef void* handler;
+       typedef void* Handler;
+       typedef boost::function<void(const Notification&)> Function;
 
-       dispatcher();
+       Dispatcher();
 
-       typedef boost::function<void(const notification&)> function;
+       Handler addHandler(const std::string& message, const Function& callback);
+       Handler addHandler(const std::string& message, const Function& callback,
+                       Handler id);
 
-       handler addHandler(const std::string& message, const function& callback);
-       handler addHandler(const std::string& message, const function& callback,
-                       handler id);
-
-       void removeHandler(handler id);
+       void removeHandler(Handler id);
 
        void dispatch(const std::string& message);
-       void dispatch(const std::string& message, const notification& param);
+       void dispatch(const std::string& message, const Notification& param);
 
 private:
-       class dispatcher_impl;
-       boost::shared_ptr<dispatcher_impl> impl;
+       class DispatcherImpl;
+       boost::shared_ptr<DispatcherImpl> impl_;
 };
 
 
-} // namespace dc
+} // namespace Mf
 
-#endif // _DISPATCHER_HH_
+#endif // _MOOF_DISPATCHER_HH_
 
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
 
This page took 0.020765 seconds and 4 git commands to generate.