libxr
1.0
Want to be the best embedded framework
|
服务器类,负责解析数据并将其分发到相应的主题 Server class responsible for parsing data and distributing it to corresponding topics More...
#include <message.hpp>
Public Types | |
enum class | Status : uint8_t { WAIT_START , WAIT_TOPIC , WAIT_DATA_CRC } |
服务器解析状态枚举 Enumeration of server parsing states More... | |
Public Member Functions | |
Server (size_t buffer_length) | |
构造函数,初始化服务器并分配缓冲区 Constructor to initialize the server and allocate buffer | |
void | Register (TopicHandle topic) |
注册一个主题 Registers a topic | |
size_t | ParseData (ConstRawData data) |
解析接收到的数据 Parses received data | |
Private Attributes | |
Status | status_ |
服务器的当前解析状态 Current parsing state of the server | |
uint32_t | data_len_ = 0 |
当前数据长度 Current data length | |
RBTree< uint32_t > | topic_map_ |
主题映射表 Topic mapping table | |
BaseQueue | queue_ |
数据队列 Data queue | |
RawData | parse_buff_ |
解析数据缓冲区 Data buffer for parsing | |
TopicHandle | current_topic_ = nullptr |
当前主题句柄 Current topic handle | |
服务器类,负责解析数据并将其分发到相应的主题 Server class responsible for parsing data and distributing it to corresponding topics
Definition at line 722 of file message.hpp.
|
strong |
服务器解析状态枚举 Enumeration of server parsing states
Enumerator | |
---|---|
WAIT_START | 等待起始标志 Waiting for start flag |
WAIT_TOPIC | 等待主题信息 Waiting for topic information |
WAIT_DATA_CRC | 等待数据校验 Waiting for data CRC validation |
Definition at line 730 of file message.hpp.
Topic::Server::Server | ( | size_t | buffer_length | ) |
构造函数,初始化服务器并分配缓冲区 Constructor to initialize the server and allocate buffer
buffer_length | 缓冲区长度 Buffer length |
Definition at line 399 of file message.cpp.
size_t Topic::Server::ParseData | ( | ConstRawData | data | ) |
解析接收到的数据 Parses received data
data | 接收到的原始数据 Received raw data |
Definition at line 416 of file message.cpp.
void Topic::Server::Register | ( | TopicHandle | topic | ) |
注册一个主题 Registers a topic
topic | 需要注册的主题句柄 The topic handle to register |
Definition at line 410 of file message.cpp.
|
private |
当前主题句柄 Current topic handle
Definition at line 766 of file message.hpp.
|
private |
当前数据长度 Current data length
Definition at line 762 of file message.hpp.
|
private |
解析数据缓冲区 Data buffer for parsing
Definition at line 765 of file message.hpp.
|
private |
数据队列 Data queue
Definition at line 764 of file message.hpp.
|
private |
服务器的当前解析状态 Current parsing state of the server
Definition at line 760 of file message.hpp.
|
private |
主题映射表 Topic mapping table
Definition at line 763 of file message.hpp.