|
WSF
|
#include <WsfEventManager.hpp>

Classes | |
| struct | Event |
Public Member Functions | |
| WsfEventManager (WsfSimulation &aSimulation) | |
| WsfEventManager (const WsfEventManager &aSrc)=delete | |
| WsfEventManager & | operator= (const WsfEventManager &aRhs)=delete |
| WsfEventManager (WsfEventManager &&)=default | |
| WsfEventManager & | operator= (WsfEventManager &&)=default |
| virtual | ~WsfEventManager ()=default |
| virtual void | AddEvent (std::unique_ptr< WsfEvent > aEventPtr) |
| Add an event to the event queue. | |
| virtual WsfEvent * | PeekEvent () const |
| Get, but do not remove, the next event that should be dispatched. | |
| virtual std::unique_ptr< WsfEvent > | PopEvent () |
| Get and remove the next event that should be dispatched. | |
| virtual void | Reset () |
| Reset the event queue back to an empty state. | |
Protected Attributes | |
| std::recursive_mutex | mMutex {} |
A manager for a time-ordered queue (strict weak ordering) of WsfEvent objects
This class is used by WsfSimulation to implement an event queue. It could also be used by other classes that want to retain their own time-ordered event queues.
The event manager operates as a queue with ordering primarily dictated by the indicated simulation execution time of the event. Events occurring at the same discrete time are further ordered by a priority value. In most use cases, the priority value is default assigned such that all events added to the queue at the same time observe a first-in-first-out behavior. However, priority may be modified to change the relative ordering of same-time events.
| WsfEventManager::WsfEventManager | ( | WsfSimulation & | aSimulation | ) |
|
delete |
References WsfEventManager().
|
default |
References WsfEventManager().
|
virtualdefault |
References AddEvent(), PeekEvent(), PopEvent(), and Reset().
|
virtual |
Add an event to the event queue.
Add an event to the event queue.
| aEventPtr | Pointer to the event to be added to the queue. The WsfEvent::GetTime method will be used to determine when the event should be dispatched. The event manager becomes the owner of the event. |
Events added are ordered by simulation time. In the case of events with the same simulation time, events are then ordered by priority. Events with the same simulation time and priority are executed in a first-in-first-out manner via an incrementing counter.
References mMutex.
Referenced by ~WsfEventManager().
|
delete |
References WsfEventManager().
|
default |
References WsfEventManager().
|
virtual |
Get, but do not remove, the next event that should be dispatched.
Get, but do not remove, the next event that should be dispatched
The next event is the one with the lowest time value. In cases of equivalent time value, the next event is the one with the lowest priority. In cases of equivalent time and priority, the next event is the one that was added to the event manager first.
References mMutex.
Referenced by ~WsfEventManager().
|
virtual |
Get and remove the next event that should be dispatched.
Get and remove the next event that should be dispatched
The next event is the one with the lowest time value. In cases of equivalent time value, the next event is the one with the lowest priority. In cases of equivalent time and priority, the next event is the one that was added to the event manager first.
Reimplemented in WsfStableOrderEventManager.
References mMutex.
Referenced by ~WsfEventManager().
|
virtual |
Reset the event queue back to an empty state.
Reimplemented in WsfStableOrderEventManager.
References mMutex.
Referenced by ~WsfEventManager(), and WsfStableOrderEventManager::~WsfStableOrderEventManager().
|
mutableprotected |