![]() |
PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
|
Timer which allows to call function every time a defined ellapsed time is out. More...
#include <PTimer.h>
Public Member Functions | |
| size_t | getEllapsedTime () const |
| Get the ellapsed time in nanoseconds. More... | |
| bool | isTime () |
| Returns true if the given ellapsed time between to call is passed. More... | |
| bool | isTime (size_t &ellapsedTimeNs) |
| Returns true if the given ellapsed time between to call is passed. More... | |
| PTimer & | operator= (const PTimer &other) |
| Definition of equal operator of PTimer. More... | |
| PTimer (const PTimer &other) | |
| Copy constructor of PTimer. More... | |
| PTimer (size_t ellapsedTime=1lu) | |
| Default constructor of PTimer. More... | |
| void | setEllapsedTime (size_t ellapsedTime) |
| Set the ellapsed time in nanoseconds. More... | |
| void | start () |
| Start the current clock. More... | |
| virtual | ~PTimer () |
| Destructor of PTimer. More... | |
Protected Member Functions | |
| void | copyPTimer (const PTimer &other) |
| Copy function of PTimer. More... | |
Private Member Functions | |
| void | initialisationPTimer () |
| Initialisation function of the class PTimer. More... | |
Private Attributes | |
| size_t | p_ellapsedTime |
| Ellapsed time between to isTime() returns true (in nanoseconds) More... | |
| std::chrono::time_point< std::chrono::steady_clock > | p_startTime |
| Clock of the PTimer. More... | |
Timer which allows to call function every time a defined ellapsed time is out.
| PTimer::PTimer | ( | size_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().
Here is the call graph for this function:| PTimer::PTimer | ( | const PTimer & | other | ) |
Copy constructor of PTimer.
| other | : class to copy |
Definition at line 21 of file PTimer.cpp.
References copyPTimer().
Here is the call graph for this function:
|
virtual |
|
protected |
Copy function of PTimer.
| other | : class to copy |
Definition at line 83 of file PTimer.cpp.
References p_ellapsedTime, and p_startTime.
Referenced by operator=(), and PTimer().
Here is the caller graph for this function:| size_t PTimer::getEllapsedTime | ( | ) | const |
Get the ellapsed time in nanoseconds.
Definition at line 54 of file PTimer.cpp.
References p_ellapsedTime.
Referenced by testPTimer().
Here is the caller graph for this function:
|
private |
| bool PTimer::isTime | ( | ) |
Returns true if the given ellapsed time between to call is passed.
Definition at line 61 of file PTimer.cpp.
Referenced by testPTimer().
Here is the caller graph for this function:| bool PTimer::isTime | ( | size_t & | ellapsedTimeNs | ) |
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) |
Definition at line 70 of file PTimer.cpp.
References p_ellapsedTime, p_startTime, and start().
Here is the call graph for this function:Definition of equal operator of PTimer.
| other | : class to copy |
Definition at line 34 of file PTimer.cpp.
References copyPTimer().
Here is the call graph for this function:| void PTimer::setEllapsedTime | ( | size_t | ellapsedTime | ) |
Set the ellapsed time in nanoseconds.
| ellapsedTime | : ellapsed time in nanoseconds |
Definition at line 47 of file PTimer.cpp.
References p_ellapsedTime.
Referenced by testPTimer().
Here is the caller graph for this function:| void PTimer::start | ( | ) |
Start the current clock.
Definition at line 40 of file PTimer.cpp.
References p_startTime.
Referenced by initialisationPTimer(), and isTime().
Here is the caller graph for this function:
|
private |
Ellapsed time between to isTime() returns true (in nanoseconds)
Definition at line 41 of file PTimer.h.
Referenced by copyPTimer(), getEllapsedTime(), isTime(), and setEllapsedTime().
|
private |