From 989b999b753dccd5f2d4a64f3753e8e3f768cf15 Mon Sep 17 00:00:00 2001 From: Iker Luengo Date: Tue, 7 Sep 2021 12:46:25 +0200 Subject: [PATCH] Define operators inside the classes This facilitates the binding to Python Signed-off-by: Iker Luengo --- include/fastdds/dds/topic/TypeSupport.hpp | 1 + include/fastdds/rtps/common/EntityId_t.hpp | 97 ++- include/fastdds/rtps/common/Guid.h | 101 ++- include/fastdds/rtps/common/InstanceHandle.h | 64 +- include/fastdds/rtps/common/Time_t.h | 670 ++++++++----------- 5 files changed, 390 insertions(+), 543 deletions(-) diff --git a/include/fastdds/dds/topic/TypeSupport.hpp b/include/fastdds/dds/topic/TypeSupport.hpp index 7dc8fb9ab9c..2a7de0b21fe 100644 --- a/include/fastdds/dds/topic/TypeSupport.hpp +++ b/include/fastdds/dds/topic/TypeSupport.hpp @@ -20,6 +20,7 @@ #define _FASTDDS_TYPE_SUPPORT_HPP_ #include +#include #include #include diff --git a/include/fastdds/rtps/common/EntityId_t.hpp b/include/fastdds/rtps/common/EntityId_t.hpp index 6fe9e6bdd70..9a628ddd38c 100644 --- a/include/fastdds/rtps/common/EntityId_t.hpp +++ b/include/fastdds/rtps/common/EntityId_t.hpp @@ -177,72 +177,67 @@ struct RTPS_DllAPI EntityId_t return EntityId_t(); } -}; - #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -/** - * Guid prefix comparison operator - * @param id1 EntityId to compare - * @param id2 ID prefix to compare - * @return True if equal - */ -inline bool operator ==( - EntityId_t& id1, - const uint32_t id2) -{ -#if !FASTDDS_IS_BIG_ENDIAN_TARGET - id1.reverse(); -#endif // if !FASTDDS_IS_BIG_ENDIAN_TARGET - const bool result = 0 == memcmp(id1.value, &id2, sizeof(id2)); -#if !FASTDDS_IS_BIG_ENDIAN_TARGET - id1.reverse(); -#endif // if !FASTDDS_IS_BIG_ENDIAN_TARGET - return result; -} + /** + * Guid prefix comparison operator + * @param ID prefix to compare + * @return True if equal + */ + inline bool operator ==( + const uint32_t other) + { + #if !FASTDDS_IS_BIG_ENDIAN_TARGET + reverse(); + #endif // if !FASTDDS_IS_BIG_ENDIAN_TARGET + const bool result = 0 == memcmp(value, &other, sizeof(other)); + #if !FASTDDS_IS_BIG_ENDIAN_TARGET + reverse(); + #endif // if !FASTDDS_IS_BIG_ENDIAN_TARGET + return result; + } -/** - * Guid prefix comparison operator - * @param id1 First EntityId to compare - * @param id2 Second EntityId to compare - * @return True if equal - */ -inline bool operator ==( - const EntityId_t& id1, - const EntityId_t& id2) -{ - for (uint8_t i = 0; i < 4; ++i) + /** + * Guid prefix comparison operator + * @param other Second EntityId to compare + * @return True if equal + */ + inline bool operator ==( + const EntityId_t& other) const { - if (id1.value[i] != id2.value[i]) + for (uint8_t i = 0; i < 4; ++i) { - return false; + if (value[i] != other.value[i]) + { + return false; + } } + return true; } - return true; -} -/** - * Guid prefix comparison operator - * @param id1 First EntityId to compare - * @param id2 Second EntityId to compare - * @return True if not equal - */ -inline bool operator !=( - const EntityId_t& id1, - const EntityId_t& id2) -{ - for (uint8_t i = 0; i < 4; ++i) + /** + * Guid prefix comparison operator + * @param other Second EntityId to compare + * @return True if not equal + */ + inline bool operator !=( + const EntityId_t& other) const { - if (id1.value[i] != id2.value[i]) + for (uint8_t i = 0; i < 4; ++i) { - return true; + if (value[i] != other.value[i]) + { + return true; + } } + return false; } - return false; -} #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +}; + + inline std::ostream& operator <<( std::ostream& output, const EntityId_t& enI) diff --git a/include/fastdds/rtps/common/Guid.h b/include/fastdds/rtps/common/Guid.h index 4fdb35a28e1..dac89b2f226 100644 --- a/include/fastdds/rtps/common/Guid.h +++ b/include/fastdds/rtps/common/Guid.h @@ -122,81 +122,76 @@ struct RTPS_DllAPI GUID_t return *reinterpret_cast(this); } -}; - #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -/** - * GUID comparison operator - * @param g1 First GUID to compare - * @param g2 Second GUID to compare - * @return True if equal - */ -inline bool operator ==( - const GUID_t& g1, - const GUID_t& g2) -{ - if (g1.guidPrefix == g2.guidPrefix && g1.entityId == g2.entityId) - { - return true; - } - else - { - return false; - } -} - -/** - * GUID comparison operator - * @param g1 First GUID to compare - * @param g2 Second GUID to compare - * @return True if not equal - */ -inline bool operator !=( - const GUID_t& g1, - const GUID_t& g2) -{ - if (g1.guidPrefix != g2.guidPrefix || g1.entityId != g2.entityId) - { - return true; - } - else + /** + * GUID comparison operator + * @param other Second GUID to compare + * @return True if equal + */ + inline bool operator ==( + const GUID_t& other) const { - return false; + if (guidPrefix == other.guidPrefix && entityId == other.entityId) + { + return true; + } + else + { + return false; + } } -} -inline bool operator <( - const GUID_t& g1, - const GUID_t& g2) -{ - for (uint8_t i = 0; i < 12; ++i) + /** + * GUID comparison operator + * @param other Second GUID to compare + * @return True if not equal + */ + inline bool operator !=( + const GUID_t& other) const { - if (g1.guidPrefix.value[i] < g2.guidPrefix.value[i]) + if (guidPrefix != other.guidPrefix || entityId != other.entityId) { return true; } - else if (g1.guidPrefix.value[i] > g2.guidPrefix.value[i]) + else { return false; } } - for (uint8_t i = 0; i < 4; ++i) + + inline bool operator <( + const GUID_t& other) const { - if (g1.entityId.value[i] < g2.entityId.value[i]) + for (uint8_t i = 0; i < 12; ++i) { - return true; + if (guidPrefix.value[i] < other.guidPrefix.value[i]) + { + return true; + } + else if (guidPrefix.value[i] > other.guidPrefix.value[i]) + { + return false; + } } - else if (g1.entityId.value[i] > g2.entityId.value[i]) + for (uint8_t i = 0; i < 4; ++i) { - return false; + if (entityId.value[i] < other.entityId.value[i]) + { + return true; + } + else if (entityId.value[i] > other.entityId.value[i]) + { + return false; + } } + return false; } - return false; -} #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +}; + const GUID_t c_Guid_Unknown; #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC diff --git a/include/fastdds/rtps/common/InstanceHandle.h b/include/fastdds/rtps/common/InstanceHandle.h index 37fa6a34cb4..52e35219756 100644 --- a/include/fastdds/rtps/common/InstanceHandle.h +++ b/include/fastdds/rtps/common/InstanceHandle.h @@ -126,41 +126,50 @@ struct RTPS_DllAPI InstanceHandle_t return *reinterpret_cast(this); } -}; - -const InstanceHandle_t c_InstanceHandle_Unknown; + /** + * Strictly less than operator + * @param other The other InstanceHandle_t to compare + * @return True if the value of this handle lexicographically preceeds that of \p other + */ + inline bool operator <( + const InstanceHandle_t& other) const + { + return memcmp(value, other.value, 16) < 0; + } #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -/** - * Comparison operator - * @param ihandle1 First InstanceHandle_t to compare - * @param ihandle2 Second InstanceHandle_t to compare - * @return True if equal - */ -inline bool operator ==( - const InstanceHandle_t& ihandle1, - const InstanceHandle_t& ihandle2) -{ - for (uint8_t i = 0; i < 16; ++i) + /** + * Comparison operator + * @param other Second InstanceHandle_t to compare + * @return True if equal + */ + inline bool operator ==( + const InstanceHandle_t& other) const { - if (ihandle1.value[i] != ihandle2.value[i]) + for (uint8_t i = 0; i < 16; ++i) { - return false; + if (value[i] != other.value[i]) + { + return false; + } } + return true; } - return true; -} -inline bool operator !=( - const InstanceHandle_t& ihandle1, - const InstanceHandle_t& ihandle2) -{ - return !(ihandle1 == ihandle2); -} + inline bool operator !=( + const InstanceHandle_t& other) const + { + return !(*this == other); + } #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +}; + +const InstanceHandle_t c_InstanceHandle_Unknown; + + /** * Convert InstanceHandle_t to GUID * @param guid GUID to store the results @@ -207,13 +216,6 @@ inline GUID_t iHandle2GUID( return guid; } -inline bool operator <( - const InstanceHandle_t& h1, - const InstanceHandle_t& h2) -{ - return memcmp(h1.value, h2.value, 16) < 0; -} - #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC /** diff --git a/include/fastdds/rtps/common/Time_t.h b/include/fastdds/rtps/common/Time_t.h index 6620c7c009b..4c3b20573e6 100644 --- a/include/fastdds/rtps/common/Time_t.h +++ b/include/fastdds/rtps/common/Time_t.h @@ -73,10 +73,159 @@ struct RTPS_DllAPI Time_t */ static void now( Time_t& ret); + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + + /** + * Comparison assignment + * @param other Second Time_t to compare + * @return True if equal + */ + inline bool operator ==( + const Time_t& other) const + { + if (seconds != other.seconds) + { + return false; + } + if (nanosec != other.nanosec) + { + return false; + } + return true; + } + + /** + * Comparison assignment + * @param other Second Time_t to compare + * @return True if not equal + */ + inline bool operator !=( + const Time_t& other) const + { + return !(*this == other); + } + + /** + * Checks if a Time_t is less than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is less than the second + */ + inline bool operator <( + const Time_t& other) const + { + if (seconds < other.seconds) + { + return true; + } + else if (seconds > other.seconds) + { + return false; + } + else + { + if (nanosec < other.nanosec) + { + return true; + } + else + { + return false; + } + } + } + + /** + * Checks if a Time_t is greater than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is greater than the second + */ + inline bool operator >( + const Time_t& other) const + { + return other < *this; + } + + /** + * Checks if a Time_t is less or equal than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is less or equal than the second + */ + inline bool operator <=( + const Time_t& other) const + { + return !(*this > other); + } + + /** + * Checks if a Time_t is greater or equal than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is greater or equal than the second + */ + inline bool operator >=( + const Time_t& other) const + { + return !(*this < other); + } + + /** + * Adds two Time_t. + * @param other Second Time_t to add + * @return A new Time_t with the result. + */ + inline Time_t operator +( + const Time_t& other) const + { + Time_t result(seconds + other.seconds, nanosec + other.nanosec); + if (result.nanosec < nanosec) // Overflow is detected by any of them + { + ++result.seconds; + } + return result; + } + + /** + * Subtracts two Time_t. + * @param other Second Time_t to subtract + * @return A new Time_t with the result. + */ + inline Time_t operator -( + const Time_t& other) const + { + Time_t result(seconds - other.seconds, nanosec - other.nanosec); + if (result.nanosec > nanosec) // Overflow is detected by ta + { + --result.seconds; + } + return result; + } + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + }; using Duration_t = Time_t; +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +inline std::ostream& operator <<( + std::ostream& output, + const Time_t& t) +{ + long double t_aux = t.seconds + (((long double)t.nanosec) / 1000000000ULL); + return output << t_aux; +} + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +//! Time_t (Duration_t) representing an infinite time. DONT USE IT IN CONSTRUCTORS +const Time_t c_TimeInfinite{TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS}; +//! Time_t (Duration_t) representing a zero time. DONT USE IT IN CONSTRUCTORS +const Time_t c_TimeZero{0, 0}; +//! Time_t (Duration_t) representing an invalid time. DONT USE IT IN CONSTRUCTORS +const Time_t c_TimeInvalid{-1, TIME_T_INFINITE_NANOSECONDS}; + namespace rtps { /** @@ -172,191 +321,153 @@ class RTPS_DllAPI Time_t static void now( Time_t& ret); -private: - - //!Seconds - int32_t seconds_ = 0; - - //!Fraction of second (1 fraction = 1/(2^32) seconds) - uint32_t fraction_ = 0; - - //!Nanoseconds - uint32_t nanosec_ = 0; - - void set_fraction( - uint32_t frac); - - void set_nanosec( - uint32_t nanos); -}; - #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -/** - * Comparison assignment - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if equal - */ -static inline bool operator ==( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds() != t2.seconds()) - { - return false; - } - if (t1.fraction() != t2.fraction()) - { - return false; - } - return true; -} - -/** - * Comparison assignment - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if not equal - */ -static inline bool operator !=( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds() != t2.seconds()) - { - return true; - } - if (t1.fraction() != t2.fraction()) - { - return true; - } - return false; -} - -/** - * Checks if a Time_t is less than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is less than the second - */ -static inline bool operator <( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds() < t2.seconds()) - { - return true; - } - else if (t1.seconds() > t2.seconds()) - { - return false; - } - else + /** + * Comparison assignment + * @param other Second Time_t to compare + * @return True if equal + */ + inline bool operator ==( + const Time_t& other) const { - if (t1.fraction() < t2.fraction()) + if (seconds() != other.seconds()) { - return true; + return false; } - else + if (fraction() != other.fraction()) { return false; } - } -} - -/** - * Checks if a Time_t is greater than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is greater than the second - */ -static inline bool operator >( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds() > t2.seconds()) - { return true; } - else if (t1.seconds() < t2.seconds()) + + /** + * Comparison assignment + * @param other Second Time_t to compare + * @return True if not equal + */ + inline bool operator !=( + const Time_t& other) const { - return false; + return !(*this == other); } - else + + /** + * Checks if a Time_t is less than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is less than the second + */ + inline bool operator <( + const Time_t& other) const { - if (t1.fraction() > t2.fraction()) + if (seconds() < other.seconds()) { return true; } - else + else if (seconds() > other.seconds()) { return false; } - } -} - -/** - * Checks if a Time_t is less or equal than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is less or equal than the second - */ -static inline bool operator <=( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds() < t2.seconds()) - { - return true; - } - else if (t1.seconds() > t2.seconds()) - { - return false; - } - else - { - if (t1.fraction() <= t2.fraction()) - { - return true; - } else { - return false; + if (fraction() < other.fraction()) + { + return true; + } + else + { + return false; + } } } -} -/** - * Checks if a Time_t is greater or equal than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is greater or equal than the second - */ -static inline bool operator >=( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds() > t2.seconds()) + /** + * Checks if a Time_t is greater than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is greater than the second + */ + inline bool operator >( + const Time_t& other) const { - return true; + return other < *this; + } + + /** + * Checks if a Time_t is less or equal than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is less or equal than the second + */ + inline bool operator <=( + const Time_t& other) const + { + return !(*this > other); } - else if (t1.seconds() < t2.seconds()) + + /** + * Checks if a Time_t is greater or equal than other. + * @param other Second Time_t to compare + * @return True if the first Time_t is greater or equal than the second + */ + inline bool operator >=( + const Time_t& other) const { - return false; + return !(*this < other); } - else + + /** + * Adds two Time_t. + * @param other Second Time_t to add + * @return A new Time_t with the result. + */ + inline Time_t operator +( + const Time_t& other) const { - if (t1.fraction() >= t2.fraction()) + Time_t result(seconds() + other.seconds(), fraction() + other.fraction()); + if (result.fraction() < fraction()) // Overflow is detected by any of them { - return true; + ++result.seconds(); } - else + return result; + } + + /** + * Subtracts two Time_t. + * @param other Second Time_t to subtract + * @return A new Time_t with the result. + */ + inline Time_t operator -( + const Time_t& other) const + { + Time_t result(seconds() - other.seconds(), fraction() - other.fraction()); + if (result.fraction() > fraction()) // Overflow is detected by ta { - return false; + --result.seconds(); } + return result; } -} + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +private: + + //!Seconds + int32_t seconds_ = 0; + + //!Fraction of second (1 fraction = 1/(2^32) seconds) + uint32_t fraction_ = 0; + + //!Nanoseconds + uint32_t nanosec_ = 0; + + void set_fraction( + uint32_t frac); + + void set_nanosec( + uint32_t nanos); +}; + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC inline std::ostream& operator <<( std::ostream& output, @@ -403,42 +514,6 @@ inline std::istream& operator >>( return input; } -/** - * Adds two Time_t. - * @param ta First Time_t to add - * @param tb Second Time_t to add - * @return A new Time_t with the result. - */ -static inline Time_t operator +( - const Time_t& ta, - const Time_t& tb) -{ - Time_t result(ta.seconds() + tb.seconds(), ta.fraction() + tb.fraction()); - if (result.fraction() < ta.fraction()) // Overflow is detected by any of them - { - ++result.seconds(); - } - return result; -} - -/** - * Subtracts two Time_t. - * @param ta First Time_t to subtract - * @param tb Second Time_t to subtract - * @return A new Time_t with the result. - */ -static inline Time_t operator -( - const Time_t& ta, - const Time_t& tb) -{ - Time_t result(ta.seconds() - tb.seconds(), ta.fraction() - tb.fraction()); - if (result.fraction() > ta.fraction()) // Overflow is detected by ta - { - --result.seconds(); - } - return result; -} - #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC const Time_t c_RTPSTimeInfinite{0x7fffffff, 0xffffffff}; @@ -447,227 +522,6 @@ const Time_t c_RTPSTimeInvalid{-1, 0xffffffff}; } // namespace rtps -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -/** - * Comparison assignment - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if equal - */ -static inline bool operator ==( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds != t2.seconds) - { - return false; - } - if (t1.nanosec != t2.nanosec) - { - return false; - } - return true; -} - -/** - * Comparison assignment - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if not equal - */ -static inline bool operator !=( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds != t2.seconds) - { - return true; - } - if (t1.nanosec != t2.nanosec) - { - return true; - } - return false; -} - -/** - * Checks if a Time_t is less than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is less than the second - */ -static inline bool operator <( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds < t2.seconds) - { - return true; - } - else if (t1.seconds > t2.seconds) - { - return false; - } - else - { - if (t1.nanosec < t2.nanosec) - { - return true; - } - else - { - return false; - } - } -} - -/** - * Checks if a Time_t is greater than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is greater than the second - */ -static inline bool operator >( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds > t2.seconds) - { - return true; - } - else if (t1.seconds < t2.seconds) - { - return false; - } - else - { - if (t1.nanosec > t2.nanosec) - { - return true; - } - else - { - return false; - } - } -} - -/** - * Checks if a Time_t is less or equal than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is less or equal than the second - */ -static inline bool operator <=( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds < t2.seconds) - { - return true; - } - else if (t1.seconds > t2.seconds) - { - return false; - } - else - { - if (t1.nanosec <= t2.nanosec) - { - return true; - } - else - { - return false; - } - } -} - -/** - * Checks if a Time_t is greater or equal than other. - * @param t1 First Time_t to compare - * @param t2 Second Time_t to compare - * @return True if the first Time_t is greater or equal than the second - */ -static inline bool operator >=( - const Time_t& t1, - const Time_t& t2) -{ - if (t1.seconds > t2.seconds) - { - return true; - } - else if (t1.seconds < t2.seconds) - { - return false; - } - else - { - if (t1.nanosec >= t2.nanosec) - { - return true; - } - else - { - return false; - } - } -} - -inline std::ostream& operator <<( - std::ostream& output, - const Time_t& t) -{ - long double t_aux = t.seconds + (((long double)t.nanosec) / 1000000000ULL); - return output << t_aux; -} - -/** - * Adds two Time_t. - * @param ta First Time_t to add - * @param tb Second Time_t to add - * @return A new Time_t with the result. - */ -static inline Time_t operator +( - const Time_t& ta, - const Time_t& tb) -{ - Time_t result(ta.seconds + tb.seconds, ta.nanosec + tb.nanosec); - if (result.nanosec < ta.nanosec) // Overflow is detected by any of them - { - ++result.seconds; - } - return result; -} - -/** - * Subtracts two Time_t. - * @param ta First Time_t to subtract - * @param tb Second Time_t to subtract - * @return A new Time_t with the result. - */ -static inline Time_t operator -( - const Time_t& ta, - const Time_t& tb) -{ - Time_t result(ta.seconds - tb.seconds, ta.nanosec - tb.nanosec); - if (result.nanosec > ta.nanosec) // Overflow is detected by ta - { - --result.seconds; - } - return result; -} - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -//! Time_t (Duration_t) representing an infinite time. DONT USE IT IN CONSTRUCTORS -const Time_t c_TimeInfinite{TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS}; -//! Time_t (Duration_t) representing a zero time. DONT USE IT IN CONSTRUCTORS -const Time_t c_TimeZero{0, 0}; -//! Time_t (Duration_t) representing an invalid time. DONT USE IT IN CONSTRUCTORS -const Time_t c_TimeInvalid{-1, TIME_T_INFINITE_NANOSECONDS}; - } // namespace fastrtps } // namespace eprosima