forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessageManager.cpp
More file actions
26 lines (22 loc) · 848 Bytes
/
Copy pathMessageManager.cpp
File metadata and controls
26 lines (22 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "DebuggerPaused.h"
#include "DebuggerResumed.h"
#include "DebuggerScriptParsed.h"
#include "MessageManager.h"
#include "RuntimeExecutionContextDestroyed.h"
MessageManager::MessageManager()
{
AddHandler(NodeMessageBase::Ptr_t(new DebuggerPaused()));
AddHandler(NodeMessageBase::Ptr_t(new DebuggerScriptParsed()));
AddHandler(NodeMessageBase::Ptr_t(new DebuggerResumed()));
AddHandler(NodeMessageBase::Ptr_t(new RuntimeExecutionContextDestroyed()));
}
MessageManager::~MessageManager() {}
void MessageManager::AddHandler(NodeMessageBase::Ptr_t handler)
{
m_events.insert({ handler->GetEventName(), handler });
}
NodeMessageBase::Ptr_t MessageManager::GetHandler(const wxString& eventName)
{
if(m_events.count(eventName) == 0) { return NodeMessageBase::Ptr_t(nullptr); }
return m_events[eventName]->Clone();
}