Class Time_t

Class Documentation

class Time_t

Structure Time_t, used to describe times at RTPS protocol.

Public Functions

Time_t() = default

Default constructor. Sets values to zero.

Time_t(int32_t sec, uint32_t frac)
Parameters
  • sec – Seconds

  • frac – Fraction of second

Time_t(long double sec)
Parameters

sec – Seconds. The fractional part is converted to nanoseconds.

Time_t(const eprosima::fastrtps::Time_t &time)
Parameters

timefastrtps::Time_t, aka. Duration_t.

int64_t to_ns() const

Returns stored time as nanoseconds (including seconds)

void from_ns(int64_t nanosecs)
Parameters

nanosecs – Stores given time as nanoseconds (including seconds)

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.

void fraction(uint32_t frac)

Sets fraction field and updates the nanoseconds.

Duration_t to_duration_t() const
void from_duration_t(const Duration_t &duration)

Public Static Functions

static void now(Time_t &ret)

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

Parameters

ret – Reference to the structure to be filled in.