chrono::ChStreamVectorWrapper Class Reference

Description

This is a wrapper for a std::vector<char> (buffer of chars)

#include <ChStream.h>

Inheritance diagram for chrono::ChStreamVectorWrapper:

Public Member Functions

 ChStreamVectorWrapper (std::vector< char > *mchars)
 Creates a wrapper for an already existing std::vector<char>, given the pointer to that vector. More...
 
virtual ~ChStreamVectorWrapper ()
 Deleting this wrapper does not delete nor closes the wrapped buffer!
 
virtual void Read (char *data, size_t n)
 Reads from vector, up to n chars. More...
 
virtual void Write (const char *data, size_t n)
 Writes raw data to vector, up to n chars. More...
 
virtual bool End_of_stream ()
 Returns true if end of stream (end of vector) reached.
 
std::vector< char > * GetVector ()
 Direct reference to std::vector<char> encapsulated here.
 
void Seek (int position)
 Rewind read position to char number (0= beginning). More...
 

Constructor & Destructor Documentation

chrono::ChStreamVectorWrapper::ChStreamVectorWrapper ( std::vector< char > *  mchars)

Creates a wrapper for an already existing std::vector<char>, given the pointer to that vector.

Member Function Documentation

void chrono::ChStreamVectorWrapper::Read ( char *  data,
size_t  n 
)
virtual

Reads from vector, up to n chars.

If does not succeed, throws exception.

void chrono::ChStreamVectorWrapper::Seek ( int  position)

Rewind read position to char number (0= beginning).

Write position is always at the end (append).

void chrono::ChStreamVectorWrapper::Write ( const char *  data,
size_t  n 
)
virtual

Writes raw data to vector, up to n chars.

If does not succeed, throws exception.