LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
evgen::details::TimeInUnits< Clock, Duration, typename > Class Template Reference
Inheritance diagram for evgen::details::TimeInUnits< Clock, Duration, typename >:
evgen::details::TimeInUnitsBase< Clock, Duration >

Classes

class  type
 

Public Types

using duration_t = art::TimeValue_t
 Type of the time duration as returned by this class. More...
 

Public Member Functions

duration_t operator() ()
 Reads and returns the current time the clock. More...
 

Static Public Member Functions

static duration_t read_clock ()
 Reads and returns the current time the clock. More...
 
static duration_t currentOffsetFromEpoch ()
 

Static Protected Member Functions

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 >

Class reading a clock and converting the value to a specific unit; if the unit is more precise than the clock, random padding fills the gap

Definition at line 248 of file GeneratedEventTimestamp_plugin.cc.

Member Typedef Documentation

using evgen::details::TimeInUnitsBase< Clock, Duration >::duration_t = art::TimeValue_t
inherited

Type of the time duration as returned by this class.

Definition at line 114 of file GeneratedEventTimestamp_plugin.cc.

Member Function Documentation

static duration_t evgen::details::TimeInUnitsBase< Clock, Duration >::currentOffsetFromEpoch ( )
staticinherited

Computes an approximation of the offset of the current time from the epoch.

duration_t evgen::details::TimeInUnitsBase< Clock, Duration >::operator() ( )
inlineinherited

Reads and returns the current time the clock.

Definition at line 117 of file GeneratedEventTimestamp_plugin.cc.

117 { return read_clock(); }
static duration_t read_clock()
Reads and returns the current time the clock.
static constexpr auto evgen::details::TimeInUnitsBase< Clock, Duration >::periodToDuration ( )
inlinestaticprotectedinherited

Returns the duration (duration_t) of a period type.

Definition at line 138 of file GeneratedEventTimestamp_plugin.cc.

139  { return toDuration(std::chrono::duration<Rep, Period>(1)); }
static constexpr duration_t toDuration(TimeInterval dt)
Converts a std::chrono::duration into our duration metric.
static duration_t evgen::details::TimeInUnitsBase< Clock, Duration >::read_clock ( )
inlinestaticinherited

Reads and returns the current time the clock.

Definition at line 120 of file GeneratedEventTimestamp_plugin.cc.

120 { return timeFromEpoch(Clock::now()); }
static duration_t timeFromEpoch(TimePoint t)
Returns the time elapsed from the epoch to t.
static duration_t evgen::details::TimeInUnitsBase< Clock, Duration >::timeFromEpoch ( TimePoint  t)
inlinestaticprotectedinherited

Returns the time elapsed from the epoch to t.

Definition at line 143 of file GeneratedEventTimestamp_plugin.cc.

144  { return toDuration(t.time_since_epoch()); }
static constexpr duration_t toDuration(TimeInterval dt)
Converts a std::chrono::duration into our duration metric.
static constexpr duration_t evgen::details::TimeInUnitsBase< Clock, Duration >::toDuration ( TimeInterval  dt)
inlinestaticprotectedinherited

Converts a std::chrono::duration into our duration metric.

Definition at line 130 of file GeneratedEventTimestamp_plugin.cc.

131  {
132  return static_cast<duration_t>
133  (std::chrono::duration_cast<Unit>(dt).count());
134  }
art::TimeValue_t duration_t
Type of the time duration as returned by this class.

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