#include <cmnDeSerializer.h>
Inheritance diagram for cmnDeSerializer:


This class allows to deserialize objects previously serialized using cmnSerializer.
As each object serialized is identified by a unique class identifer defined at runtime (address of the object cmnClassServices), this class maintains a table of equivalence between the remote class identifiers and local class identifiers. This class can be used to read both the class information and objects in any order as long as the class information for a specific object has been received before the object itself.
Definition at line 125 of file cmnDeSerializer.h.
| typedef long long int cmnDeSerializer::TypeId |
Type used to identify objects over the network. It uses the services pointer but as the sender or receiver could be a 32 or 64 bits OS, we use a data type that can handle both.
Definition at line 132 of file cmnDeSerializer.h.
| cmnDeSerializer::cmnDeSerializer | ( | std::istream & | inputStream | ) |
Constructor.
| inputStream | any stream derived from std::istream. The output stream must be created with the open flag std::istream::binary. |
| cmnGenericObject* cmnDeSerializer::DeSerialize | ( | const bool | serializeObject = true |
) |
De-serialize an object from the input stream. This method will create an object dynamically therefore the class of the object serialized must have been registered using the flag CMN_DYNAMIC_CREATION (see cmnClassServices and cmnClassRegister). This also requires to provide a default constructor for the given class.
This method will deserialize one object only. If the stream contains some class identifiers (pair of class name, remote class identifer) it will read them all until an object is found.
| serializeObject | If true, object content is serialized. If false, only class services is serialized and object content is not serialized. True by default. |
Referenced by mtsProxySerializer::DeSerialize().
| void cmnDeSerializer::DeSerialize | ( | _elementType & | object, | |
| const bool | serializeObject = true | |||
| ) | [inline] |
De-serialize an object from the input stream. This method will replace the object content by the data read from the input stream. There is no dynamic creation involved.
This method will deserialize one object only. If the stream contains some class identifiers (pair of class name, remote class identifer) it will read them all until an object is found.
Definition at line 176 of file cmnDeSerializer.h.
References CMN_LOG_CLASS_RUN_ERROR, and cmnDeSerializeRaw().