Public Member Functions | List of all members
Celartem::Serializable Class Referenceabstract

#include <cel_serializable.h>

Inheritance diagram for Celartem::Serializable:
Inheritance graph
[legend]

Public Member Functions

virtual void serialize (Stream *inStream, size_t inLevel=0, Endian inEndian=endianBig)=0
 
virtual AutoPtr< Serializableduplicate () const =0
 
const GuidgetClassId () const
 
String getClassName () const
 
- Public Member Functions inherited from Celartem::Referable
 Referable ()
 
void addRef () const
 
void releaseRef () const
 
size_t getReferenceCount () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

Serializable class is an interface that provides serialization and de-serialization feature.
To implement the serialization feature of your own class, all you have to do is to implement serialize, deserialize and duplicate methods. The implementation of serialize and deserialize is straightforward; but
the deserialize, method for the de-serialization is little bit more complicated, firstly you should implement a static method named deserialize that has the prototype shown below:

AutoPtr<Serializable> deserialize(
Stream *inStream, size_t inLevel, Endian inEndian);

And then, you should register the class runtimely by using either of REGISTER_SERIALIZABLECLASS or REGISTER_SERIALIZABLECLASS2 macro.

Member Function Documentation

virtual AutoPtr<Serializable> Celartem::Serializable::duplicate ( ) const
pure virtual

This method must be implemented by derived class. This method duplicates the instance.

Returns
Pointer to the newly created Serializable instance.

Implemented in Celartem::SerializableData< T >, and Celartem::DataArray< T >.

const Guid& Celartem::Serializable::getClassId ( ) const

This method returns class Id (GUID) of the instance.

Returns
Reference to the class Id of the instance.
String Celartem::Serializable::getClassName ( ) const

This method returns class name of the instance.

Returns
The class name.

Referenced by Celartem::DataStore::get().

virtual void Celartem::Serializable::serialize ( Stream inStream,
size_t  inLevel = 0,
Endian  inEndian = endianBig 
)
pure virtual

This method must be implemented by derived class. To implement the serialization feature of your own class, you should implement this method. All you have to do in the method is to write out the information of the instance to the specified stream that is needed when reproduce the instance in the memory.

Parameters
inStreamThe stream to which the instance information is written.
inLevelThe serialization level. In the top level, this value is 0.
inEndianThe endianness used to write the data.

Implemented in Celartem::SerializableData< T >, and Celartem::DataArray< T >.


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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo