interface::XFTimeoutManager Class Referenceabstract

Interface for TimerManager classes (and some few 'tick' stuff already provided). More...

`#include <timeoutmanager.h>`

Inheritance diagram for interface::XFTimeoutManager:
Collaboration diagram for interface::XFTimeoutManager:

## 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.

## Detailed Description

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:

- Implements the Singleton pattern
- Handle timeouts (hold, decrement, re-inject)

## Member Function Documentation

## addTimeout()

virtual void interface::XFTimeoutManager::addTimeout | ( | XFTimeout * | pNewTimeout | ) |

protectedpure virtual

Adds the timeout to the list of timeouts.

Implemented in XFTimeoutManager.

## initialize()

virtual void interface::XFTimeoutManager::initialize | ( | int32_t | tickInterval | ) |

inlinevirtual

Sets the time interval in milliseconds in which the timeout manager should handle the timeouts.

## scheduleTimeout()

virtual void interface::XFTimeoutManager::scheduleTimeout | ( | int32_t | timeoutId,
|  | int32_t | interval,
|  | interface::XFBehavior * | pBehavior
| ) |  |

pure virtual

Adds a timeout to the timeout manager.

Parameters

  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.

## start()

virtual void interface::XFTimeoutManager::start | ( | std::function< void(uint32_t)> | startTimeoutManagerTimer = `nullptr` | ) |

pure virtual

Starts the timeout manager.

Implemented in XFTimeoutManager.

## tick()

virtual void interface::XFTimeoutManager::tick | ( |  | ) |

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.

## unscheduleTimeout()

virtual void interface::XFTimeoutManager::unscheduleTimeout | ( | int32_t | timeoutId,
|  | interface::XFBehavior * | pBehavior
| ) |  |

pure virtual

Removes all timeouts corresponding the given parameters.

Implemented in XFTimeoutManager.

The documentation for this class was generated from the following files:

- C:/Users/thomas.sterren/Desktop/PTR_XF_Release/03-release/work/src/simplified/xf/include/xf/interface/timeoutmanager.h
- C:/Users/thomas.sterren/Desktop/PTR_XF_Release/03-release/work/src/simplified/xf/port/common/timeoutmanager.cpp