GKD.RoboCtrl
载入中...
搜索中...
未找到
roboctrl::io::keyed_io_base< TK > 模板类 参考

带 key 的 IO 基类,根据键值派发数据。 更多...

详细描述

template<typename TK>
class roboctrl::io::keyed_io_base< TK >

带 key 的 IO 基类,根据键值派发数据。

模板参数
TK键类型

在文件 base.hpp117 行定义.

#include <base.hpp>

类 roboctrl::io::keyed_io_base< TK > 继承关系图:
roboctrl::utils::immovable_base roboctrl::utils::not_copyable_base

Public 成员函数

void on_data (const TK &key, callback_fn< byte_span > auto fn, size_t size=0)
 注册指定 key 的回调。
 
template<typename Fn >
requires (!std::same_as<utils::function_arg_t<Fn>,byte_span>)
void on_data (const TK &key, Fn &&fn)
 注册平凡类型包的回调。
 
- Public 成员函数 继承自 roboctrl::utils::immovable_base
 immovable_base (immovable_base &&)=delete
 
immovable_baseoperator= (immovable_base &&)=delete
 
- Public 成员函数 继承自 roboctrl::utils::not_copyable_base
 not_copyable_base (const not_copyable_base &)=delete
 
not_copyable_baseoperator= (const not_copyable_base &)=delete
 

Protected 成员函数

void dispatch (const TK &key, byte_span data)
 将数据派发给对应 key 的回调。
 
size_t package_size (const TK &key)
 

构造及析构函数说明

◆ keyed_io_base()

template<typename TK >
roboctrl::io::keyed_io_base< TK >::keyed_io_base ( )
inline

在文件 base.hpp122 行定义.

成员函数说明

◆ dispatch()

template<typename TK >
void roboctrl::io::keyed_io_base< TK >::dispatch ( const TK key,
byte_span  data 
)
inlineprotected

将数据派发给对应 key 的回调。

在文件 base.hpp152 行定义.

引用了 roboctrl::io::make_shared_from().

◆ on_data() [1/2]

template<typename TK >
void roboctrl::io::keyed_io_base< TK >::on_data ( const TK key,
callback_fn< byte_span > auto  fn,
size_t  size = 0 
)
inline

注册指定 key 的回调。

在文件 base.hpp127 行定义.

被这些函数引用 roboctrl::io::keyed_io_base< TK >::on_data().

◆ on_data() [2/2]

template<typename TK >
template<typename Fn >
requires (!std::same_as<utils::function_arg_t<Fn>,byte_span>)
void roboctrl::io::keyed_io_base< TK >::on_data ( const TK key,
Fn &&  fn 
)
inline

注册平凡类型包的回调。

在文件 base.hpp139 行定义.

引用了 roboctrl::utils::from_bytes() , 以及 roboctrl::io::keyed_io_base< TK >::on_data().

◆ package_size()

template<typename TK >
size_t roboctrl::io::keyed_io_base< TK >::package_size ( const TK key)
inlineprotected

在文件 base.hpp159 行定义.


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