Celartem::Serializable Class Reference

#include <cel_serializable.h>

Inheritance diagram for Celartem::Serializable:

Inheritance graph
[legend]

List of all members.

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


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.

Definition at line 92 of file cel_serializable.h.


Member Function Documentation

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:
inStream The stream to which the instance information is written.
inLevel The serialization level. In the top level, this value is 0.
inEndian The endianness used to write the data.

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

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::DataArray< T >, and Celartem::SerializableData< 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().


The documentation for this class was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:20 2008.