RTI Connext Modern C++ API
Version 5.3.0
|
<<extension>> Represents a point in time More...
#include <Time.hpp>
Public Member Functions | |
Time () | |
Create a default Time object. The constructed Time object will represent 0 seconds and 0 nanoseconds. | |
Time (int32_t sec, uint32_t nanosec=0) | |
Create a Time object. The constructed Time object will represent the given amount of time. | |
Time (const Time &other) | |
Copy-construct a Time object from another Time object. | |
int32_t | sec () const |
Get the number of seconds that are represented by this Time object. | |
void | sec (int32_t s) |
Set the number of seconds that are represented by this Time object. | |
uint32_t | nanosec () const |
Get the number of nanoseconds that are represented by this Time object. | |
void | nanosec (uint32_t ns) |
Set the number of nanoseconds that are represented by this Time object. | |
int | compare (const Time &other) const |
Compare two Time objects. | |
bool | operator> (const Time &other) const |
Check if this Time is greater than another. | |
bool | operator>= (const Time &other) const |
Check if this Time is greater than or equal another. | |
bool | operator== (const Time &other) const |
Check if this Time of Time is equal to another. | |
bool | operator!= (const Time &other) const |
Check if this Time is not equal to another. | |
bool | operator<= (const Time &other) const |
Check if this Time is less than or equal another. | |
bool | operator< (const Time &other) const |
Check if this Time is less than another. | |
Time & | operator+= (const Duration &duration) |
Add a Duration to this Time object. | |
Time & | operator-= (const Duration &duration) |
Subtract a Duration from this Time object. | |
uint64_t | to_millisecs () const |
Convert this Time to milliseconds. | |
uint64_t | to_microsecs () const |
Convert this Time to microseconds. | |
double | to_secs () const |
Convert this Time to seconds. | |
Static Public Member Functions | |
static Time | invalid () |
Get a Time object representing an invalid amount of time. | |
static Time | zero () |
Get a Time object representing zero time. | |
static Time | maximum () |
Get a Time object representing the maximum amount of time. | |
static Time | from_microsecs (uint64_t microseconds) |
Create a Time object from microseconds. | |
static Time | from_millisecs (uint64_t milliseconds) |
Create a Time object from milliseconds. | |
static Time | from_secs (double seconds) |
Create a Time object from seconds. | |
Related Functions | |
(Note that these are not member functions.) | |
Time | operator+ (const Time &time, const Duration &duration) |
Add a Time and a Duration together. | |
Time | operator+ (const Duration &duration, const Time &time) |
Add a Time and a Duration together. | |
Time | operator- (const Time &time, const Duration &duration) |
Subtract a Duration from a Time. | |
Duration | operator- (const Time &time1, const Time &time2) |
Calculate the duration between two times. | |
<<extension>> Represents a point in time
dds::core::Time::Time | ( | ) |
|
explicit |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int32_t dds::core::Time::sec | ( | ) | const |
Get the number of seconds that are represented by this Time object.
void dds::core::Time::sec | ( | int32_t | s | ) |
Set the number of seconds that are represented by this Time object.
s | The number of seconds to set. |
uint32_t dds::core::Time::nanosec | ( | ) | const |
Get the number of nanoseconds that are represented by this Time object.
void dds::core::Time::nanosec | ( | uint32_t | ns | ) |
Set the number of nanoseconds that are represented by this Time object.
ns | The number of nanoseconds to set. |
int dds::core::Time::compare | ( | const Time & | other | ) | const |
bool dds::core::Time::operator> | ( | const Time & | other | ) | const |
bool dds::core::Time::operator>= | ( | const Time & | other | ) | const |
bool dds::core::Time::operator== | ( | const Time & | other | ) | const |
bool dds::core::Time::operator!= | ( | const Time & | other | ) | const |
bool dds::core::Time::operator<= | ( | const Time & | other | ) | const |
bool dds::core::Time::operator< | ( | const Time & | other | ) | const |
uint64_t dds::core::Time::to_millisecs | ( | ) | const |
uint64_t dds::core::Time::to_microsecs | ( | ) | const |
double dds::core::Time::to_secs | ( | ) | const |
Calculate the duration between two times.
time1 | The first ("before") time |
time2 | The second ("after") time |