Safe DDS
eprosima::safedds::execution Namespace Reference

Classes

interface  ISpinnable
 Any entity that implements this interface is able to spin, meaning that this entity needs to do a periodic synchronization action. More...
 
class  BasicExecutor
 Basic executor implementation. More...
 
struct  TimePoint
 TimePoint represents a moment in time with nanoseconds precision. More...
 
class  Timer
 Timer implementation, triggers every TimePeriod. More...
 

Functions

uint32_t frac_to_nano (uint32_t fractions) noexcept
 Conversion from RTPS fractions of second to nanosecond. More...
 
uint32_t nano_to_frac (uint32_t nanosecs) noexcept
 Conversion from nanoseconds to RTPS fractions of second. More...
 
bool operator!= (const TimePoint &first, const TimePoint &second) noexcept
 Operator!= for TimePoint objects. More...
 
bool operator== (const TimePoint &first, const TimePoint &second) noexcept
 Operator== for TimePoint objects. More...
 
bool operator> (const TimePoint &first, const TimePoint &second) noexcept
 Operator> for TimePoint objects. More...
 
bool operator>= (const TimePoint &first, const TimePoint &second) noexcept
 Operator>= for TimePoint objects. More...
 
bool operator< (const TimePoint &first, const TimePoint &second) noexcept
 Operator< for TimePoint objects. More...
 
bool operator<= (const TimePoint &first, const TimePoint &second) noexcept
 Operator<= for TimePoint objects. More...
 
TimePoint operator- (const TimePoint &first, const TimePoint &second) noexcept
 Operator- for TimePoint objects. More...
 
TimePoint operator+ (const TimePoint &first, const TimePoint &second) noexcept
 Operator+ for TimePoint objects. More...
 

Variables

constexpr uint32_t MS_PER_S = 1000UL
 Time conversion constant: milliseconds in seconds. More...
 
constexpr uint32_t US_PER_S = 1000000UL
 Time conversion constant: microseconds in seconds. More...
 
constexpr uint32_t NS_PER_MS = 1000000UL
 Time conversion constant: nanoseconds in milliseconds. More...
 
constexpr uint64_t NS_PER_S = 1000000000ULL
 Time conversion constant: nanoseconds in seconds. More...
 
constexpr uint64_t NS_PER_US = 1000UL
 Time conversion constant: nanoseconds to microseconds. More...
 
constexpr uint64_t US_PER_MS = 1000UL
 Time conversion constant: microseconds in millisecond. More...
 
constexpr uint64_t C_FRACTIONS_PER_SEC = 4294967296ULL
 Nanoseconds to IETF RFC 1305 fractions of second conversion constant. More...
 
constexpr TimePoint TIME_ZERO = {0, 0}
 Reserved TimePoint value for initial timestamp. More...
 
constexpr TimePoint TIME_INVALID = {-1, 0xFFFFFFFFU}
 Reserved TimePoint value for an invalid timestamp. More...
 
constexpr TimePoint TIME_INFINITE = {0x7FFFFFFF, 0xFFFFFFFFU}
 Reserved TimePoint value for infinite time. More...
 
constexpr TimePoint TIME_MAX_REPRESENTABLE = {0x7FFFFFFF, 999999999U}
 Reserved TimePoint value for max representable time. More...
 

Function Documentation

◆ frac_to_nano()

uint32_t eprosima::safedds::execution::frac_to_nano ( uint32_t  fractions)
inlinenoexcept

Conversion from RTPS fractions of second to nanosecond.

Parameters
fractionsFractions of second: second/2^(32).
Returns
nanoseconds.

◆ nano_to_frac()

uint32_t eprosima::safedds::execution::nano_to_frac ( uint32_t  nanosecs)
inlinenoexcept

Conversion from nanoseconds to RTPS fractions of second.

Parameters
nanosecsNanoseconds, valid values shall not reach a complete second.
Returns
nanoseconds.

◆ operator!=()

bool eprosima::safedds::execution::operator!= ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator!= for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
True if both TimePoint are not equal, false otherwise.

◆ operator+()

TimePoint eprosima::safedds::execution::operator+ ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator+ for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
Result of the add

◆ operator-()

TimePoint eprosima::safedds::execution::operator- ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator- for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
Result of the subtraction, or TIME_INVALID if Subtrahend is greater than Minuend.

◆ operator<()

bool eprosima::safedds::execution::operator< ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator< for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
True if the first TimePoint is lower than the second, false otherwise.

◆ operator<=()

bool eprosima::safedds::execution::operator<= ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator<= for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
True if the first TimePoint is lower or equal than the second, false otherwise.

◆ operator==()

bool eprosima::safedds::execution::operator== ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator== for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
True if both TimePoint are equal, false otherwise.

◆ operator>()

bool eprosima::safedds::execution::operator> ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator> for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
True if the first TimePoint is greater than the second, false otherwise.

◆ operator>=()

bool eprosima::safedds::execution::operator>= ( const TimePoint first,
const TimePoint second 
)
noexcept

Operator>= for TimePoint objects.

Parameters
firstfirst TimePoint to operate.
secondsecond TimePoint to operate.
Returns
True if the first TimePoint is greater or equal than the second, false otherwise.

Variable Documentation

◆ C_FRACTIONS_PER_SEC

constexpr uint64_t eprosima::safedds::execution::C_FRACTIONS_PER_SEC = 4294967296ULL
constexpr

Nanoseconds to IETF RFC 1305 fractions of second conversion constant.

◆ MS_PER_S

constexpr uint32_t eprosima::safedds::execution::MS_PER_S = 1000UL
constexpr

Time conversion constant: milliseconds in seconds.

◆ NS_PER_MS

constexpr uint32_t eprosima::safedds::execution::NS_PER_MS = 1000000UL
constexpr

Time conversion constant: nanoseconds in milliseconds.

◆ NS_PER_S

constexpr uint64_t eprosima::safedds::execution::NS_PER_S = 1000000000ULL
constexpr

Time conversion constant: nanoseconds in seconds.

◆ NS_PER_US

constexpr uint64_t eprosima::safedds::execution::NS_PER_US = 1000UL
constexpr

Time conversion constant: nanoseconds to microseconds.

◆ TIME_INFINITE

constexpr TimePoint eprosima::safedds::execution::TIME_INFINITE = {0x7FFFFFFF, 0xFFFFFFFFU}
constexpr

Reserved TimePoint value for infinite time.

◆ TIME_INVALID

constexpr TimePoint eprosima::safedds::execution::TIME_INVALID = {-1, 0xFFFFFFFFU}
constexpr

Reserved TimePoint value for an invalid timestamp.

◆ TIME_MAX_REPRESENTABLE

constexpr TimePoint eprosima::safedds::execution::TIME_MAX_REPRESENTABLE = {0x7FFFFFFF, 999999999U}
constexpr

Reserved TimePoint value for max representable time.

◆ TIME_ZERO

constexpr TimePoint eprosima::safedds::execution::TIME_ZERO = {0, 0}
constexpr

Reserved TimePoint value for initial timestamp.

◆ US_PER_MS

constexpr uint64_t eprosima::safedds::execution::US_PER_MS = 1000UL
constexpr

Time conversion constant: microseconds in millisecond.

◆ US_PER_S

constexpr uint32_t eprosima::safedds::execution::US_PER_S = 1000000UL
constexpr

Time conversion constant: microseconds in seconds.