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

线程安全的固定大小缓存 更多...

#include <FixedBuffer.h>

类 sese::io::FixedBuffer 继承关系图:
sese::io::AbstractFixedBuffer sese::io::Stream sese::io::PeekableStream sese::io::InputStream sese::io::OutputStream

Public 成员函数

 FixedBuffer (size_t size) noexcept
 
int64_t read (void *buffer, size_t length) override
 
int64_t write (const void *buffer, size_t length) override
 
int64_t peek (void *buffer, size_t length) override
 
int64_t trunc (size_t length) override
 
void reset () noexcept override
 
size_t getReadableSize () noexcept
 
size_t getWriteableSize () noexcept
 
- Public 成员函数 继承自 sese::io::AbstractFixedBuffer
 AbstractFixedBuffer (size_t size) noexcept
 
 ~AbstractFixedBuffer () noexcept override
 
 AbstractFixedBuffer (const AbstractFixedBuffer &buffer) noexcept
 
 AbstractFixedBuffer (AbstractFixedBuffer &&buffer) noexcept
 
const char * data () const
 
size_t getSize () const noexcept
 
size_t getReadSize () const noexcept
 
size_t getWriteSize () const noexcept
 
size_t getReadableSize () const noexcept
 
size_t getWriteableSize () const noexcept
 
- 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 属性

std::mutex mutex
 

额外继承的成员函数

- Public 类型 继承自 sese::io::Stream
typedef std::shared_ptr< StreamPtr
 
- Public 类型 继承自 sese::io::InputStream
typedef std::shared_ptr< InputStreamPtr
 
- Public 类型 继承自 sese::io::OutputStream
typedef std::shared_ptr< OutputStreamPtr
 
- Public 类型 继承自 sese::io::PeekableStream
typedef std::shared_ptr< PeekableStreamPtr
 
- Protected 属性 继承自 sese::io::AbstractFixedBuffer
size_t size {}
 
size_t readSize {}
 
size_t writeSize {}
 
char * buffer {}
 

详细描述

线程安全的固定大小缓存

构造及析构函数说明

◆ FixedBuffer()

sese::io::FixedBuffer::FixedBuffer ( size_t size)
explicitnoexcept

成员函数说明

◆ getReadableSize()

size_t sese::io::FixedBuffer::getReadableSize ( )
noexcept

◆ getWriteableSize()

size_t sese::io::FixedBuffer::getWriteableSize ( )
nodiscardnoexcept

◆ peek()

int64_t sese::io::FixedBuffer::peek ( void * buffer,
size_t length )
overridevirtual

仅读取内容,不步进

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

重载 sese::io::AbstractFixedBuffer .

引用了 sese::io::AbstractFixedBuffer::peek().

◆ read()

int64_t sese::io::FixedBuffer::read ( void * buffer,
size_t length )
overridevirtual

◆ reset()

void sese::io::FixedBuffer::reset ( )
overridevirtualnoexcept

◆ trunc()

int64_t sese::io::FixedBuffer::trunc ( size_t length)
overridevirtual

仅步进,不读取内容

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

重载 sese::io::AbstractFixedBuffer .

引用了 sese::io::AbstractFixedBuffer::trunc().

◆ write()

int64_t sese::io::FixedBuffer::write ( const void * buffer,
size_t length )
overridevirtual

类成员变量说明

◆ mutex

std::mutex sese::io::FixedBuffer::mutex
private

被这些函数引用 read().


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