VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::Status::Base结构体 参考abstract

Abstract base class for all VLink status event objects. 更多...

#include <status.h>

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

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.

构造及析构函数说明

◆ 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 ( ) const
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.

模板参数
TConcrete 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::RuntimeErrorif the status type is kUnknown.
函数调用图:
这是这个函数的调用关系图:

◆ get_string()

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

Returns a human-readable description of this status event.

返回
String representation of the status and its field 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 内被实现.

函数调用图:

◆ get_type()

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

Returns the concrete status type discriminator.

返回
One of the 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 内被实现.

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

◆ operator<<

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

Writes the human-readable status description to ostream.

参数
ostreamOutput stream.
statusStatus object to print.
返回
Reference to ostream.

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