MxEngine
Static Public Member Functions | List of all members
MxEngine::EventManager Class Reference

Static Public Member Functions

template<typename EventType >
static void AddEventListener (const MxString &name, std::function< void(EventType &)> func)
 
template<typename FunctionType >
static void AddEventListener (const MxString &name, FunctionType &&func)
 
static void RemoveEventListener (const MxString &name)
 
template<typename Event >
static void Invoke (Event &event)
 
static void AddEvent (UniqueRef< IEvent > event)
 
static void InvokeAll ()
 

Member Function Documentation

§ AddEvent()

static void MxEngine::EventManager::AddEvent ( UniqueRef< IEvent >  event)
inlinestatic

Adds event to event queue. All such events will be dispatched in next frames in the order they were added

Parameters
eventevent to shedule dispatch

§ AddEventListener() [1/2]

template<typename EventType >
static void MxEngine::EventManager::AddEventListener ( const MxString &  name,
std::function< void(EventType &)>  func 
)
inlinestatic

adds new event listener to dispatcher (listener placed in waiting queue until next frame). Note that multiple listeners may have same name. If so, deleting by name will result in removing all of them

Parameters
namename of listener (used for deleting listener)
funclistener callback functor

§ AddEventListener() [2/2]

template<typename FunctionType >
static void MxEngine::EventManager::AddEventListener ( const MxString &  name,
FunctionType &&  func 
)
inlinestatic

adds new event listener to dispatcher (listener is placed in waiting queue until next frame). Note that multiple listeners may have same name. If so, deleting by name will result in removing all of them

Parameters
namename of listener (used for deleting listener)
funclistener callback functor

§ Invoke()

template<typename Event >
static void MxEngine::EventManager::Invoke ( Event &  event)
inlinestatic

Immediately invokes event of specific type. Note that invokation also forces queues to be invalidated

Parameters
eventevent to dispatch

§ InvokeAll()

static void MxEngine::EventManager::InvokeAll ( )
inlinestatic

Invokes all shedules events in the order they were added. Note that invoke also forces queues to be invalidated

§ RemoveEventListener()

static void MxEngine::EventManager::RemoveEventListener ( const MxString &  name)
inlinestatic

removes all event listeners by their names (action is placed in waiting queue until next frame)

Parameters
namename of listeners to be deleted

The documentation for this class was generated from the following file: