DESERT 4.0.0
UwCsmaAloha_Trigger_SINK::GenericTimer Class Reference

#include <uw-csma-aloha-trigger-sink.h>

Inheritance diagram for UwCsmaAloha_Trigger_SINK::GenericTimer:
Inheritance graph
Collaboration diagram for UwCsmaAloha_Trigger_SINK::GenericTimer:
Collaboration graph

Public Member Functions

 GenericTimer (UwCsmaAloha_Trigger_SINK *m)
 
virtual ~GenericTimer ()
 
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
 
UwCsmaAloha_Trigger_SINK *UW_CS_ALOHA_TRIG_SINK_TIMER_STATUS timer_status
 

Detailed Description

Class that describes the timers in the node

Constructor & Destructor Documentation

◆ GenericTimer()

UwCsmaAloha_Trigger_SINK::GenericTimer::GenericTimer ( UwCsmaAloha_Trigger_SINK m)
inline

Constructor of the GenericTimer class

Parameters
CsmaAloha*a pointer to an object of type CsmaAloha*

◆ ~GenericTimer()

virtual UwCsmaAloha_Trigger_SINK::GenericTimer::~GenericTimer ( )
inlinevirtual

Destructor of the GenericTimer class

Member Function Documentation

◆ freeze()

virtual void UwCsmaAloha_Trigger_SINK::GenericTimer::freeze ( )
inlinevirtual

◆ getCounter()

int UwCsmaAloha_Trigger_SINK::GenericTimer::getCounter ( )
inline

Returns the counter of the timer

Returns
the value of the counter of the timer

References counter.

◆ getDuration()

double UwCsmaAloha_Trigger_SINK::GenericTimer::getDuration ( )
inline

Returns the left duration of the timer

Returns
left duration of the timer

References left_duration.

◆ incrCounter()

void UwCsmaAloha_Trigger_SINK::GenericTimer::incrCounter ( )
inline

Increments the counter of the timer

References counter.

◆ isActive()

bool UwCsmaAloha_Trigger_SINK::GenericTimer::isActive ( )
inline

◆ isExpired()

bool UwCsmaAloha_Trigger_SINK::GenericTimer::isExpired ( )
inline

Checks if the timer is EXPIRED

Returns
true or false

References timer_status, and UwCsmaAloha_Trigger_SINK::UW_CS_ALOHA_TRIG_SINK_EXPIRED.

◆ isFrozen()

bool UwCsmaAloha_Trigger_SINK::GenericTimer::isFrozen ( )
inline

Checks if the timer is FROZEN

Returns
true or false

References timer_status, and UwCsmaAloha_Trigger_SINK::UW_CS_ALOHA_TRIG_SINK_FROZEN.

◆ isIdle()

bool UwCsmaAloha_Trigger_SINK::GenericTimer::isIdle ( )
inline

checks if the timer is IDLE

Returns
bool true or false

References timer_status, and UwCsmaAloha_Trigger_SINK::UW_CS_ALOHA_TRIG_SINK_IDLE.

◆ isRunning()

bool UwCsmaAloha_Trigger_SINK::GenericTimer::isRunning ( )
inline

checks if the timer is RUNNING

Returns
true or false

References timer_status, and UwCsmaAloha_Trigger_SINK::UW_CS_ALOHA_TRIG_SINK_RUNNING.

◆ resetCounter()

void UwCsmaAloha_Trigger_SINK::GenericTimer::resetCounter ( )
inline

Resets the counter of the timer

◆ schedule()

virtual void UwCsmaAloha_Trigger_SINK::GenericTimer::schedule ( double  val)
inlinevirtual

schedule a timer

Parameters
doublethe duration of the timer

References left_duration, start_time, timer_status, and UwCsmaAloha_Trigger_SINK::UW_CS_ALOHA_TRIG_SINK_RUNNING.

◆ stop()

virtual void UwCsmaAloha_Trigger_SINK::GenericTimer::stop ( )
inlinevirtual

◆ unFreeze()

virtual void UwCsmaAloha_Trigger_SINK::GenericTimer::unFreeze ( )
inlinevirtual

unFreezes is used to resume the timer starting from the point where it was freezed

References left_duration, start_time, timer_status, UwCsmaAloha_Trigger_SINK::UW_CS_ALOHA_TRIG_SINK_FROZEN, and UwCsmaAloha_Trigger_SINK::UW_CS_ALOHA_TRIG_SINK_RUNNING.

Member Data Documentation

◆ counter

int UwCsmaAloha_Trigger_SINK::GenericTimer::counter
protected

counter of the timer

Referenced by getCounter(), and incrCounter().

◆ left_duration

double UwCsmaAloha_Trigger_SINK::GenericTimer::left_duration
protected

Left duration of the timer

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

◆ start_time

double UwCsmaAloha_Trigger_SINK::GenericTimer::start_time
protected

Start Time of the timer

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

◆ timer_status

UwCsmaAloha_Trigger_SINK* UW_CS_ALOHA_TRIG_SINK_TIMER_STATUS UwCsmaAloha_Trigger_SINK::GenericTimer::timer_status
protected

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