VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::DiscoveryViewer类 参考

Background MessageLoop that aggregates live VLink endpoint discovery data. 更多...

#include <discovery_viewer.h>

类 vlink::DiscoveryViewer 继承关系图:
vlink::DiscoveryViewer 的协作图:

struct  Process
 Information about one process that hosts a VLink endpoint. 更多...
struct  Info
 Aggregated discovery entry for one VLink URL. 更多...

Public 类型

enum  FilterType : uint8_t { kFilterNone = 0 , kFilterAvailable = 1 , kFilterNative = 2 }
 Controls which endpoints are included in the discovery view. 更多...
using Callback = std::function<void(const std::vector<Info>& info_list)>
 Callback fired whenever the discovery information is updated.
 Queue implementation type. 更多...
 Idle strategy controlling CPU and latency trade-offs. 更多...
 Pre-defined task priority levels for kPriorityType loops. 更多...

Public 成员函数

 DiscoveryViewer (FilterType type=kFilterNone)
 Constructs a DiscoveryViewer with the given filter type.
 ~DiscoveryViewer () override
 Destructor – stops the viewer loop.
void register_callback (Callback &&callback)
 Registers the callback invoked when the endpoint list changes.
std::vector< Infoget_info_list ()
 Returns a snapshot of the current discovery information.
std::string get_ser_type (const std::string &url) const
 Returns the serialisation type string for a given URL.
SchemaType get_schema_type (const std::string &url) const
 Returns the coarse schema family for a given URL.

静态 Public 成员函数

static ImplType convert_type (std::string_view str)
 Converts a transport string to the corresponding ImplType value.
static std::string convert_type_to_view (uint32_t type)
 Returns a display string for an ImplType bitmask.
static std::string convert_type_to_view (uint32_t type, const std::vector< Process > &process_list)
 Returns a combined type-and-process display string.
static std::string get_listen_address ()
 Returns the intra-process address used by the discovery subsystem.
static DiscoveryViewerglobal_get ()
 Returns the process-global DiscoveryViewer singleton.

Protected 成员函数

size_t get_max_task_count () const override
 Returns the maximum queue depth.
uint32_t get_max_elapsed_time () const override
 Returns the maximum allowed task execution time in milliseconds.
void on_begin () override
 Called from the loop thread just before the first task is processed.
void on_end () override
 Called from the loop thread just after the last task has been processed.

详细描述

Background MessageLoop that aggregates live VLink endpoint discovery data.

成员类型定义说明

◆ Callback

using vlink::DiscoveryViewer::Callback = std::function<void(const std::vector<Info>& info_list)>

Callback fired whenever the discovery information is updated.

Invoked on the viewer's event loop thread. The vector is a snapshot of the current live endpoint list.

成员枚举类型说明

◆ FilterType

Controls which endpoints are included in the discovery view.

Value Meaning
kFilterNone All discovered endpoints
kFilterAvailable Endpoints with at least one live process
kFilterNative Endpoints from the local host only
枚举值
kFilterNone 

Show all endpoints.

kFilterAvailable 

Show only endpoints with live processes.

kFilterNative 

Show only local-host endpoints.

构造及析构函数说明

◆ DiscoveryViewer()

vlink::DiscoveryViewer::DiscoveryViewer ( FilterType type = kFilterNone)
explicit

Constructs a DiscoveryViewer with the given filter type.

参数
typeControls which endpoints are included. Default: kFilterNone.
这是这个函数的调用关系图:

◆ ~DiscoveryViewer()

vlink::DiscoveryViewer::~DiscoveryViewer ( )
override

Destructor – stops the viewer loop.

成员函数说明

◆ convert_type()

ImplType vlink::DiscoveryViewer::convert_type ( std::string_view str)
staticnodiscard

Converts a transport string to the corresponding ImplType value.

参数
strTransport string (e.g., "dds", "shm").
返回
Corresponding ImplType, or 0 if unknown.

◆ convert_type_to_view() [1/2]

std::string vlink::DiscoveryViewer::convert_type_to_view ( uint32_t type)
staticnodiscard

Returns a display string for an ImplType bitmask.

参数
typeImplType bitmask.
返回
Human-readable type string.

◆ convert_type_to_view() [2/2]

std::string vlink::DiscoveryViewer::convert_type_to_view ( uint32_t type,
const std::vector< Process > & process_list )
staticnodiscard

Returns a combined type-and-process display string.

参数
typeImplType bitmask.
process_listList of processes to include in the display.
返回
Combined display string.

◆ get_info_list()

std::vector< Info > vlink::DiscoveryViewer::get_info_list ( )
nodiscard

Returns a snapshot of the current discovery information.

返回
Copy of the live Info list at the time of the call.

◆ get_listen_address()

std::string vlink::DiscoveryViewer::get_listen_address ( )
staticnodiscard

Returns the intra-process address used by the discovery subsystem.

返回
Discovery listen address string.

◆ get_max_elapsed_time()

uint32_t vlink::DiscoveryViewer::get_max_elapsed_time ( ) const
overrideprotectedvirtual

Returns the maximum allowed task execution time in milliseconds.

When a task exceeds this duration, on_task_timeout() is called. Returns 0 to disable timeout checking.

返回
Maximum execution time in ms.

重载 vlink::MessageLoop .

◆ get_max_task_count()

size_t vlink::DiscoveryViewer::get_max_task_count ( ) const
overrideprotectedvirtual

Returns the maximum queue depth.

返回
kMaxTaskSize (10000) by default.

重载 vlink::MessageLoop .

◆ get_schema_type()

SchemaType vlink::DiscoveryViewer::get_schema_type ( const std::string & url) const
nodiscard

Returns the coarse schema family for a given URL.

参数
urlTopic URL to look up.
返回
Schema family, or SchemaType::kUnknown if not known.

◆ get_ser_type()

std::string vlink::DiscoveryViewer::get_ser_type ( const std::string & url) const
nodiscard

Returns the serialisation type string for a given URL.

参数
urlTopic URL to look up.
返回
Serialisation type (e.g., "demo.proto.PointCloud"), or empty if not known.

◆ global_get()

DiscoveryViewer * vlink::DiscoveryViewer::global_get ( )
static

Returns the process-global DiscoveryViewer singleton.

Created with kFilterNone on first call. The singleton is destroyed on process exit.

返回
Raw pointer to the global DiscoveryViewer.
函数调用图:

◆ on_begin()

void vlink::DiscoveryViewer::on_begin ( )
overrideprotectedvirtual

Called from the loop thread just before the first task is processed.

Override in subclasses to perform per-thread initialisation.

重载 vlink::MessageLoop .

◆ on_end()

void vlink::DiscoveryViewer::on_end ( )
overrideprotectedvirtual

Called from the loop thread just after the last task has been processed.

Override in subclasses to perform per-thread cleanup.

重载 vlink::MessageLoop .

函数调用图:

◆ register_callback()

void vlink::DiscoveryViewer::register_callback ( Callback && callback)

Registers the callback invoked when the endpoint list changes.

Replaces any previously registered callback. The callback is invoked on the viewer's loop thread.

参数
callbackFunction receiving the updated Info list.

该类的文档由以下文件生成: