Simplified XF 1.1.0
|
Interface for TimerManager classes (and some few 'tick' stuff already provided). More...
#include <timeoutmanager.h>
Public Member Functions | |
virtual void | initialize (int32_t tickInterval) |
virtual int32_t | getTickInterval () const |
Returns tick interval in milliseconds. | |
virtual void | start (std::function< void(uint32_t)> startTimeoutManagerTimer=nullptr)=0 |
virtual void | scheduleTimeout (int32_t timeoutId, int32_t interval, interface::XFBehavior *pBehavior)=0 |
virtual void | unscheduleTimeout (int32_t timeoutId, interface::XFBehavior *pBehavior)=0 |
virtual void | tick ()=0 |
Called periodically with a delay defined by TimeoutManager::_tickInterval. More... | |
Static Public Member Functions | |
static XFTimeoutManager * | getInstance () |
Returns a pointer to the single instance of TimeoutManager. | |
Protected Member Functions | |
virtual void | addTimeout (XFTimeout *pNewTimeout)=0 |
Adds the timeout to the list of timeouts. More... | |
Protected Attributes | |
int32_t | tickInterval_ |
Interval in milliseconds the TimeoutManager is decrementing the timeouts. | |
Interface for TimerManager classes (and some few 'tick' stuff already provided).
The TimeoutManager is responsible to handle timeouts used in state machines. It decrements them accordingly and inject them back to the state machine when timeouted.
Requirements:
|
protectedpure virtual |
Adds the timeout to the list of timeouts.
Implemented in XFTimeoutManager.
|
inlinevirtual |
Sets the time interval in milliseconds in which the timeout manager should handle the timeouts.
|
pure virtual |
Adds a timeout to the timeout manager.
timeoutId | The timeout id known by the reactive parameter. Is needed by the reactive part to uniquely identify the timeout. |
interval | The time in milliseconds to wait until the timeout expires. |
pBehavior | The reactive instance where to inject the timeout when it timeouts. |
Implemented in XFTimeoutManager.
|
pure virtual |
Starts the timeout manager.
Implemented in XFTimeoutManager.
|
pure virtual |
Called periodically with a delay defined by TimeoutManager::_tickInterval.
On each call to this method, TimeoutManager::_tickInterval will be removed from the timeouts. When a timeout expires it is pushed back to the dispatcher. To which dispatcher it must be given is known by the reactive instance to which the timeout belongs.
Implemented in XFTimeoutManager.
|
pure virtual |
Removes all timeouts corresponding the given parameters.
Implemented in XFTimeoutManager.