Classes | Typedefs | Functions
evgen::details Namespace Reference

Classes

struct  Average
 
class  TimeInUnits
 
class  TimeInUnitsBase
 Class reading a Clock and converting the value to a specific Unit. More...
 

Typedefs

using ns_clock_t = details::TimeInUnits< std::chrono::high_resolution_clock, std::chrono::nanoseconds >
 

Functions

template<typename T >
auto discretize (T value, T period)
 Returns the multiple of period closest to value. More...
 

Typedef Documentation

using evgen::details::ns_clock_t = typedef details::TimeInUnits <std::chrono::high_resolution_clock, std::chrono::nanoseconds>

Definition at line 287 of file GeneratedEventTimestamp_plugin.cc.

Function Documentation

template<typename T >
auto evgen::details::discretize ( value,
period 
)

Returns the multiple of period closest to value.

Definition at line 100 of file GeneratedEventTimestamp_plugin.cc.

100  {
101  auto const excess = value % period;
102  auto const base = value - excess;
103  return (excess < (period / T(2)))? base: base + period;
104  } // discretize()
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225