![]() |
THM1176InstrumentManager
1.0
Qt Object abstraction for Metrolab THM1176
|
Timestamp for a measurement. More...
#include <THM1176Types.h>
Public Member Functions | |
CAbsoluteTimestamp (std::time_t Seconds=0, U64 Nanoseconds=0) | |
Constructor. More... | |
CAbsoluteTimestamp & | operator= (const CAbsoluteTimestamp &Value) |
Assignment operator. More... | |
bool | operator== (CAbsoluteTimestamp other) |
Equality operator. More... | |
bool | operator!= (CAbsoluteTimestamp other) |
Inequality operator. More... | |
std::time_t | seconds (void) const |
Fetch the number of seconds. More... | |
U64 | nanoseconds (void) const |
Fetch the number of nanoseconds. More... | |
void | clear (void) |
Clear to default values (zeroes) More... | |
Static Public Attributes | |
static const U64 | NS_PER_SEC = 1000000000 |
Timestamp for a measurement.
Note: Timestamps are returned from the instrument as the number of nanoseconds since the instrument booted, with a timer resolution of 167 ns. By adding the computer's UNIX Epoch timestamp of when the instrument booted (usually a number of seconds since 1970), we obtain an absolute measurement timestamp, with a resolution of 167 ns. This class represents such an absolute measurement timestamp as a structure, [ UNIX Epoch time, residual in nanoseconds ]. We can represent the instrument's timestamp as Ti = [ 0 s, X ns ], and the computer time as Tc = [ Y s, 0 ns ]. One can then compute the measurement timestamp as (Ti + Tc); the class automatically takes care of carry-overs from ns to s.
Definition at line 529 of file THM1176Types.h.
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::CAbsoluteTimestamp | ( | std::time_t | Seconds = 0 , |
U64 | Nanoseconds = 0 |
||
) |
Constructor.
[in] | Seconds | Number of seconds: UNIX Epoch time, or zero for instrument's nanosecond timestamp. |
[in] | Nanoseconds | Number of nanoseconds; automatically normalized to [ seconds, residual nanoseconds ]. |
Definition at line 341 of file THM1176Types.cpp.
void MTL::Instrument::THM1176Types::CAbsoluteTimestamp::clear | ( | void | ) |
Clear to default values (zeroes)
Definition at line 369 of file THM1176Types.cpp.
U64 MTL::Instrument::THM1176Types::CAbsoluteTimestamp::nanoseconds | ( | void | ) | const |
Fetch the number of nanoseconds.
Definition at line 365 of file THM1176Types.cpp.
bool MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator!= | ( | CAbsoluteTimestamp | other | ) |
Inequality operator.
Definition at line 357 of file THM1176Types.cpp.
CAbsoluteTimestamp & MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator= | ( | const CAbsoluteTimestamp & | Value | ) |
Assignment operator.
Definition at line 347 of file THM1176Types.cpp.
bool MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator== | ( | CAbsoluteTimestamp | other | ) |
Equality operator.
Definition at line 353 of file THM1176Types.cpp.
std::time_t MTL::Instrument::THM1176Types::CAbsoluteTimestamp::seconds | ( | void | ) | const |
Fetch the number of seconds.
Definition at line 361 of file THM1176Types.cpp.
|
static |
Class constant: number of ns per s.
Definition at line 536 of file THM1176Types.h.