|
VLink 2.0.0
A high-performance communication middleware
|
Abstract base class for all VLink status event objects. 更多...
#include <status.h>
Public 成员函数 | |
| virtual Type | get_type () const =0 |
| Returns the concrete status type discriminator. | |
| virtual std::string | get_string () const =0 |
| Returns a human-readable description of this status event. | |
| template<typename T> | |
| std::shared_ptr< T > | as () const |
Safely downcasts this status to a concrete type T. | |
Protected 成员函数 | |
| Base () | |
| virtual | ~Base () |
友元 | |
| VLINK_EXPORT friend std::ostream & | operator<< (std::ostream &ostream, const Base &status) noexcept |
Writes the human-readable status description to ostream. | |
Abstract base class for all VLink status event objects.
All concrete status types (PublicationMatched, SampleRejected, etc.) derive from Base and are delivered as std::shared_ptr<Status::Base> via status callbacks. Use as<T>() to safely downcast to a specific concrete type.
Inherits std::enable_shared_from_this to support safe shared_ptr construction from within member functions.
|
protected |
|
protectedvirtual |
|
inlinenodiscard |
Safely downcasts this status to a concrete type T.
Details
Performs a dynamic_pointer_cast. If the status type is kUnknown, throws Exception::RuntimeError.
| T | Concrete status struct type (e.g., Status::SubscriptionMatched). Must be derived from Base and not be Status::Unknown. |
shared_ptr<T> to the concrete status. | Exception::RuntimeError | if the status type is kUnknown. |
|
nodiscardpure virtual |
Returns a human-readable description of this status event.
在 vlink::Status::LivelinessChanged, vlink::Status::LivelinessLost, vlink::Status::OfferedDeadlineMissed, vlink::Status::OfferedIncompatibleQos, vlink::Status::PublicationMatched, vlink::Status::RequestedDeadlineMissed, vlink::Status::RequestedIncompatibleQos, vlink::Status::SampleLost, vlink::Status::SampleRejected, vlink::Status::SubscriptionMatched , 以及 vlink::Status::Unknown 内被实现.
|
nodiscardpure virtual |
Returns the concrete status type discriminator.
Status::Type enum values. 在 vlink::Status::LivelinessChanged, vlink::Status::LivelinessLost, vlink::Status::OfferedDeadlineMissed, vlink::Status::OfferedIncompatibleQos, vlink::Status::PublicationMatched, vlink::Status::RequestedDeadlineMissed, vlink::Status::RequestedIncompatibleQos, vlink::Status::SampleLost, vlink::Status::SampleRejected, vlink::Status::SubscriptionMatched , 以及 vlink::Status::Unknown 内被实现.
|
friend |
Writes the human-readable status description to ostream.
| ostream | Output stream. |
| status | Status object to print. |
ostream.