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

#include <Timer.hh>

Public Member Functions

void checkTimeOut ()
 
void createTimer (const string &label, long int delay)
 
void stopTimer (const string &label)
 
long int getTime (const string &label) const
 

Static Public Member Functions

static TimerFactoryInstance ()
 

Protected Member Functions

 TimerFactory ()
 

Private Attributes

map< string, Timer * > timers
 

Static Private Attributes

static TimerFactory_instance
 

Detailed Description

(singleton pattern) Creation of timers Everytime TimerFactory::Instance()->checkTimeOut() is called, it checks if created timers are still running

Definition at line 123 of file Timer.hh.

Constructor & Destructor Documentation

◆ TimerFactory()

Diades::Utils::TimerFactory::TimerFactory ( )
inlineprotected

Definition at line 131 of file Timer.hh.

Member Function Documentation

◆ checkTimeOut()

void Diades::Utils::TimerFactory::checkTimeOut ( )

Check for timeouts in the list of created timers The first Timer with a timeout throws a TimerTimeOut exception and is stopped.

◆ createTimer()

void Diades::Utils::TimerFactory::createTimer ( const string &  label,
long int  delay 
)

Creation of a Timer

Parameters
labelLabel of the timer to create
delayDelay of the timer to create
Precondition
the label is not the label of a preexisting timer.

◆ getTime()

long int Diades::Utils::TimerFactory::getTime ( const string &  label) const
inline

Get the time of a given timer label

Parameters
labelLabel

Definition at line 159 of file Timer.hh.

◆ Instance()

static TimerFactory* Diades::Utils::TimerFactory::Instance ( )
static

◆ stopTimer()

void Diades::Utils::TimerFactory::stopTimer ( const string &  label)

Stop the timer of a given label

Parameters
labelLabel

Member Data Documentation

◆ _instance

TimerFactory* Diades::Utils::TimerFactory::_instance
staticprivate

Definition at line 127 of file Timer.hh.

◆ timers

map<string,Timer *> Diades::Utils::TimerFactory::timers
private

Definition at line 128 of file Timer.hh.


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