14#include "libxr_def.hpp"
15#include "libxr_rw.hpp"
111 if (port.queue_info_->Pop(info) != ErrorCode::OK)
114 return ErrorCode::EMPTY;
121 return ErrorCode::OK;
基于共享队列,由 ReadPort + WritePort 组成的单向管道。
static ErrorCode WriteFun(WritePort &port, bool in_isr)
写端回调:弹出一次写操作并推动读侧处理。
WritePort & GetWritePort()
获取写入端口。
Pipe & operator=(const Pipe &)=delete
禁止拷贝赋值以避免重复绑定状态。
static ErrorCode ReadFun(ReadPort &, bool)
读端回调(占位,无具体操作)。
Pipe(size_t buffer_size)
使用指定数据队列容量构造 Pipe。
Pipe(const Pipe &)=delete
禁止拷贝以避免重复绑定状态。
ReadPort & GetReadPort()
获取读取端口。
ReadPort class for handling read operations.
void ProcessPendingReads(bool in_isr)
Processes pending reads.
WritePort class for handling write operations.
ErrorCode(* ReadFun)(ReadPort &port, bool in_isr)
Function pointer type for read operations.
ErrorCode(* WriteFun)(WritePort &port, bool in_isr)
Function pointer type for write operations.