#include <PxSerializer.h>
Public Member Functions | |
virtual | ~PxSerializer () |
Basics needed for Binary- and RepX-Serialization | |
virtual const char * | getConcreteTypeName () const =0 |
Returns string name of dynamic type. | |
virtual void | requiresObjects (PxBase &, PxProcessPxBaseCallback &) const =0 |
Adds required objects to the collection. | |
virtual bool | isSubordinate () const =0 |
Whether the object is subordinate. | |
Functionality needed for Binary Serialization only | |
virtual void | exportExtraData (PxBase &, PxSerializationContext &) const =0 |
Exports object's extra data to stream. | |
virtual void | exportData (PxBase &, PxSerializationContext &) const =0 |
Exports object's data to stream. | |
virtual void | registerReferences (PxBase &obj, PxSerializationContext &s) const =0 |
Register references that the object maintains to other objects. | |
virtual size_t | getClassSize () const =0 |
Returns size needed to create the class instance. | |
virtual PxBase * | createObject (PxU8 *&address, PxDeserializationContext &context) const =0 |
Create object at a given address, resolve references and import extra data. |
PxSerializer is used to extend serializable PxBase classes with serialization functionality. The interface is structured such that per-class adapter instances can be used as opposed to per-object adapter instances, avoiding per object allocations. Hence the methods take a reference to PxBase as a parameter.
The PxSerializer interface needs to be implemented for binary or RepX serialization to work on custom types. If only RepX serialization is needed, some methods can be left empty, as they are only needed for binary serialization.
A default implementation is available as a template adapter (PxSerializerDefaultAdapter).
virtual PxSerializer::~PxSerializer | ( | ) | [inline, virtual] |
virtual PxBase* PxSerializer::createObject | ( | PxU8 *& | address, | |
PxDeserializationContext & | context | |||
) | const [pure virtual] |
Create object at a given address, resolve references and import extra data.
address | Location at which object is created. Address is increased by the size of the created object. | |
context | Context for reading external data and resolving references. |
Implemented in PxSerializerDefaultAdapter< T >.
virtual void PxSerializer::exportData | ( | PxBase & | , | |
PxSerializationContext & | ||||
) | const [pure virtual] |
virtual void PxSerializer::exportExtraData | ( | PxBase & | , | |
PxSerializationContext & | ||||
) | const [pure virtual] |
virtual size_t PxSerializer::getClassSize | ( | ) | const [pure virtual] |
Returns size needed to create the class instance.
Implemented in PxSerializerDefaultAdapter< T >.
virtual const char* PxSerializer::getConcreteTypeName | ( | ) | const [pure virtual] |
Returns string name of dynamic type.
Implemented in PxSerializerDefaultAdapter< T >.
virtual bool PxSerializer::isSubordinate | ( | ) | const [pure virtual] |
Whether the object is subordinate.
A class is subordinate, if it can only be instantiated in the context of another class.
Implemented in PxSerializerDefaultAdapter< T >.
virtual void PxSerializer::registerReferences | ( | PxBase & | obj, | |
PxSerializationContext & | s | |||
) | const [pure virtual] |
Register references that the object maintains to other objects.
Implemented in PxSerializerDefaultAdapter< T >.
virtual void PxSerializer::requiresObjects | ( | PxBase & | , | |
PxProcessPxBaseCallback & | ||||
) | const [pure virtual] |
Adds required objects to the collection.
This method does not add the required objects recursively, e.g. objects required by required objects.
Implemented in PxSerializerDefaultAdapter< T >.