DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Member Functions | Private Attributes | List of all members
Diades::Utils::Timer Class Reference

#include <Timer.hh>

Public Member Functions

 Timer (const string &label, long int delay)
 
void checkTimeOut ()
 
bool activated () const
 
long int getTime () const
 

Private Attributes

string labl
 
long int timeOut
 

Detailed Description

Manage a timer with a given delay

Definition at line 71 of file Timer.hh.

Constructor & Destructor Documentation

◆ Timer()

Diades::Utils::Timer::Timer ( const string &  label,
long int  delay 
)

Constructor

Parameters
labelof the timer.
delayin millisecond before the time out. (user time) Create a Timer. Calling checkTimeOut() will throw an TimerTimeOut exception if the time exceeds 'delay' milliseconds after the activation of the Timer.
Precondition
An Interruptible object is an object that implements the method timeOut().

Member Function Documentation

◆ activated()

bool Diades::Utils::Timer::activated ( ) const
inline

Is the Timer activated

Returns
true if the Timer is activated

Definition at line 105 of file Timer.hh.

◆ checkTimeOut()

void Diades::Utils::Timer::checkTimeOut ( )

Check for a timeout Throw a TimerTimeOut excpetion if the delay has expired.

◆ getTime()

long int Diades::Utils::Timer::getTime ( ) const
Returns
the user time for the process in milliseconds

Member Data Documentation

◆ labl

string Diades::Utils::Timer::labl
private

Definition at line 75 of file Timer.hh.

◆ timeOut

long int Diades::Utils::Timer::timeOut
private

Definition at line 78 of file Timer.hh.


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