Sese Framework
x.y.z
A cross-platform framework
|
用于 IOCP 的链式缓存 更多...
#include <IOBuf.h>
Public 类型 | |
using | Node = std::unique_ptr<IOBufNode> |
节点类型 | |
using | ListType = std::list<Node> |
Public 类型 继承自 sese::io::InputStream | |
typedef std::shared_ptr< InputStream > | Ptr |
Public 类型 继承自 sese::io::PeekableStream | |
typedef std::shared_ptr< PeekableStream > | Ptr |
Public 成员函数 | |
void | push (Node node) |
void | clear () |
释放所有节点 | |
size_t | getReadableSize () const noexcept |
获取当前可读大小 | |
size_t | getTotalSize () const noexcept |
获取当前所有节点内容大小 | |
int64_t | read (void *buffer, size_t length) override |
int64_t | peek (void *buffer, size_t length) override |
int64_t | trunc (size_t length) override |
Public 成员函数 继承自 sese::io::InputStream | |
virtual | ~InputStream () noexcept=default |
Public 成员函数 继承自 sese::io::PeekableStream | |
virtual | ~PeekableStream ()=default |
Private 属性 | |
ListType | list |
ListType::iterator | cur |
size_t | total {0} |
size_t | readed {0} |
用于 IOCP 的链式缓存
using sese::iocp::IOBuf::ListType = std::list<Node> |
using sese::iocp::IOBuf::Node = std::unique_ptr<IOBufNode> |
节点类型
void sese::iocp::IOBuf::clear | ( | ) |
释放所有节点
|
nodiscardnoexcept |
获取当前可读大小
|
nodiscardnoexcept |
获取当前所有节点内容大小
|
overridevirtual |
从一个或多个节点窥视内容
buffer | 缓存 |
length | 缓存大小 |
引用了 sese::iocp::IOBufNode::buffer, sese::iocp::IOBufNode::getReadableSize(), sese::iocp::IOBufNode::read , 以及 sese::iocp::IOBufNode::size.
void sese::iocp::IOBuf::push | ( | Node | node | ) |
添加一个新的节点,节点一旦被添加,外部就不可继续变更此节点
node | 目标节点 |
|
overridevirtual |
从一个或多个节点读取内容
buffer | 缓存 |
length | 缓存大小 |
|
overridevirtual |
从一个或多个节点步进内容
length | 步进大小 |
|
private |
|
private |
|
private |
|
private |