#include <xrb_eventqueue.hpp>
Classes | |
class | EventBinding |
struct | OrderEventBindingsByEventTime |
Public Member Functions | |
EventQueue () | |
Constructor. | |
virtual | ~EventQueue () |
Destructor. | |
void | EnqueueEvent (EventHandler *event_handler, Event const *event) |
Enqueues an event for the given EventHandler. | |
void | DeleteEventsBelongingToHandler (EventHandler *event_handler) |
Deletes events which belong to the given EventHandler. | |
void | ScheduleMatchingEventsForDeletion (bool(*EventMatchingFunction)(Event const *)) |
Deletes all queued events that return true when passed to the given event matching function. | |
template<typename ParameterType > | |
void | ScheduleMatchingEventsForDeletion (bool(*EventMatchingFunction)(Event const *, ParameterType), ParameterType parameter) |
Deletes all queued events that return true when passed to the given event matching function. | |
template<typename Parameter1Type , typename Parameter2Type > | |
void | ScheduleMatchingEventsForDeletion (bool(*EventMatchingFunction)(Event const *, Parameter1Type, Parameter2Type), Parameter1Type parameter1, Parameter2Type parameter2) |
Deletes all queued events that return true when passed to the given event matching function. | |
Protected Member Functions | |
virtual void | HandleFrame () |
Processes all events in the event queue with time less than or equal to the current frame time. |
Many EventHandler instances are "owned" by a single EventQueue. The EventQueue receives orders to enqueue events for a particular EventHandler. All events from all EventHandlers are enqueued chronologically in a single queue. The events are then dequeued (also in chronologicaly order) when the current time (as passed to the EventQueue) is greater or equal to the event's scheduled processing time.
When an EventHandler is deleted, all events that are enqueued for it are taken out of the queue and deleted.
Definition at line 39 of file xrb_eventqueue.hpp.
Xrb::EventQueue::~EventQueue | ( | ) | [virtual] |
Destructor.
Deletes all remaining enqueued events.
Definition at line 30 of file xrb_eventqueue.cpp.
References Xrb::Delete().
void Xrb::EventQueue::EnqueueEvent | ( | EventHandler * | event_handler, | |
Event const * | event | |||
) |
Enqueues an event for the given EventHandler.
The time at which it will be processed is given the time specified during the Event's construction.
Definition at line 50 of file xrb_eventqueue.cpp.
References Xrb::EventHandler::MostRecentEventTime().
Referenced by Xrb::EventHandler::EnqueueEvent().
void Xrb::EventQueue::DeleteEventsBelongingToHandler | ( | EventHandler * | event_handler | ) |
Deletes events which belong to the given EventHandler.
Definition at line 71 of file xrb_eventqueue.cpp.
Referenced by Xrb::EventHandler::~EventHandler().
void Xrb::EventQueue::ScheduleMatchingEventsForDeletion | ( | bool(*)(Event const *) | EventMatchingFunction | ) |
Deletes all queued events that return true when passed to the given event matching function.
This is used to remove situation-specific sets of events.
EventMatchingFunction | A pointer to the matching function to use. |
Definition at line 87 of file xrb_eventqueue.cpp.
void Xrb::EventQueue::ScheduleMatchingEventsForDeletion | ( | bool(*)(Event const *, ParameterType) | EventMatchingFunction, | |
ParameterType | parameter | |||
) | [inline] |
Deletes all queued events that return true when passed to the given event matching function.
This is used to remove situation-specific sets of events.
The template parameter specifies the type of the single extra parameter of the event matching function (besides the Event itself).
EventMatchingFunction | A pointer to the matching function to use. | |
parameter | The parameter to pass to the matching function. |
Definition at line 183 of file xrb_eventqueue.hpp.
void Xrb::EventQueue::ScheduleMatchingEventsForDeletion | ( | bool(*)(Event const *, Parameter1Type, Parameter2Type) | EventMatchingFunction, | |
Parameter1Type | parameter1, | |||
Parameter2Type | parameter2 | |||
) | [inline] |
Deletes all queued events that return true when passed to the given event matching function.
This is used to remove situation-specific sets of events.
The template parameter specifies the type of the two extra parameters of the event matching function (besides the Event itself).
EventMatchingFunction | A pointer to the matching function to use. | |
parameter1 | The first parameter (of type Parameter1Type) to pass to the matching function. | |
parameter2 | The first parameter (of type Parameter2Type) to pass to the matching function. |
Definition at line 204 of file xrb_eventqueue.hpp.