Public Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
evgen::details::TimeInUnits< Clock, Duration, typename >::type Class Reference
Inheritance diagram for evgen::details::TimeInUnits< Clock, Duration, typename >::type:
evgen::details::TimeInUnitsBase< Clock, Duration >

Public Member Functions

 TimeInUnits ()
 
duration_t operator() ()
 Return the clock value with random padding added. More...
 
- Public Member Functions inherited from evgen::details::TimeInUnitsBase< Clock, Duration >
duration_t operator() ()
 Reads and returns the current time the clock. More...
 

Private Types

using Base_t = TimeInUnitsBase< Clock, Duration >
 
using ClockPeriod = typename Clock::period
 
using ReqPeriod = typename Duration::period
 
using PeriodRatio = std::ratio< ClockPeriod::num *ReqPeriod::den, ReqPeriod::num *ClockPeriod::den >
 
using duration_t = art::TimeValue_t
 Type of the time duration as returned by this class. More...
 

Private Attributes

std::default_random_engine engine
 
std::uniform_int_distribution< duration_tflat
 

Static Private Attributes

static constexpr intmax_t paddingfactor = PeriodRatio::num / PeriodRatio::den
 

Additional Inherited Members

- Public Types inherited from evgen::details::TimeInUnitsBase< Clock, Duration >
using duration_t = art::TimeValue_t
 Type of the time duration as returned by this class. More...
 
- Static Public Member Functions inherited from evgen::details::TimeInUnitsBase< Clock, Duration >
static duration_t read_clock ()
 Reads and returns the current time the clock. More...
 
static duration_t currentOffsetFromEpoch ()
 
- Static Protected Member Functions inherited from evgen::details::TimeInUnitsBase< Clock, Duration >
static constexpr duration_t toDuration (TimeInterval dt)
 Converts a std::chrono::duration into our duration metric. More...
 
static constexpr auto periodToDuration ()
 Returns the duration (duration_t) of a period type. More...
 
static duration_t timeFromEpoch (TimePoint t)
 Returns the time elapsed from the epoch to t. More...
 

Detailed Description

template<typename Clock, typename Duration, typename = void>
class evgen::details::TimeInUnits< Clock, Duration, typename >::type

Definition at line 253 of file GeneratedEventTimestamp_plugin.cc.

Member Typedef Documentation

template<typename Clock , typename Duration , typename = void>
using evgen::details::TimeInUnits< Clock, Duration, typename >::type::Base_t = TimeInUnitsBase<Clock, Duration>
private

Definition at line 259 of file GeneratedEventTimestamp_plugin.cc.

template<typename Clock , typename Duration , typename = void>
using evgen::details::TimeInUnits< Clock, Duration, typename >::type::ClockPeriod = typename Clock::period
private

Definition at line 264 of file GeneratedEventTimestamp_plugin.cc.

template<typename Clock , typename Duration , typename = void>
using evgen::details::TimeInUnitsBase< Clock, Unit >::duration_t = art::TimeValue_t
private

Type of the time duration as returned by this class.

Definition at line 114 of file GeneratedEventTimestamp_plugin.cc.

template<typename Clock , typename Duration , typename = void>
using evgen::details::TimeInUnits< Clock, Duration, typename >::type::PeriodRatio = std::ratio< ClockPeriod::num * ReqPeriod::den, ReqPeriod::num * ClockPeriod::den >
private

Definition at line 269 of file GeneratedEventTimestamp_plugin.cc.

template<typename Clock , typename Duration , typename = void>
using evgen::details::TimeInUnits< Clock, Duration, typename >::type::ReqPeriod = typename Duration::period
private

Definition at line 265 of file GeneratedEventTimestamp_plugin.cc.

Member Function Documentation

template<typename Clock , typename Duration , typename = void>
duration_t evgen::details::TimeInUnits< Clock, Duration, typename >::type::operator() ( void  )
inline

Return the clock value with random padding added.

Definition at line 277 of file GeneratedEventTimestamp_plugin.cc.

278  { return Base_t::read_clock() + flat(engine); }
static duration_t read_clock()
Reads and returns the current time the clock.
std::uniform_int_distribution< duration_t > flat
template<typename Clock , typename Duration , typename = void>
evgen::details::TimeInUnits< Clock, Duration, typename >::type::TimeInUnits ( )
inline

Definition at line 274 of file GeneratedEventTimestamp_plugin.cc.

274 : engine(), flat(0, paddingfactor - 1) {}
std::uniform_int_distribution< duration_t > flat

Member Data Documentation

template<typename Clock , typename Duration , typename = void>
std::default_random_engine evgen::details::TimeInUnits< Clock, Duration, typename >::type::engine
private

Definition at line 281 of file GeneratedEventTimestamp_plugin.cc.

template<typename Clock , typename Duration , typename = void>
std::uniform_int_distribution<duration_t> evgen::details::TimeInUnits< Clock, Duration, typename >::type::flat
private

Definition at line 282 of file GeneratedEventTimestamp_plugin.cc.

template<typename Clock , typename Duration , typename = void>
constexpr intmax_t evgen::details::TimeInUnits< Clock, Duration, typename >::type::paddingfactor = PeriodRatio::num / PeriodRatio::den
staticprivate

Definition at line 271 of file GeneratedEventTimestamp_plugin.cc.


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