SerUt  1.1.1 (development version)
Public Member Functions | List of all members
serut::SerializationInterface Class Referenceabstract

Generic serialization interface. More...

#include <serializationinterface.h>

Inheritance diagram for serut::SerializationInterface:
Inheritance graph
[legend]

Public Member Functions

virtual bool readBytes (void *pBuffer, size_t amount)=0
 Read a specific amount of data from the serializer. More...
 
virtual bool writeBytes (const void *pBuffer, size_t amount)=0
 Write a specific amount of data to the serializer. More...
 
bool writeLongDouble (double x)
 Write a long double. More...
 
bool writeDouble (double x)
 Write a double. More...
 
bool writeFloat (float x)
 Write a float. More...
 
bool writeInt32 (int32_t x)
 Write a 32-bit integer. More...
 
bool writeLongDoubles (const long double *pX, size_t amount)
 Write an array of doubles. More...
 
bool writeDoubles (const double *pX, size_t amount)
 Write an array of doubles. More...
 
bool writeFloats (const float *pX, size_t amount)
 Write an array of floats. More...
 
bool writeInt32s (const int32_t *pX, size_t amount)
 Write an array of 32-bit integers. More...
 
bool writeLongDoubles (const std::vector< long double > &x)
 Write the long doubles stored in the vector. More...
 
bool writeDoubles (const std::vector< double > &x)
 Write the doubles stored in the vector. More...
 
bool writeFloats (const std::vector< float > &x)
 Write the floats stored in the vector. More...
 
bool writeInt32s (const std::vector< int32_t > &x)
 Write the 32-bit integers which are stored in the vector. More...
 
bool writeString (const std::string &x)
 Write a string. More...
 
bool readLongDouble (long double *pX)
 Read a long double. More...
 
bool readDouble (double *pX)
 Read a double. More...
 
bool readFloat (float *pX)
 Read a float. More...
 
bool readInt32 (int32_t *pX)
 Read a 32-bit integer. More...
 
bool readLongDoubles (long double *pX, size_t amount)
 Read an array of long doubles. More...
 
bool readDoubles (double *pX, size_t amount)
 Read an array of doubles. More...
 
bool readFloats (float *pX, size_t amount)
 Read an array of floats. More...
 
bool readInt32s (int32_t *pX, size_t amount)
 Read an array of 32-bit integers. More...
 
bool readLongDoubles (std::vector< long double > &x)
 Read a vector of long doubles (the current size of the vector specifies the amount). More...
 
bool readDoubles (std::vector< double > &x)
 Read a vector of doubles (the current size of the vector specifies the amount). More...
 
bool readFloats (std::vector< float > &x)
 Read a vector of floats (the current size of the vector specifies the amount). More...
 
bool readInt32s (std::vector< int32_t > &x)
 Read a vector of 32-bit integers (the current size of the vector specifies the amount). More...
 
bool readString (std::string &x)
 Read a string. More...
 

Detailed Description

This class is the core of the package, as it describes the general serialization interface. Only the SerializationInterface::readBytes and SerializationInterface::writeBytes member functions need to be implemented in a derived class, the other member functions use those two virtual functions to implement their functionality.

Note that currently functions like SerializationInterface::writeDouble simply serialize the bytes in the same order as they are stored in memory. This means that byte ordering (endianness) of the host system is not taken into account and that this package is currently only useful for communication between systems with the same endianness.

Member Function Documentation

◆ readBytes()

virtual bool serut::SerializationInterface::readBytes ( void *  pBuffer,
size_t  amount 
)
pure virtual

Read a specific amount of data from the serializer. This must be implemented in a derived class.

Parameters
pBufferBuffer to store the data in.
amountThe number of bytes to read.

◆ readDouble()

bool serut::SerializationInterface::readDouble ( double *  pX)
inline

◆ readDoubles() [1/2]

bool serut::SerializationInterface::readDoubles ( double *  pX,
size_t  amount 
)
inline

◆ readDoubles() [2/2]

bool serut::SerializationInterface::readDoubles ( std::vector< double > &  x)
inline

◆ readFloat()

bool serut::SerializationInterface::readFloat ( float *  pX)
inline

◆ readFloats() [1/2]

bool serut::SerializationInterface::readFloats ( float *  pX,
size_t  amount 
)
inline

◆ readFloats() [2/2]

bool serut::SerializationInterface::readFloats ( std::vector< float > &  x)
inline

◆ readInt32()

bool serut::SerializationInterface::readInt32 ( int32_t *  pX)
inline

◆ readInt32s() [1/2]

bool serut::SerializationInterface::readInt32s ( int32_t *  pX,
size_t  amount 
)
inline

◆ readInt32s() [2/2]

bool serut::SerializationInterface::readInt32s ( std::vector< int32_t > &  x)
inline

◆ readLongDouble()

bool serut::SerializationInterface::readLongDouble ( long double *  pX)
inline

◆ readLongDoubles() [1/2]

bool serut::SerializationInterface::readLongDoubles ( long double *  pX,
size_t  amount 
)
inline

◆ readLongDoubles() [2/2]

bool serut::SerializationInterface::readLongDoubles ( std::vector< long double > &  x)
inline

◆ readString()

bool serut::SerializationInterface::readString ( std::string &  x)

◆ writeBytes()

virtual bool serut::SerializationInterface::writeBytes ( const void *  pBuffer,
size_t  amount 
)
pure virtual

Write a specific amount of data to the serializer.

Parameters
pBufferPointer to the data which should be written.
amountThe number of bytes that should be written.

◆ writeDouble()

bool serut::SerializationInterface::writeDouble ( double  x)
inline

◆ writeDoubles() [1/2]

bool serut::SerializationInterface::writeDoubles ( const double *  pX,
size_t  amount 
)
inline

◆ writeDoubles() [2/2]

bool serut::SerializationInterface::writeDoubles ( const std::vector< double > &  x)
inline

◆ writeFloat()

bool serut::SerializationInterface::writeFloat ( float  x)
inline

◆ writeFloats() [1/2]

bool serut::SerializationInterface::writeFloats ( const float *  pX,
size_t  amount 
)
inline

◆ writeFloats() [2/2]

bool serut::SerializationInterface::writeFloats ( const std::vector< float > &  x)
inline

◆ writeInt32()

bool serut::SerializationInterface::writeInt32 ( int32_t  x)
inline

◆ writeInt32s() [1/2]

bool serut::SerializationInterface::writeInt32s ( const int32_t *  pX,
size_t  amount 
)
inline

◆ writeInt32s() [2/2]

bool serut::SerializationInterface::writeInt32s ( const std::vector< int32_t > &  x)
inline

◆ writeLongDouble()

bool serut::SerializationInterface::writeLongDouble ( double  x)
inline

◆ writeLongDoubles() [1/2]

bool serut::SerializationInterface::writeLongDoubles ( const long double *  pX,
size_t  amount 
)
inline

◆ writeLongDoubles() [2/2]

bool serut::SerializationInterface::writeLongDoubles ( const std::vector< long double > &  x)
inline

◆ writeString()

bool serut::SerializationInterface::writeString ( const std::string &  x)

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