DESERT 3.5.1
Loading...
Searching...
No Matches
MMacUWSR::UWSRTimer Class Reference

#include <uwsr.h>

Inheritance diagram for MMacUWSR::UWSRTimer:
Collaboration diagram for MMacUWSR::UWSRTimer:

Public Member Functions

 UWSRTimer (MMacUWSR *m)
 
virtual ~UWSRTimer ()
 
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 ()
 
double leftDuration ()
 

Protected Attributes

double start_time
 
double left_duration
 
int counter
 
MMacUWSR *UWSR_TIMER_STATUS timer_status
 

Detailed Description

Base class of all the timer used in this protocol.

This is a derived class of TimerHandler.

Definition at line 193 of file uwsr.h.

Constructor & Destructor Documentation

◆ UWSRTimer()

MMacUWSR::UWSRTimer::UWSRTimer ( MMacUWSR m)
inline

Constructor of UWSRTimer Class.

Definition at line 200 of file uwsr.h.

◆ ~UWSRTimer()

virtual MMacUWSR::UWSRTimer::~UWSRTimer ( )
inlinevirtual

Destructor of UWSRTimer Class.

Definition at line 214 of file uwsr.h.

Member Function Documentation

◆ freeze()

virtual void MMacUWSR::UWSRTimer::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.

Definition at line 225 of file uwsr.h.

◆ getCounter()

int MMacUWSR::UWSRTimer::getCounter ( )
inline

It provides, how many times a timer ran.

Returns
number of times a timer ran (int).

Definition at line 347 of file uwsr.h.

◆ getDuration()

double MMacUWSR::UWSRTimer::getDuration ( )
inline

This methods provide the duration of a timer.

Returns
duration of a timer (double).

Definition at line 357 of file uwsr.h.

◆ incrCounter()

void MMacUWSR::UWSRTimer::incrCounter ( )
inline

Increment the timer counter.

It helps to know the statics of the timer.

Definition at line 337 of file uwsr.h.

◆ isActive()

bool MMacUWSR::UWSRTimer::isActive ( )
inline

It tells whether the timer is active or not.

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

Definition at line 317 of file uwsr.h.

◆ isExpired()

bool MMacUWSR::UWSRTimer::isExpired ( )
inline

Tells whether the timer is expired or not.

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

Definition at line 297 of file uwsr.h.

◆ isFrozen()

bool MMacUWSR::UWSRTimer::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.

Definition at line 307 of file uwsr.h.

◆ isIdle()

bool MMacUWSR::UWSRTimer::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.

Definition at line 277 of file uwsr.h.

◆ isRunning()

bool MMacUWSR::UWSRTimer::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.

Definition at line 287 of file uwsr.h.

◆ leftDuration()

double MMacUWSR::UWSRTimer::leftDuration ( )
inline

This methods provide the remaining duration of a timer.

Returns
left time duration of a timer (double).

Definition at line 367 of file uwsr.h.

◆ resetCounter()

void MMacUWSR::UWSRTimer::resetCounter ( )
inline

Reset the timer counter.

Definition at line 327 of file uwsr.h.

◆ schedule()

virtual void MMacUWSR::UWSRTimer::schedule ( double  val)
inlinevirtual

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

Parameters
doubletime

Definition at line 264 of file uwsr.h.

◆ stop()

virtual void MMacUWSR::UWSRTimer::stop ( )
inlinevirtual

Stop the timer any way.

Definition at line 253 of file uwsr.h.

◆ unFreeze()

virtual void MMacUWSR::UWSRTimer::unFreeze ( )
inlinevirtual

It starts the timer from where it was stopped.

To run any freeze timer, we can use unfreeze method.

Definition at line 240 of file uwsr.h.

Member Data Documentation

◆ counter

int MMacUWSR::UWSRTimer::counter
protected

How many times a timer ran.

Definition at line 377 of file uwsr.h.

◆ left_duration

double MMacUWSR::UWSRTimer::left_duration
protected

How long a timer is going to run more.

Definition at line 375 of file uwsr.h.

◆ start_time

double MMacUWSR::UWSRTimer::start_time
protected

Start time of a timer.

Definition at line 373 of file uwsr.h.

◆ timer_status

MMacUWSR* UWSR_TIMER_STATUS MMacUWSR::UWSRTimer::timer_status
protected

< Pointer of MMacUWSR module.

Set the status of the timer.

Definition at line 381 of file uwsr.h.


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