Pyrogenesis
13997
|
An interface for serializable objects. More...
#include <Serialization.h>
Public Member Functions | |
virtual | ~ISerializable () |
virtual size_t | GetSerializedLength () const =0 |
Return the length of the serialized form of this object. More... | |
virtual u8 * | Serialize (u8 *buffer) const =0 |
Serialize the object into the passed buffer. More... | |
virtual const u8 * | Deserialize (const u8 *buffer, const u8 *end)=0 |
Deserialize the object (i.e. More... | |
An interface for serializable objects.
For a serializable object to be usable as a network message field, it must have a constructor without arguments.
Definition at line 75 of file Serialization.h.
|
inlinevirtual |
Definition at line 78 of file Serialization.h.
Deserialize the object (i.e.
read in data from the buffer and initialize the object's fields). Note that it is up to the deserializer to detect errors in data format.
buffer | A pointer pointing to the start of the serialized data. |
end | A pointer to the end of the message. |
Implemented in CGameSetupMessage, CSimulationMessage, and CNetMessage.
|
pure virtual |
Return the length of the serialized form of this object.
Implemented in CGameSetupMessage, CSimulationMessage, and CNetMessage.
Serialize the object into the passed buffer.
Implemented in CGameSetupMessage, CSimulationMessage, and CNetMessage.