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

Public Member Functions

void consume (std::size_t size) override
 
view::Base const & readableView () const override
 
std::exception_ptr pull (std::size_t count) override
 
- Public Member Functions inherited from rili::stream::Readable
void read (unsigned char *data, std::size_t size)
 
void read (char *data, std::size_t size)
 
void read (unsigned char &c)
 
void read (char &c)
 
OperationResult operator>> (char &v)
 
OperationResult operator>> (unsigned char &v)
 
OperationResult operator>> (short &v)
 
OperationResult operator>> (unsigned short &v)
 
OperationResult operator>> (long &v)
 
OperationResult operator>> (unsigned long &v)
 
OperationResult operator>> (long long &v)
 
OperationResult operator>> (unsigned long long &v)
 
OperationResult operator>> (int &v)
 
OperationResult operator>> (unsigned int &v)
 
OperationResult operator>> (float &v)
 
OperationResult operator>> (double &v)
 
OperationResult operator>> (bool &v)
 
OperationResult operator>> (void *&v)
 
OperationResult operator>> (std::string &v)
 
OperationResult operator>> (Reader const &fn)
 

Protected Member Functions

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

Member Function Documentation

void rili::stream::BufferingReadable::consume ( std::size_t  size)
overridevirtual

consume remove given number of bytes from front of view

Parameters
sizenumber of bytes to remove

Implements rili::stream::Readable.

virtual std::exception_ptr rili::stream::BufferingReadable::fetch ( view::Default view)
protectedpure virtual

fetch used by BufferingReadable to retrieve data from sink. It should be implemented in way which insert to view data avaliable in sink so far

Parameters
viewis view which should be modified
Returns
operation error exception if occured.
Note
implementation is not abligated to insert any data to view if no data avaliable
std::exception_ptr rili::stream::BufferingReadable::pull ( std::size_t  count)
overridevirtual

pull used to pull from stream underlying sink at least given number of bytes

Parameters
countnumber of bytes to retrieve from sink
Returns
error exception if occured
Note
implementation of this function do not should provide at least count number of bytes to view.
count equal to 0 means implementation should provide zero or more bytes to view and implementation should choose easiest amount to provide.

Implements rili::stream::Readable.

view::Base const& rili::stream::BufferingReadable::readableView ( ) const
overridevirtual

readableView used to access stream view

Returns
view

Implements rili::stream::Readable.


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