![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <events/MultipleTimeout.hpp>


Public Member Functions | |
| void | cancelAllTimeouts () |
| Cancel all timers set for objects of type T. | |
| void | cancelTimeout (const T &t) |
| Cancel the timer for object instance t. | |
| bool | hasTimeoutSet (const T &t) const |
| Is a timer set for object instance t? | |
| MultipleTimeout () | |
| size_t | numberOfTimeoutsSet () const |
| How many timers for objects of type T are set? | |
| virtual void | onTimeout (const T &t)=0 |
| Your callback. Implement this. | |
| void | setNewTimeout (const T &t, double delay) |
| Set the timer for object instance t. | |
| void | setTimeout (const T &t, double delay) |
| Set the timer for object instance t. | |
| virtual | ~MultipleTimeout () |
Private Types | |
| typedef std::map< T, wns::events::scheduler::IEventPtr > | EventMap |
| typedef MultipleTimeout< T > | MultipleTimeoutConcretion |
Private Attributes | |
| EventMap | events |
Friends | |
| class | TimeoutEvent |
Classes | |
| class | TimeoutEvent |
Definition at line 50 of file MultipleTimeout.hpp.
typedef std::map<T, wns::events::scheduler::IEventPtr> wns::events::MultipleTimeout< T >::EventMap [private] |
Definition at line 53 of file MultipleTimeout.hpp.
typedef MultipleTimeout<T> wns::events::MultipleTimeout< T >::MultipleTimeoutConcretion [private] |
Definition at line 52 of file MultipleTimeout.hpp.
| wns::events::MultipleTimeout< T >::MultipleTimeout | ( | ) | [inline] |
Definition at line 87 of file MultipleTimeout.hpp.
| virtual wns::events::MultipleTimeout< T >::~MultipleTimeout | ( | ) | [inline, virtual] |
Definition at line 92 of file MultipleTimeout.hpp.
| void wns::events::MultipleTimeout< T >::cancelAllTimeouts | ( | ) | [inline] |
Definition at line 177 of file MultipleTimeout.hpp.
| void wns::events::MultipleTimeout< T >::cancelTimeout | ( | const T & | t | ) | [inline] |
Cancel a previously set timer for object instance t.
Definition at line 163 of file MultipleTimeout.hpp.
| bool wns::events::MultipleTimeout< T >::hasTimeoutSet | ( | const T & | t | ) | const [inline] |
Definition at line 143 of file MultipleTimeout.hpp.
| size_t wns::events::MultipleTimeout< T >::numberOfTimeoutsSet | ( | ) | const [inline] |
Definition at line 152 of file MultipleTimeout.hpp.
| virtual void wns::events::MultipleTimeout< T >::onTimeout | ( | const T & | t | ) | [pure virtual] |
The deriver is forced to implement this method. It gets called with object instance t as parameter whose timer has fired.
Implemented in wns::markovchain::MarkovContinuousTime< T >, and wns::markovchain::MarkovContinuousTime< wns::markovchain::TrafficSpec >.
| void wns::events::MultipleTimeout< T >::setNewTimeout | ( | const T & | t, | |
| double | delay | |||
| ) | [inline] |
Set the timer to a relative time in seconds. When the time has elapsed, the method onTimeout(T t) gets called. The method onTimeout has to be implemented by the deriver.
At any time there can be only one valid timer per object instance t. If the timer for object instance t has been set already, it will be canceled silently. Use this function only if you are sure that you need this behaivior otherwise use the function setTimeout(...) to avoid probable error concealment.
Definition at line 131 of file MultipleTimeout.hpp.
| void wns::events::MultipleTimeout< T >::setTimeout | ( | const T & | t, | |
| double | delay | |||
| ) | [inline] |
Set the timer to a relative time in seconds. When the time has elapsed, the method onTimeout(T t) gets called. The method onTimeout has to be implemented by the deriver.
At any time there can be only one valid timer per object instance t. Hence, if the timer for object instance t has been set already an exception will be raised.
Definition at line 109 of file MultipleTimeout.hpp.
friend class TimeoutEvent [friend] |
Definition at line 55 of file MultipleTimeout.hpp.
EventMap wns::events::MultipleTimeout< T >::events [private] |
Definition at line 196 of file MultipleTimeout.hpp.
1.5.5