![]() |
PhoenixClockMock
2.0.0
Tool to manipulate mock of clock (split, merge and get info)
|
Nanosecond clock. More...
#include <PClockNs.h>
Public Types | |
typedef std::chrono::nanoseconds | Nanosecond |
typedef std::chrono::steady_clock | SteadyClock |
typedef std::chrono::time_point< SteadyClock > | TimeNs |
Public Member Functions | |
std::string | getDateCompactNs () const |
Get the date at nanosecond precision (even if it is not precise at the nanosecond scale, it is normally coherent at this scale) More... | |
std::string | getDateNs () const |
Get the date at nanosecond precision (even if it is not precise at the nanosecond scale, it is normally coherent at this scale) More... | |
std::time_t | getFullTimeNs () const |
Get the full time in nanoseconds. More... | |
std::time_t | getOffsetTimeNs () const |
Get the offset in nanoseconds of the current clock. More... | |
PClockNs & | operator= (const PClockNs &other) |
Definition of equal operator of PClockNs. More... | |
PClockNs () | |
Default constructor of PClockNs. More... | |
PClockNs (const PClockNs &other) | |
Copy constructor of PClockNs. More... | |
void | setOffsetTimeNs (std::time_t offsetTimeNs) |
Set the offset in nanoseconds of the current clock. More... | |
virtual | ~PClockNs () |
Destructor of PClockNs. More... | |
Protected Member Functions | |
void | copyPClockNs (const PClockNs &other) |
Copy function of PClockNs. More... | |
Private Member Functions | |
void | initialisationPClockNs () |
Initialisation function of the class PClockNs. More... | |
Private Attributes | |
TimeNs | p_baseSteadyClockNs |
Base clock time with a nanosecond precision but since the starting of the CPU. More... | |
std::time_t | p_baseSystemClockSecond |
Base of the system clock in second. More... | |
std::time_t | p_offsetTimeNs |
Offset of time with date and nanoseconds. More... | |
Nanosecond clock.
Definition at line 16 of file PClockNs.h.
typedef std::chrono::nanoseconds PClockNs::Nanosecond |
Definition at line 19 of file PClockNs.h.
typedef std::chrono::steady_clock PClockNs::SteadyClock |
Definition at line 18 of file PClockNs.h.
typedef std::chrono::time_point<SteadyClock> PClockNs::TimeNs |
Definition at line 20 of file PClockNs.h.
PClockNs::PClockNs | ( | ) |
Default constructor of PClockNs.
Definition at line 43 of file PClockNs.cpp.
References initialisationPClockNs().
PClockNs::PClockNs | ( | const PClockNs & | other | ) |
Copy constructor of PClockNs.
other | : class to copy |
Definition at line 50 of file PClockNs.cpp.
References copyPClockNs().
|
virtual |
|
protected |
Copy function of PClockNs.
other | : class to copy |
Definition at line 110 of file PClockNs.cpp.
References p_baseSteadyClockNs, p_baseSystemClockSecond, and p_offsetTimeNs.
Referenced by operator=(), and PClockNs().
std::string PClockNs::getDateCompactNs | ( | ) | const |
Get the date at nanosecond precision (even if it is not precise at the nanosecond scale, it is normally coherent at this scale)
Definition at line 103 of file PClockNs.cpp.
References getFullTimeNs(), and phoenix_dateCompactNs().
Referenced by testPClockNs().
std::string PClockNs::getDateNs | ( | ) | const |
Get the date at nanosecond precision (even if it is not precise at the nanosecond scale, it is normally coherent at this scale)
Definition at line 96 of file PClockNs.cpp.
References getFullTimeNs(), and phoenix_dateNs().
Referenced by testPClockNs().
std::time_t PClockNs::getFullTimeNs | ( | ) | const |
Get the full time in nanoseconds.
Definition at line 85 of file PClockNs.cpp.
References p_baseSteadyClockNs, p_baseSystemClockSecond, and p_offsetTimeNs.
Referenced by getDateCompactNs(), getDateNs(), PClockNsBackend::now(), testPClockNs(), and testPClockNsCoherence().
std::time_t PClockNs::getOffsetTimeNs | ( | ) | const |
Get the offset in nanoseconds of the current clock.
Definition at line 78 of file PClockNs.cpp.
References p_offsetTimeNs.
Referenced by testPClockNs().
|
private |
Initialisation function of the class PClockNs.
Definition at line 117 of file PClockNs.cpp.
References p_baseSteadyClockNs, p_baseSystemClockSecond, and p_offsetTimeNs.
Referenced by PClockNs().
Definition of equal operator of PClockNs.
other | : class to copy |
Definition at line 63 of file PClockNs.cpp.
References copyPClockNs().
void PClockNs::setOffsetTimeNs | ( | std::time_t | offsetTimeNs | ) |
Set the offset in nanoseconds of the current clock.
offsetTimeNs | : offset in nanoseconds of the current clock |
Definition at line 71 of file PClockNs.cpp.
References p_offsetTimeNs.
Referenced by testPClockNs().
|
private |
Base clock time with a nanosecond precision but since the starting of the CPU.
Definition at line 44 of file PClockNs.h.
Referenced by copyPClockNs(), getFullTimeNs(), and initialisationPClockNs().
|
private |
Base of the system clock in second.
Definition at line 42 of file PClockNs.h.
Referenced by copyPClockNs(), getFullTimeNs(), and initialisationPClockNs().
|
private |
Offset of time with date and nanoseconds.
Definition at line 46 of file PClockNs.h.
Referenced by copyPClockNs(), getFullTimeNs(), getOffsetTimeNs(), initialisationPClockNs(), and setOffsetTimeNs().