]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Dispatcher.cc
new timer class
[chaz/yoink] / src / Moof / Dispatcher.cc
index 9e652a37a8983614010cf974f92172c310caae88..2d9d3377011a5d6eef4f9984633f17da738b1c0c 100644 (file)
@@ -76,7 +76,7 @@ struct Dispatcher::Impl
 
                        for (CallbackIter jt = first; jt != last; ++jt)
                        {
-                               if (((*jt).second).first == id)
+                               if ((*jt).second.first == id)
                                {
                                        callbacks.erase(jt);
                                        break;
@@ -97,6 +97,15 @@ struct Dispatcher::Impl
 Dispatcher::Dispatcher() :
        impl_(new Dispatcher::Impl) {}
 
+Dispatcher::~Dispatcher() {}
+
+
+Dispatcher& Dispatcher::getInstance()
+{
+       static Dispatcher dispatcher;
+       return dispatcher;
+}
+
 
 Dispatcher::Handler Dispatcher::addHandler(const std::string& message,
                const Function& callback)
@@ -126,7 +135,7 @@ void Dispatcher::dispatch(const std::string& message, const Notification* param)
 
        for (Impl::CallbackIter it = callbacks.first; it != callbacks.second; ++it)
        {
-               Function callback = ((*it).second).second;
+               Function callback = (*it).second.second;
                callback(param);
        }
 }
This page took 0.019502 seconds and 4 git commands to generate.