PhoenixClock
2.6.0
Library wrapping the usage of system's clock, allowing to use clock mock-ups
Toggle main menu visibility
Loading...
Searching...
No Matches
PGenericClock.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__
8
#define __PGENERICCLOCK_H__
9
10
#include "
PClockMode.h
"
11
#include "
PClockBackend.h
"
12
#include "
PClockMock.h
"
13
15
template
<
typename
_TBackend,
typename
_TMockBackend>
16
class
PGenericClock
{
17
public
:
18
PGenericClock
();
19
virtual
~PGenericClock
();
20
21
void
setMode
(
PClockMode::PClockMode
mode);
22
PClockMode::PClockMode
getMode
()
const
;
23
24
time_t
now
();
25
void
sleep
(
EllapsedTime
ellapsedTime)
const
;
26
void
setMockPrefix
(
const
std::string & mockPrefix);
27
void
resetMockIndex
();
28
29
protected
:
30
void
copyPGenericClock
(
const
PGenericClock<_TBackend, _TMockBackend>
& other);
31
private
:
32
PGenericClock
(
const
PGenericClock<_TBackend, _TMockBackend>
& other);
33
PGenericClock
&
operator =
(
const
PGenericClock<_TBackend, _TMockBackend>
& other);
34
void
initialisationPGenericClock
();
35
37
PClockMode::PClockMode
p_mode
;
39
_TBackend
p_clockBackend
;
41
_TMockBackend
p_mockBackend
;
42
};
43
44
#include "
PGenericClock_impl.h
"
45
46
47
#endif
48
PClockBackend.h
PClockMock.h
PClockMode.h
PGenericClock_impl.h
PGenericClock::copyPGenericClock
void copyPGenericClock(const PGenericClock< _TBackend, _TMockBackend > &other)
Copy function of PGenericClock.
Definition
PGenericClock_impl.h:108
PGenericClock::PGenericClock
PGenericClock()
Default constructor of PGenericClock.
Definition
PGenericClock_impl.h:16
PGenericClock::getMode
PClockMode::PClockMode getMode() const
Get the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD).
Definition
PGenericClock_impl.h:56
PGenericClock::resetMockIndex
void resetMockIndex()
Reset the mock clock to initial state.
Definition
PGenericClock_impl.h:98
PGenericClock::setMode
void setMode(PClockMode::PClockMode mode)
Set the mode of the PGenericClock (NO_MOCK, MOCK or MOCK_RECORD).
Definition
PGenericClock_impl.h:48
PGenericClock::~PGenericClock
virtual ~PGenericClock()
Destructor of PGenericClock.
Definition
PGenericClock_impl.h:30
PGenericClock::operator=
PGenericClock & operator=(const PGenericClock< _TBackend, _TMockBackend > &other)
Definition of equal operator of PGenericClock.
Definition
PGenericClock_impl.h:39
PGenericClock::setMockPrefix
void setMockPrefix(const std::string &mockPrefix)
Set the mock prefix to load and save the mock with a custom file.
Definition
PGenericClock_impl.h:92
PGenericClock::now
time_t now()
Get the current time of the clock.
Definition
PGenericClock_impl.h:64
PGenericClock::initialisationPGenericClock
void initialisationPGenericClock()
Initialisation function of the class PGenericClock.
Definition
PGenericClock_impl.h:114
PGenericClock::p_clockBackend
_TBackend p_clockBackend
Instance of the clock backend (necessary for some clock backends).
Definition
PGenericClock.h:39
PGenericClock::p_mockBackend
_TMockBackend p_mockBackend
Instance of the clock backend (necessary for some clock backends).
Definition
PGenericClock.h:41
PGenericClock::p_mode
PClockMode::PClockMode p_mode
Mode of the Clock (no mock, mock, mock_record).
Definition
PGenericClock.h:37
PGenericClock::sleep
void sleep(EllapsedTime ellapsedTime) const
Sleep for a given ellapsed time.
Definition
PGenericClock_impl.h:80
EllapsedTime
time_t EllapsedTime
Definition
ellapsedTime.h:12
PClockMode::PClockMode
PClockMode
describe the mode of the Socket
Definition
PClockMode.h:12
src
PGenericClock.h
Generated by
1.17.0