TMultiTimer Class Reference¶
|
Simu5G
|
#include <TTimer.h>
Public Member Functions | |
| TMultiTimer (cSimpleModule *module) | |
| Build an idle multi-timer. | |
| virtual void | add (simtime_t t, unsigned int event) |
| unsigned int | getTimerId () const |
| void | setTimerId (unsigned int timerId_) |
| virtual void | remove (const unsigned int event) |
| void | handle (unsigned int event) |
| virtual bool | busy () const |
| virtual bool | busy (const unsigned int event) const |
| virtual bool | idle () const |
Protected Types | |
| typedef std::multimap< constsimtime_t, constunsignedint >::iterator | Event_it |
| Event iterator. | |
Protected Attributes | |
| unsigned int | timerId_ = 0 |
| Timer identifier - will be inserted in each timer-generated message. | |
| opp_component_ptr< cSimpleModule > | module_ |
| Object for handling the event. | |
| TMultiTimerMsg * | intr_ = nullptr |
| Used for scheduling an event into the Omnet++ event scheduler. | |
| bool | busy_ = false |
| True if there is at least one scheduled event. | |
| std::multimap< const simtime_t, const unsigned int > | directList_ |
| The event list. | |
| std::map< const unsigned int, const Event_it > | reverseList_ |
| The removable list. Each event id matches with an iterator. | |
Detailed Description
Generic multi-timer interface.
A multi-timer is a timer that handles many events. Events are just added to the multi-timer, which will dispatch them all when needed. To distinguish between different events, the module handler will receive a message with an event id specified by the user.
Member Typedef Documentation
◆ Event_it
|
protected |
Event iterator.
Constructor & Destructor Documentation
◆ TMultiTimer()
|
inline |
Build an idle multi-timer.
References module_.
Member Function Documentation
◆ add()
|
virtual |
Add an event to the multi-timer, with a specified parameter.
- Parameters
-
t the scheduled event time event the event id
◆ getTimerId()
|
inline |
Gets the timer identifier which is inserted into each timer message
- Returns
- The timer identifier
References timerId_.
◆ setTimerId()
|
inline |
Sets the timer identifier which is inserted into each timer message
- Parameters
-
timerId_ The timer identifier
References timerId_.
◆ remove()
|
virtual |
Remove an event. Note that event ids are assumed to be unique
- Parameters
-
event event to be removed
◆ handle()
| void handle | ( | unsigned int | event | ) |
Callback to signal the timer event handled by connected simpleModule
- Parameters
-
event event to be signaled
◆ busy() [1/2]
|
inlinevirtual |
Return true if there is at least one scheduled event.
- Returns
- whether there is at least one scheduled event
References busy_.
◆ busy() [2/2]
|
virtual |
Return true if the event id exists
- Parameters
-
event the event id to be checked
- Returns
- if the event <event> has been scheduled
◆ idle()
|
inlinevirtual |
Return true if there are no scheduled events.
- Returns
- whether there are no scheduled events
References busy_.
Member Data Documentation
◆ timerId_
|
protected |
Timer identifier - will be inserted in each timer-generated message.
Referenced by getTimerId(), and setTimerId().
◆ module_
|
protected |
Object for handling the event.
Referenced by TMultiTimer().
◆ intr_
|
protected |
Used for scheduling an event into the Omnet++ event scheduler.
◆ busy_
|
protected |
◆ directList_
|
protected |
The event list.
More than one event can have the same finish time.
◆ reverseList_
|
protected |
The removable list. Each event id matches with an iterator.
Generated by