|
RTI Connext Modern C++ API
Version 6.0.0
|
<<value-type>> Represents a time interval More...
#include <Duration.hpp>
Public Member Functions | |
| Duration () | |
| Create a Duration elapsing zero seconds. | |
| Duration (int32_t sec, uint32_t nanosec=0) | |
| Create a duration elapsing a specific amount of time. | |
| template<typename Rep , typename Period > | |
| Duration (const std::chrono::duration< Rep, Period > &duration) | |
| <<C++11>> <<extension>> Allow implicit creation from std::chrono::duration | |
| int32_t | sec () const |
| Get the number of seconds represented by this Duration object. | |
| void | sec (int32_t s) |
| Set the number of seconds represented by this Duration object. | |
| uint32_t | nanosec () const |
| Get the number of nanoseconds represented by this Duration object. | |
| void | nanosec (uint32_t ns) |
| Set the number of nanoseconds represented by this Duration object. | |
| int | compare (const Duration &that) const |
| Compare two Duration objects. | |
| bool | operator> (const Duration &that) const |
| Check if this Duration is greater than another. | |
| bool | operator>= (const Duration &that) const |
| Check if this Duration is greater than or equal another. | |
| bool | operator== (const Duration &that) const |
| Check if this Duration is equal to another. | |
| bool | operator!= (const Duration &other) const |
| Check if this Duration is not equal to another. | |
| bool | operator<= (const Duration &that) const |
| Check if this Duration is less than or equal another. | |
| bool | operator< (const Duration &that) const |
| Check if this Duration is less than another. | |
| Duration & | operator+= (const Duration &a_ti) |
| Add a Duration to this Duration. | |
| Duration & | operator-= (const Duration &a_ti) |
| Subtract a Duration from this Duration. | |
| Duration | operator+ (const Duration &other) const |
| Add two Duration objects. | |
| Duration | operator- (const Duration &other) const |
| Subtract a Duration. | |
| uint64_t | to_millisecs () const |
| Returns this Duration in milliseconds. | |
| uint64_t | to_microsecs () const |
Returns this Duration in microseconds. | |
| double | to_secs () const |
Returns this Duration in seconds. | |
| std::chrono::nanoseconds | to_chrono () const |
| <<C++11>> <<extension>> Converts to std::chrono::nanoseconds | |
Static Public Member Functions | |
| static Duration | zero () |
| Returns a zero duration. | |
| static Duration | infinite () |
| Special value that represents an infinite Duration. | |
| static Duration | automatic () |
| Special value that indicates that RTI Connext will automatically assign a value. | |
| static Duration | from_microsecs (uint64_t microseconds) |
| Create a Duration elapsing a specific number of microseconds. | |
| static Duration | from_millisecs (uint64_t milliseconds) |
| Create a Duration elapsing a specific number of milliseconds. | |
| static Duration | from_secs (double seconds) |
| Create a Duration elapsing a specific number of seconds. | |
Related Functions | |
(Note that these are not member functions.) | |
| Duration | operator* (uint32_t lhs, const Duration &rhs) |
| Multiply a Duration object by an unsigned integer. | |
| Duration | operator* (const Duration &lhs, uint32_t rhs) |
| Multiply a Duration object by an unsigned integer. | |
| Duration | operator/ (const Duration &lhs, uint32_t rhs) |
| Divide a Duration object by an unsigned integer. | |
| void | swap (Duration &lhs, Duration &rhs) OMG_NOEXCEPT |
| Swap the contents of two Duration objects. | |
<<value-type>> Represents a time interval
| dds::core::Duration::Duration | ( | ) |
Create a Duration elapsing zero seconds.
|
explicit |
Create a duration elapsing a specific amount of time.
| sec | The number of seconds to represent |
| nanosec | The number of nanoseconds to represent |
|
inline |
<<C++11>> <<extension>> Allow implicit creation from std::chrono::duration
For example:
|
static |
Returns a zero duration.
|
static |
Special value that represents an infinite Duration.
|
static |
Special value that indicates that RTI Connext will automatically assign a value.
|
static |
|
static |
|
static |
| int32_t dds::core::Duration::sec | ( | ) | const |
Get the number of seconds represented by this Duration object.
| void dds::core::Duration::sec | ( | int32_t | s | ) |
Set the number of seconds represented by this Duration object.
| s | The number of seconds to set |
| uint32_t dds::core::Duration::nanosec | ( | ) | const |
Get the number of nanoseconds represented by this Duration object.
| void dds::core::Duration::nanosec | ( | uint32_t | ns | ) |
Set the number of nanoseconds represented by this Duration object.
| ns | The number of nanoseconds to set |
| int dds::core::Duration::compare | ( | 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 & | other | ) | const |
| bool dds::core::Duration::operator<= | ( | const Duration & | that | ) | const |
| bool dds::core::Duration::operator< | ( | const Duration & | that | ) | const |
| uint64_t dds::core::Duration::to_millisecs | ( | ) | const |
| uint64_t dds::core::Duration::to_microsecs | ( | ) | const |
| double dds::core::Duration::to_secs | ( | ) | const |
|
inline |
<<C++11>> <<extension>> Converts to std::chrono::nanoseconds