Serialization interface class. More...
#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. More... | |
virtual void | requires (PxBase &, PxProcessPxBaseCallback &) const =0 |
Adds required objects to the collection. More... | |
virtual bool | isSubordinate () const =0 |
Whether the object is subordinate. More... | |
Functionality needed for Binary Serialization only | |
virtual void | exportExtraData (PxBase &, PxSerializationContext &) const =0 |
Exports object's extra data to stream. More... | |
virtual void | exportData (PxBase &, PxSerializationContext &) const =0 |
Exports object's data to stream. More... | |
virtual void | registerReferences (PxBase &obj, PxSerializationContext &s) const =0 |
Register references that the object maintains to other objects. More... | |
virtual size_t | getClassSize () const =0 |
Returns size needed to create the class instance. More... | |
virtual PxBase * | createObject (PxU8 *&address, PxDeserializationContext &context) const =0 |
Create object at a given address, resolve references and import extra data. More... | |
Serialization interface class.
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).
|
inlinevirtual |
|
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 >.
|
pure virtual |
Exports object's data to stream.
Implemented in PxSerializerDefaultAdapter< T >.
|
pure virtual |
Exports object's extra data to stream.
Implemented in PxSerializerDefaultAdapter< T >.
|
pure virtual |
Returns size needed to create the class instance.
Implemented in PxSerializerDefaultAdapter< T >.
|
pure virtual |
Returns string name of dynamic type.
Implemented in PxSerializerDefaultAdapter< T >.
|
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 >.
|
pure virtual |
Register references that the object maintains to other objects.
Implemented in PxSerializerDefaultAdapter< T >.
|
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 >.