McStas Readout Master 0.3.3
Loading...
Searching...
No Matches
efu_time Class Reference

ESS EFU two-integer timestamp: whole seconds since the UNIX epoch plus ticks of the 88.052499 MHz readout clock within the second. More...

#include <efu_time.h>

Public Member Functions

 efu_time (const uint32_t high, const uint32_t low)
 A time equivalent to that used in the ESS Event-Formation-Unit.
 
 efu_time (const std::pair< uint32_t, uint32_t > &p)
 
 efu_time (const double time)
 Conversion from floating point time representation.
 
 efu_time ()
 Use the system clock to construct an EFU consistent time stamp.
 
uint32_t high () const
 
uint32_t low () const
 
bool operator== (const efu_time &other) const
 
bool operator< (const efu_time &other) const
 
bool operator> (const efu_time &other) const
 
bool operator>= (const efu_time &other) const
 
bool operator>= (const efu_time *other) const
 
efu_time operator+ (const efu_time &other) const
 
efu_time operator+ (const efu_time *other) const
 
efu_time operator- (const efu_time &other) const
 
efu_time operator- (const efu_time *other) const
 
uint64_t total_ticks () const
 
uint64_t total_nanoseconds () const
 
uint32_t operator/ (const efu_time &other) const
 
efu_time operator* (const uint32_t m) const
 
efu_time operator% (const efu_time &m) const
 
efu_time operator% (const efu_time *m) const
 

Static Public Attributes

static constexpr uint64_t ticks = 88052499
 

Protected Attributes

uint32_t _h
 
uint32_t _l
 

Friends

std::ostream & operator<< (std::ostream &os, const efu_time &dt)
 
std::ostream & operator<< (std::ostream &os, const efu_time *dt)
 

Detailed Description

ESS EFU two-integer timestamp: whole seconds since the UNIX epoch plus ticks of the 88.052499 MHz readout clock within the second.

Arithmetic keeps the tick field normalized (always less than one second's worth of ticks), matching how the EFU interprets the high/low pair.

Definition at line 19 of file efu_time.h.

Constructor & Destructor Documentation

◆ efu_time() [1/4]

efu_time::efu_time ( const uint32_t  high,
const uint32_t  low 
)
inline

A time equivalent to that used in the ESS Event-Formation-Unit.

Parameters
highseconds since the UNIX epoch, 1970-01-01 00:00
lownumber of clock ticks in a 88.052499 MHz oscillator

Definition at line 31 of file efu_time.h.

◆ efu_time() [2/4]

efu_time::efu_time ( const std::pair< uint32_t, uint32_t > &  p)
inlineexplicit

Definition at line 38 of file efu_time.h.

◆ efu_time() [3/4]

efu_time::efu_time ( const double  time)
inlineexplicit

Conversion from floating point time representation.

Parameters
timeseconds since the UNIX epoch

Definition at line 44 of file efu_time.h.

◆ efu_time() [4/4]

efu_time::efu_time ( )
inline

Use the system clock to construct an EFU consistent time stamp.

Definition at line 50 of file efu_time.h.

Member Function Documentation

◆ high()

uint32_t efu_time::high ( ) const
inline

Definition at line 60 of file efu_time.h.

◆ low()

uint32_t efu_time::low ( ) const
inline

Definition at line 61 of file efu_time.h.

◆ operator%() [1/2]

efu_time efu_time::operator% ( const efu_time m) const
inline

Definition at line 133 of file efu_time.h.

◆ operator%() [2/2]

efu_time efu_time::operator% ( const efu_time m) const
inline

Definition at line 137 of file efu_time.h.

◆ operator*()

efu_time efu_time::operator* ( const uint32_t  m) const
inline

Definition at line 123 of file efu_time.h.

◆ operator+() [1/2]

efu_time efu_time::operator+ ( const efu_time other) const
inline

Definition at line 85 of file efu_time.h.

◆ operator+() [2/2]

efu_time efu_time::operator+ ( const efu_time other) const
inline

Definition at line 91 of file efu_time.h.

◆ operator-() [1/2]

efu_time efu_time::operator- ( const efu_time other) const
inline

Definition at line 95 of file efu_time.h.

◆ operator-() [2/2]

efu_time efu_time::operator- ( const efu_time other) const
inline

Definition at line 106 of file efu_time.h.

◆ operator/()

uint32_t efu_time::operator/ ( const efu_time other) const
inline

Definition at line 119 of file efu_time.h.

◆ operator<()

bool efu_time::operator< ( const efu_time other) const
inline

Definition at line 66 of file efu_time.h.

◆ operator==()

bool efu_time::operator== ( const efu_time other) const
inline

Definition at line 63 of file efu_time.h.

◆ operator>()

bool efu_time::operator> ( const efu_time other) const
inline

Definition at line 71 of file efu_time.h.

◆ operator>=() [1/2]

bool efu_time::operator>= ( const efu_time other) const
inline

Definition at line 77 of file efu_time.h.

◆ operator>=() [2/2]

bool efu_time::operator>= ( const efu_time other) const
inline

Definition at line 81 of file efu_time.h.

◆ total_nanoseconds()

uint64_t efu_time::total_nanoseconds ( ) const
inline

Definition at line 114 of file efu_time.h.

◆ total_ticks()

uint64_t efu_time::total_ticks ( ) const
inline

Definition at line 110 of file efu_time.h.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  os,
const efu_time dt 
)
friend

Definition at line 141 of file efu_time.h.

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  os,
const efu_time dt 
)
friend

Definition at line 145 of file efu_time.h.

Member Data Documentation

◆ _h

uint32_t efu_time::_h
protected

Definition at line 21 of file efu_time.h.

◆ _l

uint32_t efu_time::_l
protected

Definition at line 22 of file efu_time.h.

◆ ticks

constexpr uint64_t efu_time::ticks = 88052499
staticconstexpr

Definition at line 24 of file efu_time.h.


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