#include <cel_serializable.h>

Public Member Functions | |
| virtual void | serialize (Stream *inStream, size_t inLevel, Endian inEndian) |
| virtual AutoPtr< Serializable > | duplicate () const |
| T & | getValue () |
| const T & | getValue () const |
Static Public Member Functions | |
| static Serializable * | create (const T &t) |
| static AutoPtr< Serializable > | deserialize (Stream *inStream, size_t inLevel, Endian inEndian) |
This class template is to add serialize/deserialize feature to existing non-serializable classes.
With this class, all you have to do is to implement following two methods:
void serialize(Stream *inStream, size_t inLevel) const; void deserialize(Stream *inStream, size_t inLevel);
They should be normal methods; NOT virtual methods.
| static Serializable* Celartem::SerializableData< T >::create | ( | const T & | t | ) | [inline, static] |
This method is a factory for the Serializable instance from the specified instance of T .
| t | The instance to store. |
| static AutoPtr<Serializable> Celartem::SerializableData< T >::deserialize | ( | Stream * | inStream, | |
| size_t | inLevel, | |||
| Endian | inEndian | |||
| ) | [inline, static] |
This method only calles the deserialize method of T.
| inStream | The stream from which the instance information is read. | |
| inLevel | The de-serialization level. In the top level, this value is 0. | |
| inEndian | The endianness used to read the data. |
| virtual AutoPtr<Serializable> Celartem::SerializableData< T >::duplicate | ( | ) | const [inline, virtual] |
To deal with duplicate method, the data type used with SerializableData template should be shared without any risk.
Implements Celartem::Serializable.
| const T& Celartem::SerializableData< T >::getValue | ( | ) | const [inline] |
This method returns a const reference to the T instance.
| T& Celartem::SerializableData< T >::getValue | ( | ) | [inline] |
This method returns a reference to the T instance.
| virtual void Celartem::SerializableData< T >::serialize | ( | Stream * | inStream, | |
| size_t | inLevel, | |||
| Endian | inEndian | |||
| ) | [inline, virtual] |
This method only calls the serialize method of T .
| 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. |
Implements Celartem::Serializable.