19#ifndef FASTDDS_DDS_CORE__TIME_T_HPP
20#define FASTDDS_DDS_CORE__TIME_T_HPP
22#include <fastdds/fastdds_dll.hpp>
37 static constexpr int32_t INFINITE_SECONDS = 0x7fffffff;
38 static constexpr uint32_t INFINITE_NANOSECONDS = 0xffffffffu;
72 return is_infinite(*
this);
86 return (INFINITE_SECONDS == t.seconds) || (INFINITE_NANOSECONDS == t.nanosec);
93#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
262 std::ostream& output,
265 long double t_aux = t.
seconds + (((
long double)t.
nanosec) / 1000000000ULL);
266 return output << t_aux;
Definition DomainParticipant.hpp:45
const Time_t c_TimeZero
Time_t (dds::Duration_t) representing a zero time. DONT USE IT IN CONSTRUCTORS.
Definition Time_t.hpp:310
const Time_t c_TimeInvalid
Time_t (dds::Duration_t) representing an invalid time. DONT USE IT IN CONSTRUCTORS.
Definition Time_t.hpp:312
static bool operator<=(const Time_t &t1, const Time_t &t2)
Checks if a Time_t is less or equal than other.
Definition Time_t.hpp:205
const Time_t c_TimeInfinite
Time_t (dds::Duration_t) representing an infinite time. DONT USE IT IN CONSTRUCTORS.
Definition Time_t.hpp:308
std::ostream & operator<<(std::ostream &output, const Time_t &t)
Definition Time_t.hpp:261
static bool operator!=(const Time_t &t1, const Time_t &t2)
Comparison assignment.
Definition Time_t.hpp:122
static Time_t operator+(const Time_t &ta, const Time_t &tb)
Adds two Time_t.
Definition Time_t.hpp:275
static Time_t operator-(const Time_t &ta, const Time_t &tb)
Subtracts two Time_t.
Definition Time_t.hpp:293
static bool operator==(const Time_t &t1, const Time_t &t2)
Comparison assignment.
Definition Time_t.hpp:101
static bool operator>=(const Time_t &t1, const Time_t &t2)
Checks if a Time_t is greater or equal than other.
Definition Time_t.hpp:236
static bool operator>(const Time_t &t1, const Time_t &t2)
Checks if a Time_t is greater than other.
Definition Time_t.hpp:174
static bool operator<(const Time_t &t1, const Time_t &t2)
Checks if a Time_t is less than other.
Definition Time_t.hpp:143
Structure Time_t, used to describe times at a DDS level.
Definition Time_t.hpp:36
int32_t seconds
Definition Time_t.hpp:40
void fraction(uint32_t frac)
bool is_infinite() const noexcept
Definition Time_t.hpp:70
static constexpr int32_t INFINITE_SECONDS
Definition Time_t.hpp:37
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
Definition Time_t.hpp:83
uint32_t fraction() const
Time_t()
Default constructor. Sets values to zero.
static constexpr uint32_t INFINITE_NANOSECONDS
Definition Time_t.hpp:38
uint32_t nanosec
Definition Time_t.hpp:41
int64_t to_ns() const
Returns stored time as nanoseconds (including seconds)
Time_t(int32_t sec, uint32_t nsec)