| THM1176InstrumentDriver 1.2 C++ API for Metrolab THM1176

Loading...
Searching...
No Matches
MTL::Instrument::THM1176Types::CAbsoluteTimestamp Class Reference

Timestamp for a measurement. More...

`#include <THM1176Types.h>`

## Public Member Functions
| CAbsoluteTimestamp (std::time_t Seconds=0, U64 Nanoseconds=0)
| Constructor.
CAbsoluteTimestamp & | operator= (const CAbsoluteTimestamp &Value)
| Assignment operator.
bool | operator== (CAbsoluteTimestamp other)
| Equality operator.
bool | operator!= (CAbsoluteTimestamp other)
| Inequality operator.
std::time_t | seconds (void) const
| Fetch the number of seconds.
U64 | nanoseconds (void) const
| Fetch the number of nanoseconds.
void | clear (void)
| Clear to default values (zeroes).

## Static Public Attributes
static const U64 | NS_PER_SEC = 1000000000

## Detailed Description

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 550 of file THM1176Types.h.

## Constructor & Destructor Documentation

## ◆ CAbsoluteTimestamp()

MTL::Instrument::THM1176Types::CAbsoluteTimestamp::CAbsoluteTimestamp | ( | std::time_t | Seconds = 0,
|  | U64 | Nanoseconds = 0 )

Constructor.

Parameters

  [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 343 of file THM1176Types.cpp.

## Member Function Documentation

## ◆ clear()

void MTL::Instrument::THM1176Types::CAbsoluteTimestamp::clear | ( | void |  | ) |

Clear to default values (zeroes).

Definition at line 371 of file THM1176Types.cpp.

## ◆ nanoseconds()

U64 MTL::Instrument::THM1176Types::CAbsoluteTimestamp::nanoseconds | ( | void |  | ) | const

Fetch the number of nanoseconds.

Definition at line 367 of file THM1176Types.cpp.

## ◆ operator!=()

bool MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator!= | ( | CAbsoluteTimestamp | other | ) |

Inequality operator.

Definition at line 359 of file THM1176Types.cpp.

## ◆ operator=()

CAbsoluteTimestamp & MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator= | ( | const CAbsoluteTimestamp & | Value | ) |

Assignment operator.

Definition at line 349 of file THM1176Types.cpp.

## ◆ operator==()

bool MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator== | ( | CAbsoluteTimestamp | other | ) |

Equality operator.

Definition at line 355 of file THM1176Types.cpp.

## ◆ seconds()

std::time_t MTL::Instrument::THM1176Types::CAbsoluteTimestamp::seconds | ( | void |  | ) | const

Fetch the number of seconds.

Definition at line 363 of file THM1176Types.cpp.

## Member Data Documentation

## ◆ NS_PER_SEC

const U64 MTL::Instrument::THM1176Types::CAbsoluteTimestamp::NS_PER_SEC = 1000000000
| static

Class constant: number of ns per s.

Definition at line 557 of file THM1176Types.h.

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

- THM1176InstrumentDriver/include/THM1176Types.h
- THM1176InstrumentDriver/src/THM1176Types.cpp