![]() |
|
PhoenixClock
2.2.0
Library wrapping the usage of system's clock, allowing to use clock mock-ups
|
Timer which allows to call function every time a defined ellapsed time is out. More...
#include <PTimer.h>
Public Member Functions | |
| time_t | getEllapsedTime () const |
| Get the ellapsed time in nanoseconds. | |
| bool | isTime (time_t &ellapsedTimeNs, time_t currentTime) |
| Returns true if the given ellapsed time between to call is passed. | |
| bool | isTime (time_t currentTime) |
| Returns true if the given ellapsed time between to call is passed. | |
| PTimer & | operator= (const PTimer &other) |
| Definition of equal operator of PTimer. | |
| PTimer (const PTimer &other) | |
| Copy constructor of PTimer. | |
| PTimer (time_t ellapsedTime=1lu) | |
| Default constructor of PTimer. | |
| void | setEllapsedTime (time_t ellapsedTime) |
| Set the ellapsed time in nanoseconds. | |
| void | setStartTime (time_t startTime) |
| Start the current clock. | |
| virtual | ~PTimer () |
| Destructor of PTimer. | |
Protected Member Functions | |
| void | copyPTimer (const PTimer &other) |
| Copy function of PTimer. | |
Private Member Functions | |
| void | initialisationPTimer () |
| Initialisation function of the class PTimer. | |
Private Attributes | |
| time_t | p_ellapsedTime |
| Ellapsed time between to isTime() returns true (in nanoseconds) | |
| time_t | p_startTime |
| Clock of the PTimer. | |
Timer which allows to call function every time a defined ellapsed time is out.
| PTimer::PTimer | ( | time_t | ellapsedTime = 1lu | ) |
Default constructor of PTimer.
| ellapsedTime | : ellapsed time between two calls (in nanoseconds) |
Definition at line 12 of file PTimer.cpp.
References initialisationPTimer(), p_ellapsedTime, and p_startTime.
Referenced by copyPTimer(), operator=(), and PTimer().
Here is the call graph for this function:
Here is the caller graph for this function:| PTimer::PTimer | ( | const PTimer & | other | ) |
Copy constructor of PTimer.
| other | : class to copy |
Definition at line 22 of file PTimer.cpp.
References copyPTimer(), and PTimer().
Here is the call graph for this function:
|
virtual |
|
protected |
Copy function of PTimer.
| other | : class to copy |
Definition at line 87 of file PTimer.cpp.
References p_ellapsedTime, p_startTime, and PTimer().
Referenced by operator=(), and PTimer().
Here is the call graph for this function:
Here is the caller graph for this function:| time_t PTimer::getEllapsedTime | ( | ) | const |
Get the ellapsed time in nanoseconds.
Definition at line 57 of file PTimer.cpp.
References p_ellapsedTime.
|
private |
Initialisation function of the class PTimer.
Definition at line 93 of file PTimer.cpp.
Referenced by PTimer().
Here is the caller graph for this function:| bool PTimer::isTime | ( | time_t & | ellapsedTimeNs, |
| time_t | currentTime ) |
Returns true if the given ellapsed time between to call is passed.
| [out] | ellapsedTimeNs | : real ellapsed time in nanoseconds between the call of isTime and the last start of the PTimer (maybe in another isTime) |
| currentTime | : current time |
Definition at line 75 of file PTimer.cpp.
References p_ellapsedTime, p_startTime, and setStartTime().
Here is the call graph for this function:| bool PTimer::isTime | ( | time_t | currentTime | ) |
Returns true if the given ellapsed time between to call is passed.
| currentTime | : current time |
Definition at line 65 of file PTimer.cpp.
References isTime().
Referenced by isTime().
Here is the call graph for this function:
Here is the caller graph for this function:Definition of equal operator of PTimer.
| other | : class to copy |
Definition at line 35 of file PTimer.cpp.
References copyPTimer(), and PTimer().
Here is the call graph for this function:| void PTimer::setEllapsedTime | ( | time_t | ellapsedTime | ) |
Set the ellapsed time in nanoseconds.
| ellapsedTime | : ellapsed time in nanoseconds |
Definition at line 50 of file PTimer.cpp.
References p_ellapsedTime.
| void PTimer::setStartTime | ( | time_t | currentTime | ) |
Start the current clock.
| currentTime | : current time |
Definition at line 43 of file PTimer.cpp.
References p_startTime.
Referenced by isTime().
Here is the caller graph for this function:
|
private |
Ellapsed time between to isTime() returns true (in nanoseconds)
Definition at line 37 of file PTimer.h.
Referenced by copyPTimer(), getEllapsedTime(), isTime(), PTimer(), and setEllapsedTime().
|
private |
Clock of the PTimer.
Definition at line 35 of file PTimer.h.
Referenced by copyPTimer(), isTime(), PTimer(), and setStartTime().