Lysa  0.0
Lysa 3D Engine
QueuedEvent Class Referencefinal

Detailed Description

FIFO events filtered by target id, delivered on the start on the next frame. C++ callbacks are called before Lua callbacks.

+ Inheritance diagram for QueuedEvent:

Public Member Functions

 QueuedEvent (size_t reservedCapacity)
 
void push (const Event &event)
 
unique_id subscribe (const event_type &type, unique_id id, EventHandlerCallback callback)
 
unique_id subscribe (const event_type &type, const std::vector< unique_id > &ids, EventHandlerCallback callback)
 
unique_id subscribe (const event_type &type, EventHandlerCallback callback)
 
- Public Member Functions inherited from EventManager< Event >
void unsubscribe (unique_id id)
 
virtual ~EventManager () = default
 

Additional Inherited Members

- Protected Typedefs inherited from EventManager< Event >
using Callback = std::conditional_t< std::is_same_v< Event, Event >, EventHandlerCallback, SignalHandlerCallback >
 
using Handler = std::conditional_t< std::is_same_v< Event, Event >, EventHandler, SignalHandler >
 
- Protected Member Functions inherited from EventManager< Event >
 EventManager () = default
 
Handler createHandler (Callback callback)
 
void dispatch (Event &message, const Lookup &lookup)
 
- Static Protected Member Functions inherited from EventManager< Event >
static void eraseHandler (HandlerLists &callbacks, unique_id id)
 

Constructor & Destructor Documentation

QueuedEvent ( size_t  reservedCapacity)

Reserve space for pending and processing events.

Member Function Documentation

void push ( const Event &  event)

Enqueue a copy of the event.

unique_id subscribe ( const event_type &  type,
const std::vector< unique_id > &  ids,
EventHandlerCallback  callback 
)

Subscribe to several target ids.

unique_id subscribe ( const event_type &  type,
EventHandlerCallback  callback 
)

Subscribe to queued events without a target.

unique_id subscribe ( const event_type &  type,
unique_id  id,
EventHandlerCallback  callback 
)

Subscribe to one target id.