![]() |
PhoenixClock
0.4.0
Library wrapping the usage of system's clock, allowing to use clock mock-ups
|
Generic clock which can use several backends (real clock backend and a mock of clock) More...
#include <PGenericClock.h>
Public Member Functions | |
PClockMode::PClockMode | getMode () const |
Get the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD) | |
time_t | now () |
Get the current time of the clock. | |
PGenericClock & | operator= (const PGenericClock< _TBackend, _TMockBackend > &other) |
Definition of equal operator of PGenericClock. | |
PGenericClock () | |
Default constructor of PGenericClock. | |
PGenericClock (const PGenericClock< _TBackend, _TMockBackend > &other) | |
Copy constructor of PGenericClock. | |
void | setMode (PClockMode::PClockMode mode) |
Set the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD) | |
virtual | ~PGenericClock () |
Destructor of PGenericClock. | |
Protected Member Functions | |
void | copyPGenericClock (const PGenericClock< _TBackend, _TMockBackend > &other) |
Copy function of PGenericClock. | |
Private Member Functions | |
void | initialisationPGenericClock () |
Initialisation function of the class PGenericClock. | |
Private Attributes | |
_TBackend | p_clockBackend |
Instance of the clock backend (necessary for some clock backends) | |
_TMockBackend | p_mockBackend |
Instance of the clock backend (necessary for some clock backends) | |
PClockMode::PClockMode | p_mode |
Mode of the Clock (no mock, mock, mock_record) | |
Generic clock which can use several backends (real clock backend and a mock of clock)
Definition at line 17 of file PGenericClock.h.
PGenericClock< _TBackend, _TMockBackend >::PGenericClock | ( | ) |
Default constructor of PGenericClock.
Definition at line 16 of file PGenericClock_impl.h.
References initialisationPGenericClock().
Referenced by copyPGenericClock(), operator=(), and PGenericClock().
PGenericClock< _TBackend, _TMockBackend >::PGenericClock | ( | const PGenericClock< _TBackend, _TMockBackend > & | other | ) |
Copy constructor of PGenericClock.
other | : class to copy |
Definition at line 24 of file PGenericClock_impl.h.
References copyPGenericClock(), and PGenericClock().
|
virtual |
|
protected |
Copy function of PGenericClock.
other | : class to copy |
Definition at line 80 of file PGenericClock_impl.h.
References p_mode, and PGenericClock().
Referenced by operator=(), and PGenericClock().
PClockMode::PClockMode PGenericClock< _TBackend, _TMockBackend >::getMode | ( | ) | const |
Get the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD)
Definition at line 56 of file PGenericClock_impl.h.
References p_mode.
|
private |
Initialisation function of the class PGenericClock.
Definition at line 86 of file PGenericClock_impl.h.
References PClockMode::NO_MOCK, and p_mode.
Referenced by PGenericClock().
time_t PGenericClock< _TBackend, _TMockBackend >::now | ( | ) |
Get the current time of the clock.
Definition at line 64 of file PGenericClock_impl.h.
References PClockMode::MOCK, PClockMode::NO_MOCK, p_clockBackend, p_mockBackend, and p_mode.
PGenericClock< _TBackend, _TMockBackend > & PGenericClock< _TBackend, _TMockBackend >::operator= | ( | const PGenericClock< _TBackend, _TMockBackend > & | other | ) |
Definition of equal operator of PGenericClock.
other | : class to copy |
Definition at line 39 of file PGenericClock_impl.h.
References copyPGenericClock(), and PGenericClock().
void PGenericClock< _TBackend, _TMockBackend >::setMode | ( | PClockMode::PClockMode | mode | ) |
Set the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD)
mode | : mode of the PGenericClock |
Definition at line 48 of file PGenericClock_impl.h.
References p_mode.
|
private |
Instance of the clock backend (necessary for some clock backends)
Definition at line 37 of file PGenericClock.h.
Referenced by now().
|
private |
Instance of the clock backend (necessary for some clock backends)
Definition at line 39 of file PGenericClock.h.
Referenced by now().
|
private |
Mode of the Clock (no mock, mock, mock_record)
Definition at line 35 of file PGenericClock.h.
Referenced by copyPGenericClock(), getMode(), initialisationPGenericClock(), now(), and setMode().