ThunderEgg  1.0.0
ThunderEgg::BufferReader Class Reference

Class that is used to help read serialized objects from a buffer. More...

#include <BufferReader.h>

Public Member Functions

 BufferReader (char *buffer)
 Create a new BufferReader with given buffer. More...
 
int getPos ()
 get the current position in the buffer More...
 
BufferReaderoperator>> (Serializable &obj)
 Get an object of the buffer. More...
 
template<typename T >
std::enable_if<!isSerializable< T >), BufferReader >::type & operator>> (T &obj)
 Get an object from the buffer. More...
 

Detailed Description

Class that is used to help read serialized objects from a buffer.

Constructor & Destructor Documentation

◆ BufferReader()

ThunderEgg::BufferReader::BufferReader ( char *  buffer)
inline

Create a new BufferReader with given buffer.

Parameters
bufferthe pointer to the beginning of the buffer.

Member Function Documentation

◆ getPos()

int ThunderEgg::BufferReader::getPos ( )
inline

get the current position in the buffer

Returns
the current position

◆ operator>>() [1/2]

BufferReader& ThunderEgg::BufferReader::operator>> ( Serializable obj)
inline

Get an object of the buffer.

Parameters
objthe Serializable object.
Returns
this BufferReader

◆ operator>>() [2/2]

template<typename T >
std::enable_if<!isSerializable<T>), BufferReader>::type& ThunderEgg::BufferReader::operator>> ( T &  obj)
inline

Get an object from the buffer.

Template Parameters
Tthe type of the object.
Parameters
objthe object. This object must be in serialized form.
Returns
this BufferReader

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