DESERT 4.0.0
UWSmartOFDM::UWSmartOFDMTimer Class Reference

#include <uw-smart-ofdm.h>

Inheritance diagram for UWSmartOFDM::UWSmartOFDMTimer:
Inheritance graph
Collaboration diagram for UWSmartOFDM::UWSmartOFDMTimer:
Collaboration graph

Public Member Functions

 UWSmartOFDMTimer (UWSmartOFDM *m)
 
virtual ~UWSmartOFDMTimer ()
 
virtual double startTime ()
 
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
 
UWSmartOFDM *UWSMARTOFDM_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

◆ UWSmartOFDMTimer()

UWSmartOFDM::UWSmartOFDMTimer::UWSmartOFDMTimer ( UWSmartOFDM m)
inline

Constructor of UWSmartOFDMTimer Class.

◆ ~UWSmartOFDMTimer()

virtual UWSmartOFDM::UWSmartOFDMTimer::~UWSmartOFDMTimer ( )
inlinevirtual

Destructor of UWSmartOFDMTimer Class.

Member Function Documentation

◆ freeze()

virtual void UWSmartOFDM::UWSmartOFDMTimer::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, UWSmartOFDM::UWSMARTOFDM_FROZEN, and UWSmartOFDM::UWSMARTOFDM_RUNNING.

Referenced by UWSmartOFDM::stateRxBackoff().

◆ getCounter()

int UWSmartOFDM::UWSmartOFDMTimer::getCounter ( )
inline

It provides, how many times a timer ran.

Returns
number of times a timer ran (int).

References counter.

Referenced by UWSmartOFDM::getBackoffTime().

◆ getDuration()

double UWSmartOFDM::UWSmartOFDMTimer::getDuration ( )
inline

This methods provide the duration of a timer.

Returns
left time duration of a timer (double).

References left_duration.

Referenced by UWSmartOFDM::stateBackoff().

◆ incrCounter()

void UWSmartOFDM::UWSmartOFDMTimer::incrCounter ( )
inline

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

References counter.

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

◆ isActive()

bool UWSmartOFDM::UWSmartOFDMTimer::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, UWSmartOFDM::UWSMARTOFDM_FROZEN, and UWSmartOFDM::UWSMARTOFDM_RUNNING.

Referenced by UWSmartOFDM::stateCheckBackoffExpired(), and UWSmartOFDM::stateCheckCTSBackoffExpired().

◆ isExpired()

bool UWSmartOFDM::UWSmartOFDMTimer::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 UWSmartOFDM::UWSMARTOFDM_EXPIRED.

Referenced by UWSmartOFDM::stateCheckBackoffExpired(), and UWSmartOFDM::stateCheckCTSBackoffExpired().

◆ isFrozen()

bool UWSmartOFDM::UWSmartOFDMTimer::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 UWSmartOFDM::UWSMARTOFDM_FROZEN.

Referenced by UWSmartOFDM::stateBackoff().

◆ isIdle()

bool UWSmartOFDM::UWSmartOFDMTimer::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 UWSmartOFDM::UWSMARTOFDM_IDLE.

◆ isRunning()

bool UWSmartOFDM::UWSmartOFDMTimer::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 UWSmartOFDM::UWSMARTOFDM_RUNNING.

◆ resetCounter()

void UWSmartOFDM::UWSmartOFDMTimer::resetCounter ( )
inline

Reset the timer counter.

Referenced by UWSmartOFDM::stateTxData().

◆ schedule()

virtual void UWSmartOFDM::UWSmartOFDMTimer::schedule ( double  val)
inlinevirtual

◆ startTime()

virtual double UWSmartOFDM::UWSmartOFDMTimer::startTime ( )
inlinevirtual

References start_time.

◆ stop()

virtual void UWSmartOFDM::UWSmartOFDMTimer::stop ( )
inlinevirtual

◆ unFreeze()

virtual void UWSmartOFDM::UWSmartOFDMTimer::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, UWSmartOFDM::UWSMARTOFDM_FROZEN, and UWSmartOFDM::UWSMARTOFDM_RUNNING.

Referenced by UWSmartOFDM::stateBackoff().

Member Data Documentation

◆ counter

int UWSmartOFDM::UWSmartOFDMTimer::counter
protected

How many times a timer ran.

Referenced by getCounter(), and incrCounter().

◆ left_duration

double UWSmartOFDM::UWSmartOFDMTimer::left_duration
protected

How long a timer is going to run more.

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

◆ start_time

double UWSmartOFDM::UWSmartOFDMTimer::start_time
protected

Start time of a timer.

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

◆ timer_status


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