namespace Mf {
-Notification::~Notification() {}
-
-
struct Dispatcher::Impl
{
Impl() :
for (CallbackIter jt = first; jt != last; ++jt)
{
- if (((*jt).second).first == id)
+ if ((*jt).second.first == id)
{
callbacks.erase(jt);
break;
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)
for (Impl::CallbackIter it = callbacks.first; it != callbacks.second; ++it)
{
- Function callback = ((*it).second).second;
+ Function callback = (*it).second.second;
callback(param);
}
}