VLink  2.0.0
A high-performance communication middleware
vlink::Status::Base结构体 参考abstract

Polymorphic base for every concrete status event delivered to a callback. 更多...

#include <status.h>

类 vlink::Status::Base 继承关系图:
vlink::Status::Base 的协作图:

Public 成员函数

virtual Type get_type () const =0
 Returns the concrete event type discriminator. 更多...
 
virtual std::string get_string () const =0
 Returns the event name without numeric fields. 更多...
 
template<typename T >
std::shared_ptr< T > as () const
 Safely narrows this event to a concrete Status subclass. 更多...
 

Protected 成员函数

 Base ()
 
virtual ~Base ()
 

友元

VLINK_EXPORT friend std::ostream & operator<< (std::ostream &ostream, const Base &status) noexcept
 Writes the human-readable description of status to ostream. 更多...
 

详细描述

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.

构造及析构函数说明

◆ Base()

vlink::Status::Base::Base ( )
protected

◆ ~Base()

virtual vlink::Status::Base::~Base ( )
protectedvirtual

成员函数说明

◆ as()

template<typename T >
std::shared_ptr< T > vlink::Status::Base::as
inline

Safely narrows this event to a concrete Status subclass.

Details

模板参数
TConcrete event struct derived from Base; must not be Status::Unknown.
返回
shared_ptr<T> pointing at this event.
异常
Exception::RuntimeErrorwhen get_type() is kUnknown.
函数调用图:

◆ get_string()

virtual std::string vlink::Status::Base::get_string ( ) const
pure virtual

◆ get_type()

virtual Type vlink::Status::Base::get_type ( ) const
pure virtual

Returns the concrete event type discriminator.

返回
One of the Status::Type enumerators.

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 , 以及 vlink::Status::Unknown 内被实现.

这是这个函数的调用关系图:

友元及相关函数文档

◆ operator<<

VLINK_EXPORT friend std::ostream& operator<< ( std::ostream &  ostream,
const Base status 
)
friend

Writes the human-readable description of status to ostream.

参数
ostreamOutput stream.
statusEvent to print.
返回
Reference to ostream.

该结构体的文档由以下文件生成: