rili::stream::Readable Class Referenceabstract
Inheritance diagram for rili::stream::Readable:
[legend]

Public Member Functions

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)
 
virtual void consume (std::size_t size)=0
 
virtual view::Base const & readableView () const =0
 
virtual std::exception_ptr pull (std::size_t count)=0
 
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)
 

Member Function Documentation

virtual void rili::stream::Readable::consume ( std::size_t  size)
pure virtual

consume remove given number of bytes from front of view

Parameters
sizenumber of bytes to remove

Implemented in rili::stream::BufferingFifoDuplex, rili::stream::ReadableFileProxy, and rili::stream::BufferingReadable.

OperationResult rili::stream::Readable::operator>> ( char &  v)
inline

operator >> read single character to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( unsigned char &  v)
inline

operator >> read single character to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( short &  v)
inline

operator >> read(convert) single short to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( unsigned short &  v)
inline

operator >> read(convert) single unsigned short to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( long &  v)
inline

operator >> read(convert) single long to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( unsigned long &  v)
inline

operator >> read(convert) single unsigned long to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( long long &  v)
inline

operator >> read(convert) single long long to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( unsigned long long &  v)
inline

operator >> read(convert) single unsigned long long to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( int &  v)
inline

operator >> read(convert) single int to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( unsigned int &  v)
inline

operator >> read(convert) single unsigned int to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( float &  v)
inline

operator >> read(convert) single float to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( double &  v)
inline

operator >> read(convert) single double to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( bool &  v)
inline

operator >> read(convert) single bool to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( void *&  v)
inline

operator >> read(convert) single pointer value to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
OperationResult rili::stream::Readable::operator>> ( std::string &  v)
inline

operator >> read(convert) single std::string to given variable from stream

Parameters
vvariable where data should be stored
Returns
result of operation
Note
read to first whitespace occurance
OperationResult rili::stream::Readable::operator>> ( Reader const &  fn)
inline

operator >> apply given function on stream and return it result

Parameters
fnfunction to apply
Returns
virtual std::exception_ptr rili::stream::Readable::pull ( std::size_t  count)
pure virtual

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.

Implemented in rili::stream::BufferingFifoDuplex, rili::stream::ReadableFileProxy, and rili::stream::BufferingReadable.

void rili::stream::Readable::read ( unsigned char *  data,
std::size_t  size 
)
inline

read is used to read from stream given amount of data

Parameters
dataaddress where data should be readed from stream
sizenumber of chars to read
Note
user must ensure that given number of chars is avaliable in stream
void rili::stream::Readable::read ( char *  data,
std::size_t  size 
)
inline

read is used to read from stream given amount of data

Parameters
dataaddress where data should be readed from stream
sizenumber of chars to read
Note
user must ensure that given number of chars is avaliable in stream
void rili::stream::Readable::read ( unsigned char &  c)
inline

read read single byte to given variable

Parameters
cplace wher to read data
Note
you need previousely ensure stream view is not empty
void rili::stream::Readable::read ( char &  c)
inline

read read single byte to given variable

Parameters
cplace wher to read data
Note
you need previousely ensure stream view is not empty
virtual view::Base const& rili::stream::Readable::readableView ( ) const
pure virtual

readableView used to access stream view

Returns
view

Implemented in rili::stream::BufferingFifoDuplex, rili::stream::ReadableFileProxy, and rili::stream::BufferingReadable.


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