![]() |
RMVL
2.6.0-dev
Robotic Manipulation and Vision Library
|
轻量级发布订阅服务节点 更多...
#include <rmvl/lpss/node.hpp>
Public 成员函数 | |
| Node (std::string_view name, uint8_t domain_id=0) | |
| 创建通用节点,默认域 ID 为 0 | |
| ~Node () noexcept | |
| Guid | guid () const noexcept |
| 获取节点唯一标识符 | |
| template<typename MsgType, typename = std::enable_if_t<is_msg_v<MsgType>>> | |
| Publisher< MsgType > | createPublisher (std::string_view topic) noexcept |
| 创建发布者 | |
| template<typename MsgType, typename SubscribeMsgCallback, typename = std::enable_if_t<is_msg_v<MsgType> && std::is_invocable_v<SubscribeMsgCallback, const MsgType &>>> | |
| Subscriber< MsgType > | createSubscriber (std::string_view topic, SubscribeMsgCallback &&callback) noexcept |
| 创建订阅者 | |
| template<typename MsgType> | |
| void | destroyPublisher (Publisher< MsgType > &pub) |
| 销毁发布者 | |
| template<typename MsgType> | |
| void | destroySubscriber (Subscriber< MsgType > &sub) |
| 销毁订阅者 | |
| void | shutdown () noexcept |
| 手动停止节点运行 | |
Protected 属性 | |
| std::shared_mutex | _nodes_mtx {} |
| 节点读写锁 | |
| std::unordered_map< Guid, NodeStorageInfo, GuidHash > | _discovered_nodes {} |
| 已发现的节点列表 | |
| std::shared_mutex | _local_mtx {} |
| 本地实体读写锁 | |
| std::unordered_map< std::string, DataWriterBase::ptr > | _local_writers {} |
| 已注册的 Writers 列表 | |
| std::unordered_map< std::string, DataReaderBase::ptr > | _local_readers {} |
| 已注册的 Readers 列表 | |
| std::shared_mutex | _discovered_mtx {} |
| 已发现实体读写锁 | |
| std::unordered_map< std::string, DiscoveredWriterStorageInfo > | _discovered_writers {} |
| 已发现的 Writers 列表 | |
| std::unordered_map< std::string, DiscoveredReaderStorageInfo > | _discovered_readers {} |
| 已发现的 Readers 列表 | |
轻量级发布订阅服务节点
|
explicit |
创建通用节点,默认域 ID 为 0
| [in] | name | 节点名称 |
| [in] | domain_id | 域 ID |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
创建订阅者
| MsgType | 消息类型 |
| SubscribeMsgCallback | 订阅回调函数类型 |
| [in] | topic | 话题名称 |
| [in] | callback | 订阅回调函数 |
| void rm::lpss::Node::destroyPublisher | ( | Publisher< MsgType > & | pub | ) |
销毁发布者
| MsgType | 消息类型 |
| [in] | pub | 发布者对象 |
| void rm::lpss::Node::destroySubscriber | ( | Subscriber< MsgType > & | sub | ) |
销毁订阅者
| MsgType | 消息类型 |
| [in] | sub | 订阅者对象 |
|
inlinenoexcept |
获取节点唯一标识符
|
noexcept |
手动停止节点运行
|
protected |
已发现实体读写锁
|
protected |
已发现的节点列表
|
protected |
已发现的 Readers 列表
|
protected |
已发现的 Writers 列表
|
protected |
本地实体读写锁
|
protected |
已注册的 Readers 列表
|
protected |
已注册的 Writers 列表
|
protected |
节点读写锁