120[[nodiscard]] [[maybe_unused]]
static constexpr bool is_for_writer(
Type type)
noexcept {
130[[nodiscard]] [[maybe_unused]]
static constexpr bool is_for_reader(
Type type)
noexcept {
188 template <
typename T>
189 [[nodiscard]] std::shared_ptr<T>
as()
const;
258 static_assert(std::is_base_of_v<Base, T> && !std::is_same_v<struct Unknown, T>,
259 "Can not convert target status type.");
263 return std::dynamic_pointer_cast<T>(
const_cast<Base*
>(
this)->shared_from_this());
Indicates a general runtime failure.
Definition exception.h:86
VLink-specific exception types wrapping the C++ standard exception hierarchy.
Platform-independent macro definitions for the VLink library.
#define VUNLIKELY(...)
Shorthand alias for VLINK_UNLIKELY. Hints that the expression is unlikely true.
Definition macros.h:302
#define VLINK_EXPORT
Definition macros.h:85
DDS-compatible status type enumeration, base class, and type-safe cast utilities.
const void * InstanceHandle
Opaque handle type for DDS instance identifiers.
Definition status.h:141
Type
Discriminator for concrete status event types.
Definition status.h:97
@ kLivelinessLost
Writer liveliness assertion failed.
Definition status.h:103
@ kOfferedDeadlineMissed
Writer missed its offered deadline.
Definition status.h:101
@ kRequestedDeadlineMissed
Reader did not receive data within its deadline.
Definition status.h:106
@ kSubscriptionMatched
A matching publisher appeared or was removed.
Definition status.h:105
@ kSampleRejected
Incoming sample was rejected (resource limit).
Definition status.h:108
@ kUnknown
Unknown or uninitialised status.
Definition status.h:98
@ kOfferedIncompatibleQos
Subscriber with incompatible QoS discovered.
Definition status.h:102
@ kRequestedIncompatibleQos
Publisher with incompatible QoS discovered.
Definition status.h:109
@ kSampleLost
Sample was lost before delivery.
Definition status.h:110
@ kLivelinessChanged
Publisher liveliness state changed.
Definition status.h:107
@ kPublicationMatched
A matching subscriber appeared or was removed.
Definition status.h:100
VLINK_EXPORT std::ostream & operator<<(std::ostream &ostream, const BasePtr &status) noexcept
Writes the human-readable description of status to ostream.
std::shared_ptr< Status::Base > BasePtr
Type alias for a shared pointer to a base status event.
Definition status.h:241
VLINK_EXPORT friend std::ostream & operator<<(std::ostream &ostream, const Base &status) noexcept
Writes the human-readable status description to ostream.
std::shared_ptr< T > as() const
Safely downcasts this status to a concrete type T.
Definition status.h:257
virtual std::string get_string() const =0
Returns a human-readable description of this status event.
virtual Type get_type() const =0
Returns the concrete status type discriminator.
Placeholder status returned when the transport reports an unrecognised event type.
Definition status.h:208
Type get_type() const override
Returns kUnknown.
std::string get_string() const override
Returns "Unknown".
VLINK_EXPORT friend std::ostream & operator<<(std::ostream &ostream, const Unknown &status) noexcept
Writes "Unknown" to ostream.