DESERT 4.0.0
UWOFDMAloha::UWOFDMAlohaTimer Class Reference

#include <uw-ofdm-aloha.h>

Inheritance diagram for UWOFDMAloha::UWOFDMAlohaTimer:
Inheritance graph
Collaboration diagram for UWOFDMAloha::UWOFDMAlohaTimer:
Collaboration graph

Public Member Functions

 UWOFDMAlohaTimer (UWOFDMAloha *m)
 
virtual ~UWOFDMAlohaTimer ()
 
virtual void freeze ()
 
virtual void unFreeze ()
 
virtual void stop ()
 
virtual void schedule (double val)
 
bool isIdle ()
 
bool isRunning ()
 
bool isExpired ()
 
bool isFrozen ()
 
bool isActive ()
 
void resetCounter ()
 
void incrCounter ()
 
int getCounter ()
 
double getDuration ()
 

Protected Attributes

double start_time
 
double left_duration
 
int counter
 
UWOFDMAloha *UWOFDMALOHA_TIMER_STATUS timer_status
 

Detailed Description

Base class of all the timer used in this protocol. This is a derived class of TimerHandler.

Constructor & Destructor Documentation

◆ UWOFDMAlohaTimer()

UWOFDMAloha::UWOFDMAlohaTimer::UWOFDMAlohaTimer ( UWOFDMAloha m)
inline

Constructor of UWOFDMAlohaTimer Class.

◆ ~UWOFDMAlohaTimer()

virtual UWOFDMAloha::UWOFDMAlohaTimer::~UWOFDMAlohaTimer ( )
inlinevirtual

Destructor of UWOFDMAlohaTimer Class.

Member Function Documentation

◆ freeze()

virtual void UWOFDMAloha::UWOFDMAlohaTimer::freeze ( )
inlinevirtual

It freezes or in another word, it stops the timer for some time. Suppose, for some reason we want to stop a timer for some period and we want to run this timer from where it was stopped. This function stops the timer and save the left time duration it must run.

References left_duration, start_time, timer_status, UWOFDMAloha::UWOFDMALOHA_FROZEN, and UWOFDMAloha::UWOFDMALOHA_RUNNING.

Referenced by UWOFDMAloha::stateRxBackoff().

◆ getCounter()

int UWOFDMAloha::UWOFDMAlohaTimer::getCounter ( )
inline

It provides, how many times a timer ran.

Returns
number of times a timer ran (int).

References counter.

Referenced by UWOFDMAloha::getBackoffTime().

◆ getDuration()

double UWOFDMAloha::UWOFDMAlohaTimer::getDuration ( )
inline

This methods provide the duration of a timer.

Returns
left time duration of a timer (double).

References left_duration.

Referenced by UWOFDMAloha::stateBackoff().

◆ incrCounter()

void UWOFDMAloha::UWOFDMAlohaTimer::incrCounter ( )
inline

Increment the timer counter. It helps to know the statics of the timer.

References counter.

Referenced by UWOFDMAloha::getBackoffTime(), and UWOFDMAloha::stateTxData().

◆ isActive()

bool UWOFDMAloha::UWOFDMAlohaTimer::isActive ( )
inline

It tells whether the timer is active or not.

Returns
1 if the timer is active and 0 if it is not.

References timer_status, UWOFDMAloha::UWOFDMALOHA_FROZEN, and UWOFDMAloha::UWOFDMALOHA_RUNNING.

Referenced by UWOFDMAloha::stateCheckBackoffExpired().

◆ isExpired()

bool UWOFDMAloha::UWOFDMAlohaTimer::isExpired ( )
inline

Tells whether the timer is expired or not.

Returns
1 if the timer expired and 0 if it is not.

References timer_status, and UWOFDMAloha::UWOFDMALOHA_EXPIRED.

Referenced by UWOFDMAloha::stateCheckBackoffExpired().

◆ isFrozen()

bool UWOFDMAloha::UWOFDMAlohaTimer::isFrozen ( )
inline

It tells whether the timer is in freeze mode or not.

Returns
1 if the timer is in freeze mode and 0 if it is not.

References timer_status, and UWOFDMAloha::UWOFDMALOHA_FROZEN.

Referenced by UWOFDMAloha::stateBackoff().

◆ isIdle()

bool UWOFDMAloha::UWOFDMAlohaTimer::isIdle ( )
inline

It tells whether the timer is in Idle state or not.

Returns
1 if the timer is idle and 0 if it is not.

References timer_status, and UWOFDMAloha::UWOFDMALOHA_IDLE.

◆ isRunning()

bool UWOFDMAloha::UWOFDMAlohaTimer::isRunning ( )
inline

This method tells whether the timer is in Running state or not.

Returns
1 if the timer is running and 0 if it is not.

References timer_status, and UWOFDMAloha::UWOFDMALOHA_RUNNING.

◆ resetCounter()

void UWOFDMAloha::UWOFDMAlohaTimer::resetCounter ( )
inline

Reset the timer counter.

Referenced by UWOFDMAloha::stateTxData().

◆ schedule()

virtual void UWOFDMAloha::UWOFDMAlohaTimer::schedule ( double  val)
inlinevirtual

Schedule the time, i.e., how long a timer is going to run.

Parameters
doubletime

References left_duration, start_time, timer_status, and UWOFDMAloha::UWOFDMALOHA_RUNNING.

Referenced by UWOFDMAloha::stateBackoff().

◆ stop()

virtual void UWOFDMAloha::UWOFDMAlohaTimer::stop ( )
inlinevirtual

◆ unFreeze()

virtual void UWOFDMAloha::UWOFDMAlohaTimer::unFreeze ( )
inlinevirtual

It starts the timer from where it was stopped. To run any freeze timer, we can use unfreeze method.

References left_duration, start_time, timer_status, UWOFDMAloha::UWOFDMALOHA_FROZEN, and UWOFDMAloha::UWOFDMALOHA_RUNNING.

Referenced by UWOFDMAloha::stateBackoff().

Member Data Documentation

◆ counter

int UWOFDMAloha::UWOFDMAlohaTimer::counter
protected

How many times a timer ran.

Referenced by getCounter(), and incrCounter().

◆ left_duration

double UWOFDMAloha::UWOFDMAlohaTimer::left_duration
protected

How long a timer is going to run more.

Referenced by freeze(), getDuration(), schedule(), and unFreeze().

◆ start_time

double UWOFDMAloha::UWOFDMAlohaTimer::start_time
protected

Start time of a timer.

Referenced by freeze(), schedule(), and unFreeze().

◆ timer_status

UWOFDMAloha* UWOFDMALOHA_TIMER_STATUS UWOFDMAloha::UWOFDMAlohaTimer::timer_status
protected

< Pointer of UWOFDMAloha module. Set the status of the timer.

Referenced by UWOFDMAloha::AckTimer::expire(), freeze(), isActive(), isExpired(), isFrozen(), isIdle(), isRunning(), schedule(), stop(), and unFreeze().


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