7#ifndef __PCLOCKMOCKFILE_H__
8#define __PCLOCKMOCKFILE_H__
35bool phoenix_createClockMock(
const std::string & prefix,
size_t nbTime, time_t firstTime = 0l, time_t timeIncrement = 1l);
43template<
class _TClockMock>
45 time_t currentTime(firstTime);
46 for(
size_t i(0lu); i < nbTime; ++i){
47 mock.setCurrentTime(currentTime);
48 currentTime += timeIncrement;
bool phoenix_createClockMock(const std::string &prefix, size_t nbTime, time_t firstTime=0l, time_t timeIncrement=1l)
Create a clock mock.
bool phoenix_createMockBackend(PClockMockFile &mock, const std::string &prefix="")
Create a mock backend for clock.
void phoenix_fillClockMock(_TClockMock &mock, size_t nbTime, time_t firstTime, time_t timeIncrement)
Fill the given clock mock.
virtual ~PClockMockFile()
Destructor of PClockMockFile.
PClockMockFile()
Default constructor of PClockMockFile.
void setCurrentTime(time_t currentTime)
Set the current time to be recorded.
void close()
Close the PClockMockFile.
PGenericFileMock< time_t > p_mock
Mock handler.
void initialisationPClockMockFile()
Initialisation function of the class PClockMockFile.
void setMockPrefix(const std::string &mockPrefix)
Set the mock directory.
time_t now()
Get the mocked current time.
void sleep(EllapsedTime ellapsedTime) const
Sleep for the given ellapsed time.