<<extension>> Represents a point in time
More...
#include <Time.hpp>
<<extension>> Represents a point in time
◆ Time() [1/2]
dds::core::Time::Time 
( 
 ) 

Create a default Time object. The constructed Time object will represent 0 seconds and 0 nanoseconds.
◆ Time() [2/2]
dds::core::Time::Time 
( 
int64_t 
sec, 


uint32_t 
nanosec = 0 

) 
 

explicit 
Create a Time object. The constructed Time object will represent the given amount of time.
◆ invalid()
static Time dds::core::Time::invalid 
( 
 ) 


static 
Get a Time object representing an invalid amount of time.
 Returns
 const Time A Time object representing an invalid amount of time.
◆ zero()
static Time dds::core::Time::zero 
( 
 ) 


static 
Get a Time object representing zero time.
 Returns
 const Time A Time object representing zero time.
◆ maximum()
static Time dds::core::Time::maximum 
( 
 ) 


static 
Get a Time object representing the maximum amount of time.
 Returns
 const Time A Time object representing the maximum amount of time.
◆ from_microsecs()
static Time dds::core::Time::from_microsecs 
( 
uint64_t 
microseconds  ) 


static 
Create a Time object from microseconds.
 Parameters

microseconds  How many microseconds this Time represent 
 Returns
 Time A new instance of Time representing the given microseconds
◆ from_millisecs()
static Time dds::core::Time::from_millisecs 
( 
uint64_t 
milliseconds  ) 


static 
Create a Time object from milliseconds.
 Parameters

milliseconds  How many milliseconds this Time should represent 
 Returns
 Time A new instance of Time representing the given milliseconds
◆ from_secs()
static Time dds::core::Time::from_secs 
( 
double 
seconds  ) 


static 
Create a Time object from seconds.
 Parameters

seconds  How many seconds this Time should represent 
 Returns
 Time A new instance of Time representing the given seconds
◆ sec() [1/2]
int64_t dds::core::Time::sec 
( 
 ) 
const 
Get the number of seconds that are represented by this Time object.
 Returns
 int64_t The number of seconds
◆ sec() [2/2]
void dds::core::Time::sec 
( 
int64_t 
s  ) 

Set the number of seconds that are represented by this Time object.
 Parameters

s  The number of seconds to set. 
◆ nanosec() [1/2]
uint32_t dds::core::Time::nanosec 
( 
 ) 
const 
Get the number of nanoseconds that are represented by this Time object.
 Returns
 uint32_t The number of nanoseconds
◆ nanosec() [2/2]
void dds::core::Time::nanosec 
( 
uint32_t 
ns  ) 

Set the number of nanoseconds that are represented by this Time object.
 Parameters

ns  The number of nanoseconds to set. 
◆ compare()
int dds::core::Time::compare 
( 
const Time & 
other  ) 
const 
Compare two Time objects.
 Parameters

other  The Time object to compare with this Time. 
 Returns
 int The result of the comparison can be: 1 if this Time is less than other; 0 if they are equal; 1 if this Time is greater than other
◆ operator>()
bool dds::core::Time::operator> 
( 
const Time & 
other  ) 
const 
Check if this Time is greater than another.
 Parameters

other  The Time object to compare with this Time. 
 Returns
 bool false if this Time is less than or equal to the other object, true otherwise.
◆ operator>=()
bool dds::core::Time::operator>= 
( 
const Time & 
other  ) 
const 
Check if this Time is greater than or equal another.
 Parameters

other  The Time object to compare with this Time. 
 Returns
 bool false if this Time is less than to the other object, true otherwise.
◆ operator==()
bool dds::core::Time::operator== 
( 
const Time & 
other  ) 
const 
Check if this Time of Time is equal to another.
 Parameters

other  The Time object to compare with this Time. 
 Returns
 bool false if this Time is not equal to the other object, true otherwise.
◆ operator!=()
bool dds::core::Time::operator!= 
( 
const Time & 
other  ) 
const 
Check if this Time is not equal to another.
 Parameters

other  The Time object to compare with this Time. 
 Returns
 bool false if this Time is equal to the other object, true otherwise.
◆ operator<=()
bool dds::core::Time::operator<= 
( 
const Time & 
other  ) 
const 
Check if this Time is less than or equal another.
 Parameters

other  The Time object to compare with this Time. 
 Returns
 bool false if this Time is greater than to the other object, true otherwise.
◆ operator<()
bool dds::core::Time::operator< 
( 
const Time & 
other  ) 
const 
Check if this Time is less than another.
 Parameters

other  The Time object to compare with this Time. 
 Returns
 bool false if this Time is greater than or equal to the other object, true otherwise.
◆ operator+=()
Time & dds::core::Time::operator+= 
( 
const Duration & 
duration  ) 

◆ operator=()
Time & dds::core::Time::operator= 
( 
const Duration & 
duration  ) 

◆ to_millisecs()
uint64_t dds::core::Time::to_millisecs 
( 
 ) 
const 
Convert this Time to milliseconds.
 Returns
 uint64_t The number of milliseconds represented by this Time object.
 Exceptions

std::overflow_error  if the time in milliseconds exceeds the value that can be stored in an uint64_t 
◆ to_microsecs()
uint64_t dds::core::Time::to_microsecs 
( 
 ) 
const 
Convert this Time to microseconds.
 Returns
 uint64_t The number of microseconds represented by this Time object.
 Exceptions

std::overflow_error  if the time in microseconds exceeds the value that can be stored in an uint64_t 
◆ to_nanosecs()
uint64_t dds::core::Time::to_nanosecs 
( 
 ) 
const 
Convert this Time to nanoseconds.
 Returns
 uint64_t The number of nanoseconds represented by this Time object.
 Exceptions

std::overflow_error  if the time in nanoseconds exceeds the value that can be stored in an uint64_t 
◆ to_secs()
double dds::core::Time::to_secs 
( 
 ) 
const 
Convert this Time to seconds.
 Returns
 double The number of seconds represented by this Time object.
◆ operator+() [1/2]
Add a Time and a Duration together.
 Parameters

time  The Time object to add 
duration  The Duration object to add 
 Returns
 Time The result of the addition represented as a Time object
◆ operator+() [2/2]
Add a Time and a Duration together.
 Parameters

duration  The Duration object to add 
time  The Time object to add 
 Returns
 Time The result of the addition represented as a Time object
◆ operator() [1/2]
Subtract a Duration from a Time.
 Parameters

time  The Time object to subtract from 
duration  The Duration object to subtract 
 Returns
 Time The result of the subtraction represented as a Time object
◆ operator() [2/2]
Calculate the duration between two times.
 Parameters

time1  The first ("before") time 
time2  The second ("after") time 
 Exceptions

std::overflow_error  if duration exceeds the infinite limit 
 Returns
 The duration elapsed between time1 and time2. If time1 > time2 the duration is zero. If time1 is Time::maximum(), the duration is Duration::infinite();