TTimer Class Reference¶
|
Simu5G
|
#include <TTimer.h>
Public Member Functions | |
| TTimer (cSimpleModule *module) | |
| void | start (simtime_t t) |
| void | stop () |
| void | handle () |
| unsigned int | getTimerId () const |
| void | setTimerId (unsigned int timerId_) |
| bool | busy () |
| bool | idle () |
| simtime_t | elapsed () |
| simtime_t | remaining () |
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. | |
| TTimerMsg * | intr_ = nullptr |
| Used for scheduling an event into the Omnet++ event scheduler. | |
| bool | busy_ = false |
| True if the timer has already been started. | |
| simtime_t | start_ |
| Last time the timer was started. | |
| simtime_t | expire_ |
| Expire time. | |
Detailed Description
Generic timer interface.
Constructor & Destructor Documentation
◆ TTimer()
|
inlineexplicit |
Member Function Documentation
◆ start()
| void start | ( | simtime_t | t | ) |
Start the timer. The timer is now busy. If the timer has already been started, then there is probably a programming error. Thus, we abort execution immediately.
- Parameters
-
t interval before timer is triggered
◆ stop()
| void stop | ( | ) |
Stop the timer, if busy. The timer is now idle.
◆ handle()
| void handle | ( | ) |
Call-back to signal the timer event handled by connected simpleModule
◆ 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_.
◆ busy()
|
inline |
◆ idle()
|
inline |
◆ elapsed()
|
inline |
◆ remaining()
|
inline |
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 TTimer().
◆ intr_
|
protected |
Used for scheduling an event into the Omnet++ event scheduler.
◆ busy_
|
protected |
◆ start_
◆ expire_
|
protected |
Expire time.
Referenced by remaining(), and TTimer().
Generated by