Will be redoing the event interface for subscriptions, some work for the wi and crash fixes

This commit is contained in:
KimLS
2017-01-30 23:22:52 -08:00
parent a8699eb40c
commit d5bd773a46
17 changed files with 205 additions and 98 deletions
+22
View File
@@ -0,0 +1,22 @@
#include "event_sub.h"
#include <string.h>
void EventSubscriptionWatcher::Subscribe(const std::string &event_name)
{
m_subs[event_name] = 1;
}
void EventSubscriptionWatcher::Unsubscribe(const std::string &event_name)
{
m_subs[event_name] = 0;
}
bool EventSubscriptionWatcher::IsSubscribed(const std::string &event_name) const
{
auto iter = m_subs.find(event_name);
if (iter != m_subs.end()) {
return iter->second;
}
return false;
}