14#include "libxr_def.hpp"
15#include "libxr_rw.hpp"
119 pipe->read_port_.ProcessPendingReads(in_isr);
基于共享队列,由 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.
ReadFun read_fun_
Driver/backend read notification entry. 底层驱动或后端读取通知入口。
LockFreeQueue< uint8_t > * queue_data_
RX payload queue. 接收数据字节队列。
WritePort class for handling write operations.
WriteFun write_fun_
Driver/backend write entry. 底层驱动或后端写入入口。
LockFreeQueue< uint8_t > * queue_data_
Payload queue for pending write bytes. 挂起写入字节的数据队列。
LockFreeQueue< WriteInfoBlock > * queue_info_
Metadata queue for pending write batches. 挂起写批次的元数据队列。
@ OK
操作成功 | Operation successful
ErrorCode(* ReadFun)(ReadPort &port, bool in_isr)
Function pointer type for read notifications.
ErrorCode(* WriteFun)(WritePort &port, bool in_isr)
Function pointer type for write operations.
OwnerType * ContainerOf(MemberType *ptr, MemberType OwnerType::*member) noexcept
通过成员指针恢复其所属对象指针