PhoenixClock  0.4.0
Library wrapping the usage of system's clock, allowing to use clock mock-ups
Loading...
Searching...
No Matches
PGenericClock_impl.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 __PGENERICCLOCK_H_IMPL__
8#define __PGENERICCLOCK_H_IMPL__
9
10
11
12#include "PGenericClock.h"
13
15template<typename _TBackend, typename _TMockBackend>
19
21
23template<typename _TBackend, typename _TMockBackend>
27
29template<typename _TBackend, typename _TMockBackend>
33
35
38template<typename _TBackend, typename _TMockBackend>
43
45
47template<typename _TBackend, typename _TMockBackend>
51
53
55template<typename _TBackend, typename _TMockBackend>
59
61
63template<typename _TBackend, typename _TMockBackend>
66 return p_clockBackend.now();
67 }else if(p_mode == PClockMode::MOCK){
68 return p_mockBackend.now();
69 }else{
70 time_t currentTime = p_clockBackend.now();
71 p_mockBackend.setCurrentTime(currentTime);
72 return currentTime;
73 }
74}
75
77
79template<typename _TBackend, typename _TMockBackend>
83
85template<typename _TBackend, typename _TMockBackend>
89
90
91
92
93
94#endif
95
96
97
void copyPGenericClock(const PGenericClock< _TBackend, _TMockBackend > &other)
Copy function of PGenericClock.
PGenericClock()
Default constructor of PGenericClock.
PClockMode::PClockMode getMode() const
Get the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD)
void setMode(PClockMode::PClockMode mode)
Set the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD)
virtual ~PGenericClock()
Destructor of PGenericClock.
PGenericClock & operator=(const PGenericClock< _TBackend, _TMockBackend > &other)
Definition of equal operator of PGenericClock.
time_t now()
Get the current time of the clock.
void initialisationPGenericClock()
Initialisation function of the class PGenericClock.
_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)
PClockMode
describe the mode of the Socket
Definition PClockMode.h:12