22 #ifndef NDN_TIME_UNIT_TEST_CLOCK_HPP
23 #define NDN_TIME_UNIT_TEST_CLOCK_HPP
36 template<
class BaseClock>
43 return nanoseconds::zero();
60 return seconds(1415684132);
72 template<
class BaseClock>
83 advance(
const nanoseconds& duration);
89 setNow(
const nanoseconds& timeSinceEpoch);
95 typename BaseClock::time_point
98 boost::posix_time::time_duration
99 toPosixDuration(
const typename BaseClock::duration& duration)
const override;
102 nanoseconds m_currentTime;
111 #endif // NDN_TIME_UNIT_TEST_CLOCK_HPP
std::string getSince() const override
Copyright (c) 2013-2016 Regents of the University of California.
void advance(const nanoseconds &duration)
Advance unit test clock by duration.
UnitTestClock< system_clock > UnitTestSystemClock
Class implementing custom system or steady clock behavior.
Clock that can be used in unit tests for time-dependent tests independent of wall clock...
UnitTestClock(const nanoseconds &startTime=UnitTestClockTraits< BaseClock >::getDefaultStartTime())
void setNow(const nanoseconds &timeSinceEpoch)
Explicitly set clock to timeSinceEpoch.
UnitTestClock< steady_clock > UnitTestSteadyClock
BaseClock::time_point getNow() const override
static nanoseconds getDefaultStartTime()
static nanoseconds getDefaultStartTime()
boost::posix_time::time_duration toPosixDuration(const typename BaseClock::duration &duration) const override
Traits for UnitTestClock, defining default behavior for different clocks.