|
VLink
2.0.0
A high-performance communication middleware
|
Polymorphic base for every concrete status event delivered to a callback. More...
#include <status.h>
Public Member Functions | |
| virtual Type | get_type () const =0 |
| Returns the concrete event type discriminator. More... | |
| virtual std::string | get_string () const =0 |
| Returns the event name without numeric fields. More... | |
| template<typename T > | |
| std::shared_ptr< T > | as () const |
Safely narrows this event to a concrete Status subclass. More... | |
Protected Member Functions | |
| Base () | |
| virtual | ~Base () |
Friends | |
| VLINK_EXPORT friend std::ostream & | operator<< (std::ostream &ostream, const Base &status) noexcept |
Writes the human-readable description of status to ostream. More... | |
Polymorphic base for every concrete status event delivered to a callback.
Concrete subclasses live in status_detail.h and carry the counter, handle, and reason fields specific to each event. Subscribers downcast through as<T>(), which throws Exception::RuntimeError for kUnknown events. std::enable_shared_from_this allows implementations to safely produce a shared_ptr to themselves from inside member calls.
|
protected |
|
protectedvirtual |
|
inline |
Safely narrows this event to a concrete Status subclass.
Details.
| T | Concrete event struct derived from Base; must not be Status::Unknown. |
shared_ptr<T> pointing at this event. | Exception::RuntimeError | when get_type() is kUnknown. |
|
pure virtual |
Returns the event name without numeric fields.
"SubscriptionMatched". Use operator<< for full detail. Implemented in vlink::Status::SampleLost, vlink::Status::RequestedIncompatibleQos, vlink::Status::SampleRejected, vlink::Status::LivelinessChanged, vlink::Status::RequestedDeadlineMissed, vlink::Status::SubscriptionMatched, vlink::Status::LivelinessLost, vlink::Status::OfferedIncompatibleQos, vlink::Status::OfferedDeadlineMissed, vlink::Status::PublicationMatched, and vlink::Status::Unknown.
|
pure virtual |
Returns the concrete event type discriminator.
Status::Type enumerators. Implemented in vlink::Status::SampleLost, vlink::Status::RequestedIncompatibleQos, vlink::Status::SampleRejected, vlink::Status::LivelinessChanged, vlink::Status::RequestedDeadlineMissed, vlink::Status::SubscriptionMatched, vlink::Status::LivelinessLost, vlink::Status::OfferedIncompatibleQos, vlink::Status::OfferedDeadlineMissed, vlink::Status::PublicationMatched, and vlink::Status::Unknown.
|
friend |
Writes the human-readable description of status to ostream.
| ostream | Output stream. |
| status | Event to print. |
ostream.