Fast DDS  Version 3.0.1
Fast DDS
Loading...
Searching...
No Matches
Time_t Struct Reference

Structure Time_t, used to describe times at a DDS level. More...

#include <Time_t.hpp>

Public Member Functions

 Time_t ()
 Default constructor. Sets values to zero.
 
 Time_t (int32_t sec, uint32_t nsec)
 
 Time_t (long double sec)
 
void fraction (uint32_t frac)
 
uint32_t fraction () const
 
int64_t to_ns () const
 Returns stored time as nanoseconds (including seconds)
 
bool is_infinite () const noexcept
 

Static Public Member Functions

static void now (Time_t &ret)
 Fills a Time_t struct with a representation of the current time.
 
static constexpr bool is_infinite (const Time_t &t) noexcept
 

Public Attributes

int32_t seconds
 
uint32_t nanosec
 

Static Public Attributes

static constexpr int32_t INFINITE_SECONDS = 0x7fffffff
 
static constexpr uint32_t INFINITE_NANOSECONDS = 0xffffffffu
 

Detailed Description

Structure Time_t, used to describe times at a DDS level.

Constructor & Destructor Documentation

◆ Time_t() [1/3]

Time_t ( )

Default constructor. Sets values to zero.

◆ Time_t() [2/3]

Time_t ( int32_t  sec,
uint32_t  nsec 
)
Parameters
secSeconds
nsecNanoseconds

◆ Time_t() [3/3]

Time_t ( long double  sec)
Parameters
secSeconds. The fractional part is converted to nanoseconds.

Member Function Documentation

◆ fraction() [1/2]

uint32_t fraction ( ) const

◆ fraction() [2/2]

void fraction ( uint32_t  frac)

◆ is_infinite() [1/2]

bool is_infinite ( ) const
inlinenoexcept

◆ is_infinite() [2/2]

static constexpr bool is_infinite ( const Time_t t)
inlinestaticconstexprnoexcept

◆ now()

static void now ( Time_t ret)
static

Fills a Time_t struct with a representation of the current time.

Parameters
retReference to the structure to be filled in.

◆ to_ns()

int64_t to_ns ( ) const

Returns stored time as nanoseconds (including seconds)

Member Data Documentation

◆ INFINITE_NANOSECONDS

constexpr uint32_t INFINITE_NANOSECONDS = 0xffffffffu
staticconstexpr

◆ INFINITE_SECONDS

constexpr int32_t INFINITE_SECONDS = 0x7fffffff
staticconstexpr

◆ nanosec

uint32_t nanosec

◆ seconds

int32_t seconds

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