rili::stream::BufferingWritable Class Referenceabstract
Inheritance diagram for rili::stream::BufferingWritable:
[legend]
Collaboration diagram for rili::stream::BufferingWritable:
[legend]

Public Member Functions

void write (char const *data, std::size_t size) override
 
std::exception_ptr flush () override
 
view::Base const & writableView () const override
 
- Public Member Functions inherited from rili::stream::Writable
void write (unsigned char const *data, std::size_t size)
 
Writableoperator<< (char v)
 
Writableoperator<< (unsigned char v)
 
Writableoperator<< (char const *v)
 
Writableoperator<< (unsigned char const *v)
 
Writableoperator<< (std::string const &v)
 
Writableoperator<< (short v)
 
Writableoperator<< (unsigned short v)
 
Writableoperator<< (long v)
 
Writableoperator<< (unsigned long v)
 
Writableoperator<< (long long v)
 
Writableoperator<< (unsigned long long v)
 
Writableoperator<< (int v)
 
Writableoperator<< (unsigned int v)
 
Writableoperator<< (float v)
 
Writableoperator<< (double v)
 
Writableoperator<< (bool v)
 
Writableoperator<< (void *v)
 
OperationResult operator<< (std::function< OperationResult(Writable &)> const &fn)
 
Writableoperator<< (Writer const &fn)
 

Protected Member Functions

virtual std::exception_ptr commit (view::Default &view)=0
 

Member Function Documentation

virtual std::exception_ptr rili::stream::BufferingWritable::commit ( view::Default view)
protectedpure virtual

commit used by BufferingWritable implementation to pass current buffered view to underlying sink implementation which should shrink provided view. User should implement it to move data from view to sink.

Parameters
viewdata to be moved to sink
Returns
operation error exception if occured.
Note
implementation of this method is not obligated to move all data from view to sink. You can not mova anything or only that much as you can at once. BufferingWritable will care to call it again latter if still needed to push data to sink.
std::exception_ptr rili::stream::BufferingWritable::flush ( )
overridevirtual

flush used to force move data to underlying sink

Returns
error exception if occured

Implements rili::stream::Writable.

view::Base const& rili::stream::BufferingWritable::writableView ( ) const
overridevirtual

view used to access currently avaliable data in stream

Returns
view

Implements rili::stream::Writable.

void rili::stream::BufferingWritable::write ( char const *  data,
std::size_t  size 
)
overridevirtual

write used to write sequence of chars to stream of given size

Parameters
datadata which should be written
sizenumber of chars to write

Implements rili::stream::Writable.


The documentation for this class was generated from the following file:
  • rili/stream/BufferingStream.hpp