join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::Chunkstreambuf Class Reference

chunk stream buffer. More...

#include <chunkstream.hpp>

Inheritance diagram for join::Chunkstreambuf:
Collaboration diagram for join::Chunkstreambuf:

Public Member Functions

 Chunkstreambuf (std::streambuf *streambuf, bool own=false)
 create the chunk stream buffer instance.
 
 Chunkstreambuf (std::streambuf *streambuf, std::streamsize chunksize, bool own=false)
 create the chunk stream buffer instance.
 
 Chunkstreambuf (const Chunkstreambuf &other)=delete
 copy constructor.
 
Chunkstreambufoperator= (const Chunkstreambuf &other)=delete
 copy assignment operator.
 
 Chunkstreambuf (Chunkstreambuf &&other)
 move constructor.
 
Chunkstreambufoperator= (Chunkstreambuf &&other)
 move assignment operator.
 
virtual ~Chunkstreambuf ()
 destroy the chunk stream buffer instance.
 
- Public Member Functions inherited from join::StreambufDecorator
 StreambufDecorator (std::streambuf *streambuf, bool own=false)
 create the stream buffer decorator instance.
 
 StreambufDecorator (const StreambufDecorator &other)=delete
 copy constructor.
 
StreambufDecoratoroperator= (const StreambufDecorator &other)=delete
 copy assignment operator.
 
 StreambufDecorator (StreambufDecorator &&other)
 move constructor.
 
StreambufDecoratoroperator= (StreambufDecorator &&other)
 move assignment operator.
 
virtual ~StreambufDecorator ()
 destroy the stream buffer decorator instance.
 

Protected Member Functions

virtual int_type underflow () override
 reads characters from the associated input sequence to the get area.
 
virtual int_type overflow (int_type c=traits_type::eof()) override
 writes characters to the associated output sequence from the put area.
 
virtual int_type sync () override
 synchronizes the buffers with the associated character sequence.
 

Protected Attributes

std::streamsize _chunksize = 16384
 chunk size.
 
std::unique_ptr< char[]> _buf
 internal buffer.
 
- Protected Attributes inherited from join::StreambufDecorator
std::streambuf * _innerbuf
 concrete stream buffer.
 
bool _own = false
 own inner stream buffer.
 

Detailed Description

chunk stream buffer.

Constructor & Destructor Documentation

◆ Chunkstreambuf() [1/4]

Chunkstreambuf::Chunkstreambuf ( std::streambuf * streambuf,
bool own = false )

create the chunk stream buffer instance.

Parameters
streambufconcrete stream buffer.
ownis the decorator owning inner stream buffer.

◆ Chunkstreambuf() [2/4]

Chunkstreambuf::Chunkstreambuf ( std::streambuf * streambuf,
std::streamsize chunksize,
bool own = false )

create the chunk stream buffer instance.

Parameters
streambufconcrete stream buffer.
chunksizechunk size.
ownis the decorator owning inner stream buffer.

◆ Chunkstreambuf() [3/4]

join::Chunkstreambuf::Chunkstreambuf ( const Chunkstreambuf & other)
delete

copy constructor.

Parameters
otherother object to copy.

◆ Chunkstreambuf() [4/4]

Chunkstreambuf::Chunkstreambuf ( Chunkstreambuf && other)

move constructor.

Parameters
otherother object to move.

◆ ~Chunkstreambuf()

Chunkstreambuf::~Chunkstreambuf ( )
virtual

destroy the chunk stream buffer instance.

Member Function Documentation

◆ operator=() [1/2]

Chunkstreambuf & Chunkstreambuf::operator= ( Chunkstreambuf && other)

move assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ operator=() [2/2]

Chunkstreambuf & join::Chunkstreambuf::operator= ( const Chunkstreambuf & other)
delete

copy assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ overflow()

Chunkstreambuf::int_type Chunkstreambuf::overflow ( int_type c = traits_type::eof ())
overrideprotectedvirtual

writes characters to the associated output sequence from the put area.

Parameters
cthe character to store in the put area.
Returns
EOF on failure, some other value on success.

◆ sync()

Chunkstreambuf::int_type Chunkstreambuf::sync ( )
overrideprotectedvirtual

synchronizes the buffers with the associated character sequence.

Returns
EOF on failure, some other value on success.

◆ underflow()

Chunkstreambuf::int_type Chunkstreambuf::underflow ( )
overrideprotectedvirtual

reads characters from the associated input sequence to the get area.

Returns
the value of the character pointed to by the get pointer after the call on success, EOF otherwise.

Member Data Documentation

◆ _buf

std::unique_ptr<char []> join::Chunkstreambuf::_buf
protected

internal buffer.

◆ _chunksize

std::streamsize join::Chunkstreambuf::_chunksize = 16384
protected

chunk size.


The documentation for this class was generated from the following files: