PxSerializer Class Reference
[Extensions]

Serialization interface class. More...

#include <PxSerializer.h>

Inheritance diagram for PxSerializer:

Inheritance graph
PxSerializerDefaultAdapter\< T \>
[legend]

List of all members.

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 PxBasecreateObject (PxU8 *&address, PxDeserializationContext &context) const =0
 Create object at a given address, resolve references and import extra data.


Detailed Description

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).

See also:
PxSerializerDefaultAdapter, PX_NEW_SERIALIZER_ADAPTER, PxSerializationRegistry::registerSerializer

Constructor & Destructor Documentation

virtual PxSerializer::~PxSerializer (  )  [inline, virtual]


Member Function Documentation

virtual PxBase* PxSerializer::createObject ( PxU8 *&  address,
PxDeserializationContext context 
) const [pure virtual]

Create object at a given address, resolve references and import extra data.

Parameters:
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.
Returns:
Created PxBase pointer (needs to be identical to address before increment).

Implemented in PxSerializerDefaultAdapter< T >.

virtual void PxSerializer::exportData ( PxBase ,
PxSerializationContext  
) const [pure virtual]

Exports object's data to stream.

Implemented in PxSerializerDefaultAdapter< T >.

virtual void PxSerializer::exportExtraData ( PxBase ,
PxSerializationContext  
) const [pure virtual]

Exports object's extra data to stream.

Implemented in PxSerializerDefaultAdapter< T >.

virtual size_t PxSerializer::getClassSize (  )  const [pure virtual]

Returns size needed to create the class instance.

Returns:
sizeof class instance.

Implemented in PxSerializerDefaultAdapter< T >.

virtual const char* PxSerializer::getConcreteTypeName (  )  const [pure virtual]

Returns string name of dynamic type.

Returns:
Class name of most derived type of this object.

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.

Returns:
Whether the class is subordinate
See also:
PxSerialization::isSerializable

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.

See also:
PxCollection, PxSerialization::complete

Implemented in PxSerializerDefaultAdapter< T >.


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


Copyright © 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com