proxygen
proxygen::MockTimeUtilGeneric< ClockType > Class Template Reference

#include <MockTime.h>

Inheritance diagram for proxygen::MockTimeUtilGeneric< ClockType >:
proxygen::TimeUtilGeneric< ClockType >

Public Member Functions

void advance (std::chrono::milliseconds ms)
 
void setCurrentTime (std::chrono::time_point< ClockType > t)
 
void verifyAndClear ()
 
std::chrono::time_point< ClockType > now () const override
 
- Public Member Functions inherited from proxygen::TimeUtilGeneric< ClockType >
virtual ~TimeUtilGeneric ()
 
virtual uint64_t msSinceEpoch ()
 

Private Attributes

std::chrono::time_point< ClockType > t_
 

Additional Inherited Members

- Static Public Member Functions inherited from proxygen::TimeUtilGeneric< ClockType >
static const std::chrono::time_point< ClockType > & getZeroTimePoint ()
 

Detailed Description

template<typename ClockType = std::chrono::steady_clock>
class proxygen::MockTimeUtilGeneric< ClockType >

Definition at line 18 of file MockTime.h.

Member Function Documentation

template<typename ClockType = std::chrono::steady_clock>
void proxygen::MockTimeUtilGeneric< ClockType >::advance ( std::chrono::milliseconds  ms)
inline

Definition at line 21 of file MockTime.h.

References proxygen::MockTimeUtilGeneric< ClockType >::t_.

21  {
22  t_ += ms;
23  }
std::chrono::time_point< ClockType > t_
Definition: MockTime.h:39
template<typename ClockType = std::chrono::steady_clock>
std::chrono::time_point<ClockType> proxygen::MockTimeUtilGeneric< ClockType >::now ( ) const
inlineoverridevirtual

Reimplemented from proxygen::TimeUtilGeneric< ClockType >.

Definition at line 34 of file MockTime.h.

References proxygen::MockTimeUtilGeneric< ClockType >::t_.

34  {
35  return t_;
36  }
std::chrono::time_point< ClockType > t_
Definition: MockTime.h:39
template<typename ClockType = std::chrono::steady_clock>
void proxygen::MockTimeUtilGeneric< ClockType >::setCurrentTime ( std::chrono::time_point< ClockType >  t)
inline

Definition at line 25 of file MockTime.h.

References folly::pushmi::detail::t, and proxygen::MockTimeUtilGeneric< ClockType >::t_.

25  {
26  CHECK(t.time_since_epoch() > t_.time_since_epoch())
27  << "Time can not move backwards";
28  t_ = t;
29  }
std::chrono::time_point< ClockType > t_
Definition: MockTime.h:39
template<typename ClockType = std::chrono::steady_clock>
void proxygen::MockTimeUtilGeneric< ClockType >::verifyAndClear ( )
inline

Definition at line 31 of file MockTime.h.

31  {
32  }

Member Data Documentation

template<typename ClockType = std::chrono::steady_clock>
std::chrono::time_point<ClockType> proxygen::MockTimeUtilGeneric< ClockType >::t_
private

The documentation for this class was generated from the following file: