GKD.RoboCtrl
载入中...
搜索中...
未找到
roboctrl::io::combined_parser< parser_types > 模板结构体 参考

组合式解析器,可顺序堆叠多个数据解析单元。 更多...

详细描述

template<data_parser... parser_types>
struct roboctrl::io::combined_parser< parser_types >

组合式解析器,可顺序堆叠多个数据解析单元。

在文件 base.hpp201 行定义.

#include <base.hpp>

Public 类型

template<int N>
using parser_type = std::tuple_element_t< N, std::tuple< parser_types... > >
 
template<int N>
using data_type = typename parser_type< N >::data_type
 

Public 成员函数

size_t parse (byte_span data)
 依次执行所有解析器。
 
template<int N>
auto data () -> data_type< N >
 获取指定序号解析器的解析结果。
 

Public 属性

std::tuple< parser_types... > parsers
 

成员类型定义说明

◆ data_type

template<data_parser... parser_types>
template<int N>
using roboctrl::io::combined_parser< parser_types >::data_type = typename parser_type<N>::data_type

在文件 base.hpp206 行定义.

◆ parser_type

template<data_parser... parser_types>
template<int N>
using roboctrl::io::combined_parser< parser_types >::parser_type = std::tuple_element_t<N,std::tuple<parser_types...> >

在文件 base.hpp203 行定义.

成员函数说明

◆ data()

template<data_parser... parser_types>
template<int N>
auto roboctrl::io::combined_parser< parser_types >::data ( ) -> data_type<N>
inline

获取指定序号解析器的解析结果。

在文件 base.hpp230 行定义.

被这些函数引用 roboctrl::io::combined_parser< parser_types >::parse().

◆ parse()

template<data_parser... parser_types>
size_t roboctrl::io::combined_parser< parser_types >::parse ( byte_span  data)
inline

依次执行所有解析器。

返回
成功消费的字节数,0 表示解析失败

在文件 base.hpp212 行定义.

引用了 roboctrl::io::combined_parser< parser_types >::data().

类成员变量说明

◆ parsers

template<data_parser... parser_types>
std::tuple<parser_types...> roboctrl::io::combined_parser< parser_types >::parsers

在文件 base.hpp234 行定义.


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