Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Unserializer Class Referenceabstract

#include <elm/serial2/Unserializer.h>

+ Inheritance diagram for Unserializer:

Public Member Functions

virtual ~Unserializer (void)
 
virtual void flush (void)=0
 
virtual void beginObject (const rtti::Type &clazz, void *object)=0
 
virtual void endObject (const rtti::Type &clazz, void *object)=0
 
virtual bool beginField (CString name)=0
 
virtual void endField (void)=0
 
virtual void onPointer (const rtti::Type &clazz, void **object)=0
 
virtual bool beginCompound (void *)=0
 
virtual bool nextItem (void)=0
 
virtual int countItems (void)=0
 
virtual void endCompound (void *)=0
 
virtual int onEnum (const rtti::Type &clazz)=0
 
virtual void onValue (bool &v)=0
 
virtual void onValue (signed int &v)=0
 
virtual void onValue (unsigned int &v)=0
 
virtual void onValue (char &v)=0
 
virtual void onValue (signed char &v)=0
 
virtual void onValue (unsigned char &v)=0
 
virtual void onValue (signed short &v)=0
 
virtual void onValue (unsigned short &v)=0
 
virtual void onValue (signed long &v)=0
 
virtual void onValue (unsigned long &v)=0
 
virtual void onValue (signed long long &v)=0
 
virtual void onValue (unsigned long long &v)=0
 
virtual void onValue (float &v)=0
 
virtual void onValue (double &v)=0
 
virtual void onValue (long double &v)=0
 
virtual void onValue (CString &v)=0
 
virtual void onValue (String &v)=0
 

Detailed Description

Base class of unserialization classes. The serialization is the conversion from the memory representation of a data structure to a sequential representation and the unserialization is the reverse operation.

To implement a concrete unserializer, one has to inherit from this class and to override the virtual functions. The unserialization function will be called according the unserialized value.

Constructor & Destructor Documentation

◆ ~Unserializer()

virtual ~Unserializer ( void  )
inlinevirtual

Member Function Documentation

◆ beginCompound()

bool beginCompound ( void )
pure virtual

This function is called to unserialize a compound object, that is, an object containing a collection of values with the same type.

Parameters
objectCompound object to unserialize.

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize(), CollectionSerializer< Vector< T >, T >::unserialize(), DataSerializer< Vector< T, M >, T >::unserialize(), and CollecAC< Coll, T >::unserialize().

◆ beginField()

bool beginField ( CString  name)
pure virtual

Called to begin the unserialization of a field in an object.

This call is always preceded by call to beginObject() for the object containing the field and there is no more call to this function as soon as the corresponding endObject() call is performed.

Between a call to a beginField() and of a endField(), calls to the unserializer functions are performed to serialize the corresponding data.

Parameters
nameName of the field.

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize().

◆ beginObject()

void beginObject ( const rtti::Type clazz,
void object 
)
pure virtual

Called to start the unserialization of a new object.

Parameters
clazzObject class descriptor.
objectUnserialized object.

Implemented in XOMUnserializer.

Referenced by from_class< T >::unserialize().

◆ countItems()

int countItems ( void  )
pure virtual

This function is called to get the count if items in a compound.

If it only called after a beginCompound() and before any to nextItem().

Returns
Count of values in the compound.

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize(), CollectionSerializer< Vector< T >, T >::unserialize(), DataSerializer< Vector< T, M >, T >::unserialize(), and CollecAC< Coll, T >::unserialize().

◆ endCompound()

void endCompound ( void )
pure virtual

This function is called at the end of a compound.

This function is only called after a call to beginCompound() and matches any call to beginCompound().

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize(), CollectionSerializer< Vector< T >, T >::unserialize(), DataSerializer< Vector< T, M >, T >::unserialize(), and CollecAC< Coll, T >::unserialize().

◆ endField()

void endField ( void  )
pure virtual

Called to end the unserialization of a field in an object.

