Declaration of cmnDeSerializer and functions cmnDeSerializeRaw.
More...
Go to the source code of this file.
|
template<class _elementType > |
void | cmnDeSerializeRaw (std::istream &inputStream, _elementType &data) throw (std::runtime_error) |
|
void | cmnDeSerializeSizeRaw (std::istream &inputStream, size_t &data) throw (std::runtime_error) |
|
void | cmnDeSerializeRaw (std::istream &inputStream, std::string &data) throw (std::runtime_error) |
|
template<class _elementType > |
void | cmnDeSerializeRaw (std::istream &inputStream, std::vector< _elementType > &data) throw (std::runtime_error) |
|
Declaration of cmnDeSerializer and functions cmnDeSerializeRaw.
#define _cmnDeSerializer_h |
template<class _elementType >
void cmnDeSerializeRaw |
( |
std::istream & |
inputStream, |
|
|
_elementType & |
data |
|
) |
| |
throw | ( | std::runtime_error |
| ) | | |
|
inline |
De-serialization helper function for a basic type. If the type is derived from cmnGenericObject, it just calls the DeSerializeRaw member function. Otherwise, it performs a cast to char pointer (char *
) using reinterpret_cast
and then replaces the data with the result of read
from the input stream. If the read operation fails, an exception is thrown (std::runtime_error
).
void cmnDeSerializeRaw |
( |
std::istream & |
inputStream, |
|
|
std::string & |
data |
|
) |
| |
throw | ( | std::runtime_error |
| ) | | |
|
inline |
De-serialization helper function for an STL string. This function first de-serializes the string size, resize the string and then replaces its content with the result of read
from the input stream. If the read operation fails, an exception is thrown (std::runtime_error
).
template<class _elementType >
void cmnDeSerializeRaw |
( |
std::istream & |
inputStream, |
|
|
std::vector< _elementType > & |
data |
|
) |
| |
throw | ( | std::runtime_error |
| ) | | |
|
inline |
De-serialization helper function for an STL vector. This function first de-serializes the vector size, resizes the vector and then alls cmnDeSerializeRaw for each element of the vector. This assumes that cmnDeSerializeRaw is defined for the element type. If the read operation fails, an exception is thrown (std::runtime_error
).
void cmnDeSerializeSizeRaw |
( |
std::istream & |
inputStream, |
|
|
size_t & |
data |
|
) |
| |
throw | ( | std::runtime_error |
| ) | | |
|
inline |
De-serialization helper function for STL size object. This function converts a serialized size (unsigned long long int) to the host size_t object. This operation is required for all size_t as the writer/reader can be both 32 bits or 64 bits programs.
This function should be use to implement the DeSerializeRaw method of classes derived from cmnGenericObject.