Sese Framework  x.y.z
A cross-platform framework
载入中...
搜索中...
未找到
sese::iocp::IOBuf类 参考final

用于 IOCP 的链式缓存 更多...

#include <IOBuf.h>

类 sese::iocp::IOBuf 继承关系图:
sese::io::InputStream sese::io::PeekableStream

Public 类型

using Node = std::unique_ptr<IOBufNode>
 节点类型
 
using ListType = std::list<Node>
 
- Public 类型 继承自 sese::io::InputStream
typedef std::shared_ptr< InputStreamPtr
 
- Public 类型 继承自 sese::io::PeekableStream
typedef std::shared_ptr< PeekableStreamPtr
 

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 的链式缓存

成员类型定义说明

◆ ListType

using sese::iocp::IOBuf::ListType = std::list<Node>

◆ Node

using sese::iocp::IOBuf::Node = std::unique_ptr<IOBufNode>

节点类型

成员函数说明

◆ clear()

void sese::iocp::IOBuf::clear ( )

释放所有节点

◆ getReadableSize()

size_t sese::iocp::IOBuf::getReadableSize ( ) const
nodiscardnoexcept

获取当前可读大小

◆ getTotalSize()

size_t sese::iocp::IOBuf::getTotalSize ( ) const
nodiscardnoexcept

获取当前所有节点内容大小

◆ peek()

int64_t sese::iocp::IOBuf::peek ( void * buffer,
size_t length )
overridevirtual

从一个或多个节点窥视内容

参数
buffer缓存
length缓存大小
返回
实际获取大小

实现了 sese::io::PeekableStream.

引用了 sese::iocp::IOBufNode::buffer, sese::iocp::IOBufNode::getReadableSize(), sese::iocp::IOBufNode::read , 以及 sese::iocp::IOBufNode::size.

被这些函数引用 sese::_windows::iocp::v1::NativeContext::peek().

◆ push()

void sese::iocp::IOBuf::push ( Node node)

添加一个新的节点,节点一旦被添加,外部就不可继续变更此节点

参数
node目标节点

◆ read()

int64_t sese::iocp::IOBuf::read ( void * buffer,
size_t length )
overridevirtual

从一个或多个节点读取内容

参数
buffer缓存
length缓存大小
返回
实际获取大小

实现了 sese::io::InputStream.

被这些函数引用 sese::_windows::iocp::v1::NativeContext::read().

◆ trunc()

int64_t sese::iocp::IOBuf::trunc ( size_t length)
overridevirtual

从一个或多个节点步进内容

参数
length步进大小
返回
实际步进大小

实现了 sese::io::PeekableStream.

被这些函数引用 sese::_windows::iocp::v1::NativeContext::trunc().

类成员变量说明

◆ cur

ListType::iterator sese::iocp::IOBuf::cur
private

◆ list

ListType sese::iocp::IOBuf::list
private

◆ readed

size_t sese::iocp::IOBuf::readed {0}
private

◆ total

size_t sese::iocp::IOBuf::total {0}
private

该类的文档由以下文件生成: