![]() |
Pixel Dust Game Engine
v0.9.5
|
Represents an object which can be serialized. More...
Public Member Functions | |
virtual uint32 | getSerializedSize (ISerializer *serializer) const =0 |
Get number of bytes needed to hold serialized state. | |
virtual void | serialize (ISerializer *serializer) const =0 |
Write self out to a serializer. | |
virtual void | deserialize (IDeserializer *deserializer)=0 |
Read self from a deserializer. | |
virtual uint32 | getMyClassTag () const =0 |
Get a tag value that uniquely represents this class. | |
ISerializable () | |
virtual | ~ISerializable () |
![]() | |
virtual void | addRef () const throw () |
virtual void | release () const throw () |
Represents an object which can be serialized.
Subclasses must implement all the methods derive from the serializable template like this:
#define CLASS_TAG_MY_SERIALIZABLECLASS 500
class MySerializableClass : public Serializable<MySerializableClass> { SERIALIZABLE_TAG( CLASS_TAG_MYSERIALIZABLECLASS ) ... };
If your class derives indirectly from Serializable, then you will need to also add SERIALIZABLE_CREATOR() like this:
class MyDerivedSerializableClass : public MySerializableClass { SERIALIZABLE_TAG( CLASS_TAG_MYDERIVEDCLASS ) ... SERIALIZABLE_CREATOR( MyDerivedSerializableClass ) };
|
inline |
|
inlinevirtual |
|
pure virtual |
Read self from a deserializer.
buffer | pointer to a deserializer |
Implemented in ISpriteDrawHelper, ISpriteCollideHelper, and IAnimationHelper.
|
pure virtual |
Get a tag value that uniquely represents this class.
This value is used to determine which class factory to call to instantiate an object during deserialization, so this value cannot change during the lifetime of the serialized stream Use SERIALIZABLE_TAG() to declare this in your classes
|
pure virtual |
Get number of bytes needed to hold serialized state.
Implemented in ISpriteDrawHelper, ISpriteCollideHelper, and IAnimationHelper.
|
pure virtual |
Write self out to a serializer.
serializer | pointer to a serializer |
Implemented in ISpriteDrawHelper, ISpriteCollideHelper, and IAnimationHelper.