Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ISerializable Class Referenceabstract

An interface for serializable objects. More...

#include <Serialization.h>

Inheritance diagram for ISerializable:

Public Member Functions

virtual ~ISerializable ()
 
virtual size_t GetSerializedLength () const =0
 Return the length of the serialized form of this object. More...
 
virtual u8Serialize (u8 *buffer) const =0
 Serialize the object into the passed buffer. More...
 
virtual const u8Deserialize (const u8 *buffer, const u8 *end)=0
 Deserialize the object (i.e. More...
 

Detailed Description

An interface for serializable objects.

For a serializable object to be usable as a network message field, it must have a constructor without arguments.

Constructor & Destructor Documentation

◆ ~ISerializable()

virtual ISerializable::~ISerializable ( )
inlinevirtual

Member Function Documentation

◆ Deserialize()

virtual const u8 * ISerializable::Deserialize ( const u8 buffer,
const u8 end 
)
pure virtual

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.

Parameters
bufferA pointer pointing to the start of the serialized data.
endA pointer to the end of the message.
Returns
a pointer to the location in the buffer right after the serialized object, or NULL if there was a data format error

Implemented in CNetMessage, CSimulationMessage, and CGameSetupMessage.

◆ GetSerializedLength()

virtual size_t ISerializable::GetSerializedLength ( ) const
pure virtual

Return the length of the serialized form of this object.

Implemented in CNetMessage, CSimulationMessage, and CGameSetupMessage.

◆ Serialize()

virtual u8 * ISerializable::Serialize ( u8 buffer) const
pure virtual

Serialize the object into the passed buffer.

Returns
a pointer to the location in the buffer right after the serialized object

Implemented in CNetMessage, CSimulationMessage, and CGameSetupMessage.


The documentation for this class was generated from the following file: