|
GKD.RoboCtrl
|
带 key 的 IO 基类,根据键值派发数据。 更多...
带 key 的 IO 基类,根据键值派发数据。
| TK | 键类型 |
#include <base.hpp>
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_base & | operator= (immovable_base &&)=delete |
Public 成员函数 继承自 roboctrl::utils::not_copyable_base | |
| not_copyable_base (const not_copyable_base &)=delete | |
| not_copyable_base & | operator= (const not_copyable_base &)=delete |
Protected 成员函数 | |
| void | dispatch (const TK &key, byte_span data) |
| 将数据派发给对应 key 的回调。 | |
| size_t | package_size (const TK &key) |
|
inline |
注册平凡类型包的回调。
引用了 roboctrl::utils::from_bytes() , 以及 roboctrl::io::keyed_io_base< TK >::on_data().
|
inlineprotected |