X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FDispatcher.hh;fp=src%2Fdispatcher.hh;h=ec143b46fdce105a7021f79cc4a2ecb1027144f4;hp=1a7744ae1f8aa689a6506946ee9c0a6738445060;hb=c2321281bf12a7efaedde930422c7ddbc92080d4;hpb=87bc17e55b0c1dc73ecc66df856d3f08fd7a7724 diff --git a/src/dispatcher.hh b/src/Moof/Dispatcher.hh similarity index 74% rename from src/dispatcher.hh rename to src/Moof/Dispatcher.hh index 1a7744a..ec143b4 100644 --- a/src/dispatcher.hh +++ b/src/Moof/Dispatcher.hh @@ -26,28 +26,28 @@ *******************************************************************************/ -#ifndef _DISPATCHER_HH_ -#define _DISPATCHER_HH_ +#ifndef _MOOF_DISPATCHER_HH_ +#define _MOOF_DISPATCHER_HH_ #include #include #include -#include "singleton.hh" +#include -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 +class Dispatcher : public Singleton { public: - typedef void* handler; + typedef void* Handler; + typedef boost::function Function; - dispatcher(); + Dispatcher(); - typedef boost::function 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 impl; + class DispatcherImpl; + boost::shared_ptr impl_; }; -} // namespace dc +} // namespace Mf -#endif // _DISPATCHER_HH_ +#endif // _MOOF_DISPATCHER_HH_ /** vim: set ts=4 sw=4 tw=80: *************************************************/