DESERT 3.6.0
Loading...
Searching...
No Matches
CsmaAloha::AlohaTimer Class Reference

#include <uw-csma-aloha.h>

Inheritance diagram for CsmaAloha::AlohaTimer:
Collaboration diagram for CsmaAloha::AlohaTimer:

Public Member Functions

 AlohaTimer (CsmaAloha *m)
 
virtual ~AlohaTimer ()=default
 
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 () const
 
double getDuration () const
 

Protected Attributes

double start_time
 
double left_duration
 
int counter
 
CsmaAloha *CSMA_TIMER_STATUS timer_status
 

Detailed Description

Class that describes the timers in the node.

Definition at line 152 of file uw-csma-aloha.h.

Constructor & Destructor Documentation

◆ AlohaTimer()

CsmaAloha::AlohaTimer::AlohaTimer ( CsmaAloha m)
inline

Constructor of the AlohaTimer class.

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

Definition at line 159 of file uw-csma-aloha.h.

◆ ~AlohaTimer()

virtual CsmaAloha::AlohaTimer::~AlohaTimer ( )
virtualdefault

Destructor of the AlohaTimer class.

Member Function Documentation

◆ freeze()

virtual void CsmaAloha::AlohaTimer::freeze ( )
inlinevirtual

Freezes the timer.

Definition at line 179 of file uw-csma-aloha.h.

◆ getCounter()

int CsmaAloha::AlohaTimer::getCounter ( ) const
inline

Returns the counter of the timer.

Returns
the value of the counter of the timer

Definition at line 301 of file uw-csma-aloha.h.

◆ getDuration()

double CsmaAloha::AlohaTimer::getDuration ( ) const
inline

Returns the left duration of the timer.

Returns
left duration of the timer

Definition at line 311 of file uw-csma-aloha.h.

◆ incrCounter()

void CsmaAloha::AlohaTimer::incrCounter ( )
inline

Increments the counter of the timer.

Definition at line 291 of file uw-csma-aloha.h.

◆ isActive()

bool CsmaAloha::AlohaTimer::isActive ( )
inline

Checks if the timer is ACTIVE.

Returns
true or false

Definition at line 272 of file uw-csma-aloha.h.

◆ isExpired()

bool CsmaAloha::AlohaTimer::isExpired ( )
inline

Checks if the timer is EXPIRED.

Returns
true or false

Definition at line 252 of file uw-csma-aloha.h.

◆ isFrozen()

bool CsmaAloha::AlohaTimer::isFrozen ( )
inline

Checks if the timer is FROZEN.

Returns
true or false

Definition at line 262 of file uw-csma-aloha.h.

◆ isIdle()

bool CsmaAloha::AlohaTimer::isIdle ( )
inline

checks if the timer is IDLE

Returns
bool true or false

Definition at line 231 of file uw-csma-aloha.h.

◆ isRunning()

bool CsmaAloha::AlohaTimer::isRunning ( )
inline

checks if the timer is RUNNING

Returns
true or false

Definition at line 241 of file uw-csma-aloha.h.

◆ resetCounter()

void CsmaAloha::AlohaTimer::resetCounter ( )
inline

Resets the counter of the timer.

Definition at line 282 of file uw-csma-aloha.h.

◆ schedule()

virtual void CsmaAloha::AlohaTimer::schedule ( double  val)
inlinevirtual

schedule a timer

Parameters
doublethe duration of the timer

Definition at line 218 of file uw-csma-aloha.h.

◆ stop()

virtual void CsmaAloha::AlohaTimer::stop ( )
inlinevirtual

stops the timer

Definition at line 207 of file uw-csma-aloha.h.

◆ unFreeze()

virtual void CsmaAloha::AlohaTimer::unFreeze ( )
inlinevirtual

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

Definition at line 194 of file uw-csma-aloha.h.

Member Data Documentation

◆ counter

int CsmaAloha::AlohaTimer::counter
protected

counter of the timer

Definition at line 321 of file uw-csma-aloha.h.

◆ left_duration

double CsmaAloha::AlohaTimer::left_duration
protected

Left duration of the timer.

Definition at line 319 of file uw-csma-aloha.h.

◆ start_time

double CsmaAloha::AlohaTimer::start_time
protected

Start Time of the timer.

Definition at line 317 of file uw-csma-aloha.h.

◆ timer_status

CsmaAloha* CSMA_TIMER_STATUS CsmaAloha::AlohaTimer::timer_status
protected

< Pointer to an object of type CsmaAloha

Timer status

Definition at line 324 of file uw-csma-aloha.h.


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