PhoenixClock  0.4.0
Library wrapping the usage of system's clock, allowing to use clock mock-ups
Loading...
Searching...
No Matches
PTimer.h
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7#ifndef __PTIMER_H__
8#define __PTIMER_H__
9
10#include "PGenericClock.h"
11
13class PTimer{
14 public:
15 PTimer(time_t ellapsedTime = 1lu);
16 PTimer(const PTimer & other);
17 virtual ~PTimer();
18 PTimer & operator = (const PTimer & other);
19
20 void setStartTime(time_t startTime);
21
22 void setEllapsedTime(time_t ellapsedTime);
23 time_t getEllapsedTime() const;
24
25 bool isTime(time_t currentTime);
26 bool isTime(time_t & ellapsedTimeNs, time_t currentTime);
27
28 protected:
29 void copyPTimer(const PTimer& other);
30
31 private:
33
38};
39
40#endif
41
time_t p_ellapsedTime
Ellapsed time between to isTime() returns true (in nanoseconds)
Definition PTimer.h:37
void setEllapsedTime(time_t ellapsedTime)
Set the ellapsed time in nanoseconds.
Definition PTimer.cpp:50
time_t getEllapsedTime() const
Get the ellapsed time in nanoseconds.
Definition PTimer.cpp:57
void setStartTime(time_t startTime)
Start the current clock.
Definition PTimer.cpp:43
PTimer(time_t ellapsedTime=1lu)
Default constructor of PTimer.
Definition PTimer.cpp:12
bool isTime(time_t currentTime)
Returns true if the given ellapsed time between to call is passed.
Definition PTimer.cpp:65
void initialisationPTimer()
Initialisation function of the class PTimer.
Definition PTimer.cpp:93
time_t p_startTime
Clock of the PTimer.
Definition PTimer.h:35
virtual ~PTimer()
Destructor of PTimer.
Definition PTimer.cpp:27
void copyPTimer(const PTimer &other)
Copy function of PTimer.
Definition PTimer.cpp:87
PTimer & operator=(const PTimer &other)
Definition of equal operator of PTimer.
Definition PTimer.cpp:35