CoreDX DDS Modern C++ API
|
Duration represents a time interval and can -. More...
Public Member Functions | |
Duration () | |
Create a Duration elapsing the default amount of time (zero seconds). | |
Duration (int32_t sec, uint32_t nanosec=0) | |
Create a Duration elapsing a specific amount of time. More... | |
int64_t | sec () const |
Get seconds part of the Duration. More... | |
void | sec (int64_t s) |
Set number of seconds. More... | |
uint32_t | nanosec () const |
Get nanoseconds part of the Duration. More... | |
void | nanosec (uint32_t ns) |
Set number of nanoseconds. More... | |
int | compare (const Duration &that) const |
Returns an integer value for a comparison of two Durations: 1 if this Duration is greater than the comparator (that) -1 if the Duration is less than the comparator (that) 0 if the Duration matches the comparator (that) More... | |
bool | operator> (const Duration &that) const |
Returns true if the Duration is greater than the comparator. More... | |
bool | operator>= (const Duration &that) const |
Returns true if the Duration is greater than or equal to the comparator. More... | |
bool | operator!= (const Duration &that) const |
Returns true if the Duration is not equal to the comparator. More... | |
bool | operator== (const Duration &that) const |
Returns true if the Duration is equal to the comparator. More... | |
bool | operator<= (const Duration &that) const |
Returns true if the Duration is less than or equal to the comparator. More... | |
bool | operator< (const Duration &that) const |
Returns true if the Duration is less than the comparator. More... | |
Duration & | operator+= (const Duration &a_ti) |
Add a Duration to this Duration. More... | |
Duration & | operator-= (const Duration &a_ti) |
Subtract a Duration from this Duration. More... | |
Duration & | operator*= (uint64_t factor) |
Multiply this Duration by a factor. More... | |
const Duration | operator+ (const Duration &other) const |
Add a Duration to Duration. More... | |
const Duration | operator- (const Duration &other) const |
Subtract a Duration from Duration. More... | |
int64_t | to_millisecs () const |
Returns this Duration in milliseconds. More... | |
int64_t | to_microsecs () const |
Returns this Duration in micro-seconds. More... | |
double | to_secs () const |
Returns this Duration in seconds. More... | |
Static Public Member Functions | |
static const Duration | zero () |
Create a Duration elapsing zero seconds. | |
static const Duration | infinite () |
Create an infinite Duration. | |
static const Duration | from_microsecs (int64_t microseconds) |
Create a Duration from a number of microseconds. More... | |
static const Duration | from_millisecs (int64_t milliseconds) |
Create a Duration from a number of milliseconds. More... | |
static const Duration | from_secs (double seconds) |
Create a Duration from a number of seconds. More... | |
Duration represents a time interval and can -.
|
explicit |
int dds::core::Duration::compare | ( | const Duration & | that | ) | const |
|
static |
Create a Duration from a number of microseconds.
microseconds | number of microseconds |
|
static |
Create a Duration from a number of milliseconds.
milliseconds | number of milliseconds |
|
static |
Create a Duration from a number of seconds.
seconds | number of seconds |
uint32_t dds::core::Duration::nanosec | ( | ) | const |
Get nanoseconds part of the Duration.
void dds::core::Duration::nanosec | ( | uint32_t | ns | ) |
Set number of nanoseconds.
ns | number of nanoseconds |
bool dds::core::Duration::operator!= | ( | const Duration & | that | ) | const |
Duration& dds::core::Duration::operator*= | ( | uint64_t | factor | ) |
bool dds::core::Duration::operator< | ( | const Duration & | that | ) | const |
bool dds::core::Duration::operator<= | ( | const Duration & | that | ) | const |
bool dds::core::Duration::operator== | ( | const Duration & | that | ) | const |
bool dds::core::Duration::operator> | ( | const Duration & | that | ) | const |
bool dds::core::Duration::operator>= | ( | const Duration & | that | ) | const |
int64_t dds::core::Duration::sec | ( | ) | const |
Get seconds part of the Duration.
void dds::core::Duration::sec | ( | int64_t | s | ) |
Set number of seconds.
s | number of seconds |
int64_t dds::core::Duration::to_microsecs | ( | ) | const |
Returns this Duration in micro-seconds.
int64_t dds::core::Duration::to_millisecs | ( | ) | const |
Returns this Duration in milliseconds.
double dds::core::Duration::to_secs | ( | ) | const |
Returns this Duration in seconds.