Public Member Functions | |
SimEventBuffer (OptionManager &mgr, const std::string &descrName="SimEventBuffer", const std::string &tagName="SimEventBuffer") | |
Constructor. | |
virtual | ~SimEventBuffer () |
Destructor. | |
template<class E > | |
void | asyncPost (rutz::shared_ptr< E > e) |
Post an event asynchronously. | |
rutz::shared_ptr< SimEvent > | asyncRetrieve () |
Retrieve the next buffered event. | |
Static Public Member Functions | |
static SimEventBuffer & | Instance () |
Return SimEventBuffer instance. | |
Protected Member Functions | |
SIMCALLBACK_DECLARE (SimEventBuffer, SimEventClockTick) | |
Callback for when a new clock tick is available. |
Definition at line 46 of file SimEventBuffer.H.
SimEventBuffer::SimEventBuffer | ( | OptionManager & | mgr, | |
const std::string & | descrName = "SimEventBuffer" , |
|||
const std::string & | tagName = "SimEventBuffer" | |||
) |
SimEventBuffer::~SimEventBuffer | ( | ) | [virtual] |
Destructor.
Definition at line 58 of file SimEventBuffer.C.
void SimEventBuffer::asyncPost | ( | rutz::shared_ptr< E > | e | ) | [inline] |
Post an event asynchronously.
The event is queued in a buffer and asyncPost returns immediately. The buffered event is posted to SimEventQueue asynchronously on next clock tick.
Definition at line 92 of file SimEventBuffer.H.
References rutz::demangled_name(), and rutz::shared_ptr< T >::is_valid().
rutz::shared_ptr< SimEvent > SimEventBuffer::asyncRetrieve | ( | ) |
Retrieve the next buffered event.
Normally, this is called only when receving SimEventClockTick event. It returns invalid rutz::shared_ptr<SimEvent> when buffer is empty.
Definition at line 63 of file SimEventBuffer.C.
static SimEventBuffer& SimEventBuffer::Instance | ( | ) | [inline, static] |
Return SimEventBuffer instance.
Definition at line 73 of file SimEventBuffer.H.
SimEventBuffer::SIMCALLBACK_DECLARE | ( | SimEventBuffer | , | |
SimEventClockTick | ||||
) | [protected] |
Callback for when a new clock tick is available.