I think about event order is requirement. [...]
I am sorry to say this but (at least) I did not understand what you mean exactly. What events are you talking about? SDK events or self-made events? And why should the order of an event matter? Can you provide an example?
For the sdk of codeblocks, codeblocks event will be stored in the map.
sometime these events should have priority for some plug-in.
For some of the plug-in dependencies, call evnets need a more specific order.
My english is poor, I post some pesudo-code for my mind.
Thank you for your reply. :lol:
enum EVENT_PRIORITY
{
LOW=0,
MID,
HIGH
};
void RegisterEventSink(wxEventType eventType, IEventFunctorBase<CodeBlocksEvent>* functor,EVENT_PRIORITY priority=EVENT_PRIORITY::LOW);
void Manager::RegisterEventSink(wxEventType eventType, IEventFunctorBase<CodeBlocksEvent>* functor,EVENT_PRIORITY priority)
{
m_EventSinks[priority][eventType].push_back(functor);
}
EventSinksMap m_EventSinks[2];
Manager::Get()->RegisterEventSink(cbEVT_EDITOR_OPEN, new cbEventFunctor<DebuggerGDB, CodeBlocksEvent>(this, &DebuggerGDB::OnEditorOpened),EVENT_PRIORITY::MID);