CatapultServer  v0.5.0.1 (Elephant)
catapult::io::BufferInputStreamAdapter< TContainer > Class Template Reference

Adapt a typed buffer to be used as an input stream. More...

Inheritance diagram for catapult::io::BufferInputStreamAdapter< TContainer >:
Collaboration diagram for catapult::io::BufferInputStreamAdapter< TContainer >:

Public Member Functions

 BufferInputStreamAdapter (const TContainer &input)
 Creates an input stream around input. More...
 
size_t position () const
 Returns read position. More...
 
bool eof () const override
 Returns true if no data is left in the stream. More...
 
void read (const MutableRawBuffer &buffer) override
 
- Public Member Functions inherited from catapult::io::InputStream
virtual ~InputStream ()=default
 

Private Attributes

const TContainer & m_input
 
size_t m_position
 

Detailed Description

template<typename TContainer>
class catapult::io::BufferInputStreamAdapter< TContainer >

Adapt a typed buffer to be used as an input stream.

Constructor & Destructor Documentation

◆ BufferInputStreamAdapter()

template<typename TContainer>
catapult::io::BufferInputStreamAdapter< TContainer >::BufferInputStreamAdapter ( const TContainer &  input)
inlineexplicit

Creates an input stream around input.

Member Function Documentation

◆ eof()

template<typename TContainer>
bool catapult::io::BufferInputStreamAdapter< TContainer >::eof ( ) const
inlineoverridevirtual

Returns true if no data is left in the stream.

Implements catapult::io::InputStream.

◆ position()

template<typename TContainer>
size_t catapult::io::BufferInputStreamAdapter< TContainer >::position ( ) const
inline

Returns read position.

◆ read()

template<typename TContainer>
void catapult::io::BufferInputStreamAdapter< TContainer >::read ( const MutableRawBuffer &  buffer)
inlineoverridevirtual

Reads data from this stream into buffer.

Exceptions
catapult_file_io_errorif requested amount of data could not be read.

Implements catapult::io::InputStream.

Here is the caller graph for this function:

Member Data Documentation

◆ m_input

template<typename TContainer>
const TContainer& catapult::io::BufferInputStreamAdapter< TContainer >::m_input
private

◆ m_position

template<typename TContainer>
size_t catapult::io::BufferInputStreamAdapter< TContainer >::m_position
private

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