Fast DDS  Version 3.1.2
Fast DDS
Loading...
Searching...
No Matches

Structure Time_t, used to describe times at RTPS protocol. More...

#include <Time_t.hpp>

Public Member Functions

 Time_t ()=default
 Default constructor. Sets values to zero.
 
 Time_t (int32_t sec, uint32_t frac)
 
 Time_t (long double sec)
 
 Time_t (const eprosima::fastdds::dds::Time_t &time)
 
int64_t to_ns () const
 Returns stored time as nanoseconds (including seconds)
 
void from_ns (int64_t nanosecs)
 
int32_t seconds () const
 Retrieve the seconds field.
 
int32_t & seconds ()
 Retrieve the seconds field by ref.
 
void seconds (int32_t sec)
 Sets seconds field.
 
uint32_t nanosec () const
 Retrieve the nanosec field.
 
void nanosec (uint32_t nanos)
 Sets nanoseconds field and updates the fraction.
 
uint32_t fraction () const
 Retrieve the fraction field.
 
uint32_t & fraction ()
 Retrieve the fraction field by ref.
 
void fraction (uint32_t frac)
 Sets fraction field and updates the nanoseconds.
 
eprosima::fastdds::dds::Duration_t to_duration_t () const
 
void from_duration_t (const eprosima::fastdds::dds::Duration_t &duration)
 

Static Public Member Functions

static void now (Time_t &ret)
 Fills a Time_t struct with a representation of the current time.
 

Detailed Description

Structure Time_t, used to describe times at RTPS protocol.

Constructor & Destructor Documentation

◆ Time_t() [1/4]

Time_t ( )
default

Default constructor. Sets values to zero.

◆ Time_t() [2/4]

Time_t ( int32_t sec,
uint32_t frac )
Parameters
secSeconds
fracFraction of second

◆ Time_t() [3/4]

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

◆ Time_t() [4/4]

Member Function Documentation

◆ fraction() [1/3]

uint32_t & fraction ( )

Retrieve the fraction field by ref.

◆ fraction() [2/3]

uint32_t fraction ( ) const

Retrieve the fraction field.

◆ fraction() [3/3]

void fraction ( uint32_t frac)

Sets fraction field and updates the nanoseconds.

◆ from_duration_t()

void from_duration_t ( const eprosima::fastdds::dds::Duration_t & duration)

◆ from_ns()

void from_ns ( int64_t nanosecs)
Parameters
nanosecsStores given time as nanoseconds (including seconds)

◆ nanosec() [1/2]

uint32_t nanosec ( ) const

Retrieve the nanosec field.

◆ nanosec() [2/2]

void nanosec ( uint32_t nanos)

Sets nanoseconds field and updates the fraction.

◆ 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.

◆ seconds() [1/3]

int32_t & seconds ( )

Retrieve the seconds field by ref.

◆ seconds() [2/3]

int32_t seconds ( ) const

Retrieve the seconds field.

◆ seconds() [3/3]

void seconds ( int32_t sec)

Sets seconds field.

◆ to_duration_t()

eprosima::fastdds::dds::Duration_t to_duration_t ( ) const

◆ to_ns()

int64_t to_ns ( ) const

Returns stored time as nanoseconds (including seconds)


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