123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #ifndef _FASTDDS_RTPS_LIVELINESS_DATA_H_
- #define _FASTDDS_RTPS_LIVELINESS_DATA_H_
- #include <fastrtps/qos/QosPolicies.h>
- #include <fastdds/rtps/common/Time_t.h>
- #include <chrono>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- struct LivelinessData
- {
- enum WriterStatus
- {
-
- NOT_ASSERTED = 0,
-
- ALIVE = 1,
-
- NOT_ALIVE = 2
- };
-
- LivelinessData(
- GUID_t guid_in,
- LivelinessQosPolicyKind kind_in,
- Duration_t lease_duration_in)
- : guid(guid_in)
- , kind(kind_in)
- , lease_duration(lease_duration_in)
- , status(WriterStatus::NOT_ASSERTED)
- {}
- LivelinessData()
- : guid()
- , kind(LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS)
- , lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
- , status(WriterStatus::NOT_ASSERTED)
- {}
- ~LivelinessData()
- {}
-
- bool operator==(
- const LivelinessData& other) const
- {
- return ((guid == other.guid) &&
- (kind == other.kind) &&
- (lease_duration == other.lease_duration));
- }
-
- bool operator!=(
- const LivelinessData& other) const
- {
- return (!operator==(other));
- }
-
- GUID_t guid;
-
- LivelinessQosPolicyKind kind;
-
- Duration_t lease_duration;
-
- unsigned int count = 1;
-
- WriterStatus status;
-
- std::chrono::steady_clock::time_point time;
- };
- }
- }
- }
- #endif
|