|virtual void||serialize (Stream *inStream, size_t inLevel=0, Endian inEndian=endianBig)=0|
|virtual AutoPtr< Serializable >||duplicate () const =0|
|const Guid &||getClassId () const|
|String||getClassName () const|
|Public Member Functions inherited from Celartem::Referable|
|void||addRef () const|
|void||releaseRef () const|
|size_t||getReferenceCount () const|
|Static Public Member Functions inherited from Celartem::Referable|
|static void||dumpDbgAllRefCount ()|
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:
|const Guid& Celartem::Serializable::getClassId||(||)||const|
This method returns class Id (GUID) of the instance.
This method returns class name of the instance.
Referenced by Celartem::DataStore::get().
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.
|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.|