This call is always preceded by call to beginField() and there is no more call to this function as soon as the corresponding endObject() call is performed.

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize().

◆ endObject()

void endObject ( const rtti::Type clazz,
void object 
)
pure virtual

Called to finish the unserialization of an object. This function call is always preceded by a call to beginObject().

Parameters
clazzObject class descriptor.
objectUnserialized object.

Implemented in XOMUnserializer.

Referenced by from_class< T >::unserialize().

◆ flush()

virtual void flush ( void  )
pure virtual

Implemented in XOMUnserializer.

◆ nextItem()

bool nextItem ( void  )
pure virtual

Afgter getting a value of a compound object, a call to this function must be performed.

This function call is always preceded by a call to beginCompound() and will not call anymore after a call to endCompound().

This call is followed by calls to other unserialization function in order to unserialize the value itself.

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize(), and DataSerializer< Vector< T, M >, T >::unserialize().

◆ onEnum()

int onEnum ( const rtti::Type clazz)
pure virtual

Called when a value of type enumerate has to be unserialized.

Parameters
clazzEnumerated type.
Returns
Enumerated value.

Implemented in XOMUnserializer.

Referenced by Enum< T >::unserialize(), and from_enum< T >::unserialize().

◆ onPointer()

void onPointer ( const rtti::Type clazz,
void **  object 
)
pure virtual

This function is called to unserialize a pointer to an object.

Parameters
clazzClass of the pointed object.
objectPointed object to unserialize.

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize().

◆ onValue() [1/17]

void onValue ( bool v)
pure virtual

Called to unserialize a value of type boolean.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

Referenced by elm::serial2::__unserialize(), from_type< T >::unserialize(), IntType< T >::unserialize(), FloatType< T >::unserialize(), BoolType::unserialize(), StringType::unserialize(), and CStringType::unserialize().

◆ onValue() [2/17]

virtual void onValue ( char &  v)
pure virtual

Implemented in XOMUnserializer.

◆ onValue() [3/17]

void onValue ( CString v)
pure virtual

Called to unserialize a value of type C string.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [4/17]

void onValue ( double &  v)
pure virtual

Called to unserialize a value of type double-precision floating point.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [5/17]

void onValue ( float &  v)
pure virtual

Called to unserialize a value of type single-precision floating point.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [6/17]

void onValue ( long double &  v)
pure virtual

Called to unserialize a value of type quadruple-precision floating point.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [7/17]

virtual void onValue ( signed char &  v)
pure virtual

Implemented in XOMUnserializer.

◆ onValue() [8/17]

void onValue ( signed int &  v)
pure virtual

Called to unserialize a value of type signed integer.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [9/17]

void onValue ( signed long &  v)
pure virtual

Called to unserialize a value of type signed long integer.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [10/17]

void onValue ( signed long long &  v)
pure virtual

Called to unserialize a value of type signed long long integer.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [11/17]

void onValue ( signed short &  v)
pure virtual

Called to unserialize a value of type signed short integer.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [12/17]

void onValue ( String v)
pure virtual

Called to unserialize a value of type ELM string.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [13/17]

void onValue ( unsigned char &  v)
pure virtual

Called to unserialize a value of type unsigned byte.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [14/17]

void onValue ( unsigned int &  v)
pure virtual

Called to unserialize a value of type unsigned integer.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [15/17]

void onValue ( unsigned long &  v)
pure virtual

Called to unserialize a value of type unsigned long integer.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.

◆ onValue() [16/17]

void onValue ( unsigned long long &  v)
pure virtual

Called to unserialize a value of type unsigned long long integer.

Parameters
vValue to serialize.

Implemented in XOMUnserializer.

◆ onValue() [17/17]

void onValue ( unsigned short &  v)
pure virtual

Called to unserialize a value of type unsigned short integer.

Parameters
vReference to unserialize in.

Implemented in XOMUnserializer.


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