X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FDispatcher.hh;h=a152691a8184d170d62890df2fb72dbc51959dc2;hp=ec143b46fdce105a7021f79cc4a2ecb1027144f4;hb=a5f0d391406a68275b41448fc3f49e8d8396c497;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Moof/Dispatcher.hh b/src/Moof/Dispatcher.hh index ec143b4..a152691 100644 --- a/src/Moof/Dispatcher.hh +++ b/src/Moof/Dispatcher.hh @@ -31,10 +31,8 @@ #include -#include #include - -#include +#include namespace Mf { @@ -55,13 +53,17 @@ public: * Dispatcher of notifications to interested parties. */ -class Dispatcher : public Singleton +class Dispatcher { public: typedef void* Handler; - typedef boost::function Function; + typedef boost::function Function; Dispatcher(); + ~Dispatcher(); + + // get global instance + static Dispatcher& getInstance(); Handler addHandler(const std::string& message, const Function& callback); Handler addHandler(const std::string& message, const Function& callback, @@ -69,12 +71,11 @@ public: 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 = 0); private: - class DispatcherImpl; - boost::shared_ptr impl_; + class Impl; + boost::shared_ptr impl_; };