Sese Framework
x.y.z
A cross-platform framework
|
字节缓冲区类 更多...
#include <AbstractByteBuffer.h>
类 | |
struct | Node |
缓冲节点 更多... | |
Public 成员函数 | |
AbstractByteBuffer (size_t base_size=STREAM_BYTE_STREAM_SIZE_FACTOR, size_t factor=STREAM_BYTE_STREAM_SIZE_FACTOR) | |
AbstractByteBuffer (const AbstractByteBuffer &abstract_byte_buffer) noexcept | |
拷贝 | |
AbstractByteBuffer (AbstractByteBuffer &&abstract_byte_buffer) noexcept | |
移动语义 | |
~AbstractByteBuffer () override | |
析构 | |
virtual void | resetPos () |
重置读取位置 | |
virtual bool | eof () |
是否有可读数据 | |
virtual size_t | getLength () const |
virtual size_t | getCapacity () const |
virtual size_t | getReadableSize () const |
virtual size_t | freeCapacity () |
virtual void | swap (AbstractByteBuffer &other) noexcept |
int64_t | read (void *buffer, size_t len) override |
int64_t | write (const void *buffer, size_t len) override |
int64_t | peek (void *buffer, size_t len) override |
int64_t | trunc (size_t need_read) override |
Public 成员函数 继承自 sese::io::InputStream | |
virtual | ~InputStream () noexcept=default |
Public 成员函数 继承自 sese::io::OutputStream | |
virtual | ~OutputStream () noexcept=default |
int64_t | write (const std::string_view &buffer) |
int64_t | write (const text::StringView &buffer) |
template<typename T > | |
int64_t | write (std::vector< T > &buffer) |
template<typename T , size_t N> | |
int64_t | write (std::array< T, N > &buffer) |
Public 成员函数 继承自 sese::io::PeekableStream | |
virtual | ~PeekableStream ()=default |
Private 属性 | |
size_t | factor = 0 |
Node * | root = nullptr |
Node * | currentWriteNode = nullptr |
size_t | currentWritePos = 0 |
Node * | currentReadNode = nullptr |
size_t | currentReadPos = 0 |
size_t | length = 0 |
size_t | cap = 0 |
额外继承的成员函数 | |
Public 类型 继承自 sese::io::Stream | |
typedef std::shared_ptr< Stream > | Ptr |
Public 类型 继承自 sese::io::InputStream | |
typedef std::shared_ptr< InputStream > | Ptr |
Public 类型 继承自 sese::io::OutputStream | |
typedef std::shared_ptr< OutputStream > | Ptr |
Public 类型 继承自 sese::io::PeekableStream | |
typedef std::shared_ptr< PeekableStream > | Ptr |
字节缓冲区类
|
explicit |
base_size | 初始节点内存大小 |
factor | 追加内存节点大小 |
引用了 cap, currentReadNode, currentWriteNode, factor , 以及 root.
|
noexcept |
|
noexcept |
|
override |
析构
引用了 sese::io::AbstractByteBuffer::Node::next , 以及 root.
|
virtual |
是否有可读数据
被 sese::io::ByteBuffer 重载.
引用了 currentReadNode, currentReadPos, sese::io::AbstractByteBuffer::Node::length , 以及 sese::io::AbstractByteBuffer::Node::next.
被这些函数引用 sese::io::ByteBuffer::eof().
|
virtual |
释放 CurrentReadNode 前的所有节点
被 sese::io::ByteBuffer 重载.
引用了 sese::io::AbstractByteBuffer::Node::cap, currentReadNode, currentReadPos, currentWriteNode, currentWritePos, sese::io::AbstractByteBuffer::Node::length, sese::io::AbstractByteBuffer::Node::next , 以及 root.
被这些函数引用 sese::io::ByteBuffer::freeCapacity().
|
nodiscardvirtual |
|
nodiscardvirtual |
被 sese::io::ByteBuffer 重载.
引用了 currentWriteNode, length , 以及 sese::io::AbstractByteBuffer::Node::length.
被这些函数引用 sese::io::ByteBuffer::getLength() , 以及 sese::internal::net::http::HttpClientImpl::request().
|
nodiscardvirtual |
|
overridevirtual |
仅读取内容,不步进
buffer | 缓存 |
length | 缓存大小 |
被 sese::io::ByteBuffer 重载.
引用了 sese::io::AbstractByteBuffer::Node::buffer, currentReadNode, currentReadPos, currentWriteNode, sese::io::AbstractByteBuffer::Node::length , 以及 sese::io::AbstractByteBuffer::Node::next.
被这些函数引用 sese::service::TcpTransporter::onWrite(), sese::io::ByteBuffer::peek(), sese::iocp::v1::Context::peek(), sese::_windows::iocp::v1::NativeIOCPServer::postWrite(), sese::internal::net::http::HttpClientImpl::writeBodyByAuto() , 以及 sese::internal::net::http::HttpClientImpl::writeHeader().
|
overridevirtual |
被 sese::io::ByteBuffer 重载.
引用了 sese::io::AbstractByteBuffer::Node::buffer, currentReadNode, currentReadPos, currentWriteNode, sese::io::AbstractByteBuffer::Node::length , 以及 sese::io::AbstractByteBuffer::Node::next.
被这些函数引用 sese::MD5Util::encode(), sese::SHA1Util::encode(), sese::SHA256Util::encode(), sese::io::ByteBuffer::read() , 以及 sese::iocp::v1::Context::read().
|
virtual |
重置读取位置
被 sese::io::ByteBuffer 重载.
引用了 currentReadNode, currentReadPos , 以及 root.
被这些函数引用 sese::io::ByteBuffer::resetPos() , 以及 sese::internal::net::http::HttpClientImpl::writeHeader().
|
virtualnoexcept |
引用了 cap, currentReadNode, currentReadPos, currentWriteNode, currentWritePos, length , 以及 root.
|
overridevirtual |
仅步进,不读取内容
length | 步进大小 |
被 sese::io::ByteBuffer 重载.
引用了 currentReadNode, currentReadPos, currentWriteNode, sese::io::AbstractByteBuffer::Node::length , 以及 sese::io::AbstractByteBuffer::Node::next.
被这些函数引用 sese::io::ByteBuffer::trunc(), sese::iocp::v1::Context::trunc(), sese::internal::net::http::HttpClientImpl::writeBodyByAuto() , 以及 sese::internal::net::http::HttpClientImpl::writeHeader().
|
overridevirtual |
被 sese::io::ByteBuffer 重载.
引用了 sese::io::AbstractByteBuffer::Node::buffer, cap, sese::io::AbstractByteBuffer::Node::cap, currentWriteNode, currentWritePos, factor, length, sese::io::AbstractByteBuffer::Node::length , 以及 sese::io::AbstractByteBuffer::Node::next.
被这些函数引用 sese::_windows::iocp::v1::NativeContext::write(), sese::io::ByteBuffer::write() , 以及 sese::iocp::v1::Context::write().
|
private |
被这些函数引用 AbstractByteBuffer(), AbstractByteBuffer(), getCapacity(), swap() , 以及 write().
|
private |
被这些函数引用 AbstractByteBuffer(), AbstractByteBuffer(), AbstractByteBuffer(), eof(), freeCapacity(), getReadableSize(), peek(), read(), resetPos(), swap() , 以及 trunc().
|
private |
被这些函数引用 AbstractByteBuffer(), eof(), freeCapacity(), getReadableSize(), peek(), read(), resetPos(), swap() , 以及 trunc().
|
private |
|
private |
被这些函数引用 AbstractByteBuffer(), freeCapacity(), getReadableSize(), swap() , 以及 write().
|
private |
被这些函数引用 AbstractByteBuffer(), AbstractByteBuffer() , 以及 write().
|
private |
length 不计算最后一个 Node 的,真实长度应为 realLength = length + currentWriteNode->length
被这些函数引用 AbstractByteBuffer(), getLength(), swap() , 以及 write().
|
private |