PxDeserializationContext Class Referenceabstract

Binary deserialization context class. More...

#include <PxSerialFramework.h>

Public Member Functions

virtual PxBaseresolveReference (PxU32 kind, size_t reference) const =0
 Retrieves a pointer to a deserialized PxBase object given a corresponding deserialized reference value. More...
 
template<typename T >
void translatePxBase (T *&base)
 Helper function to update PxBase pointer on deserialization. More...
 
PX_INLINE void readName (const char *&name)
 Helper function to read a name from the extra data during deserialization. More...
 
template<typename T >
PX_INLINE T * readExtraData (PxU32 count=1)
 Function to read extra data during deserialization. More...
 
template<typename T , PxU32 alignment>
PX_INLINE T * readExtraData (PxU32 count=1)
 Function to read extra data during deserialization optionally aligning the extra data stream before reading. More...
 
PX_INLINE void alignExtraData (PxU32 alignment=PX_SERIAL_ALIGN)
 Function to align the extra data stream to a power of 2 alignment. More...
 
virtual PxU32 getPhysXVersion () const =0
 Function to return the PX_PHYSX_VERSION value with which the data was originally serialized. More...
 

Protected Member Functions

 PxDeserializationContext ()
 
virtual ~PxDeserializationContext ()
 

Protected Attributes

PxU8 * mExtraDataAddress
 

Detailed Description

Binary deserialization context class.

This class is used to resolve references and access extra data during deserialization. It is mainly used by the serialization framework. Except for custom serializable types, users should not have to worry about it.

See also
PxSerializationContext

Constructor & Destructor Documentation

◆ PxDeserializationContext()

PxDeserializationContext::PxDeserializationContext ( )
inlineprotected

◆ ~PxDeserializationContext()

virtual PxDeserializationContext::~PxDeserializationContext ( )
inlineprotectedvirtual

Member Function Documentation

◆ alignExtraData()

PX_INLINE void PxDeserializationContext::alignExtraData ( PxU32  alignment = PX_SERIAL_ALIGN)
inline

Function to align the extra data stream to a power of 2 alignment.

This function is assumed to be called within the implementation of PxSerializer::createObject.

See also
PxSerializationContext::alignData, PxSerializer::createObject

◆ getPhysXVersion()

virtual PxU32 PxDeserializationContext::getPhysXVersion ( ) const
pure virtual

Function to return the PX_PHYSX_VERSION value with which the data was originally serialized.

◆ readExtraData() [1/2]

template<typename T >
PX_INLINE T* PxDeserializationContext::readExtraData ( PxU32  count = 1)
inline

Function to read extra data during deserialization.

This function is assumed to be called within the implementation of PxSerializer::createObject.

See also
PxSerializationContext::writeData, PxSerializer::createObject

◆ readExtraData() [2/2]

template<typename T , PxU32 alignment>
PX_INLINE T* PxDeserializationContext::readExtraData ( PxU32  count = 1)
inline

Function to read extra data during deserialization optionally aligning the extra data stream before reading.

This function is assumed to be called within the implementation of PxSerializer::createObject.

See also
PxSerializationContext::writeData, PxDeserializationContext::alignExtraData, PxSerializer::createObject

◆ readName()

PX_INLINE void PxDeserializationContext::readName ( const char *&  name)
inline

Helper function to read a name from the extra data during deserialization.

This function is assumed to be called within the implementation of PxSerializer::createObject.

See also
PxSerializationContext::writeName

◆ resolveReference()

virtual PxBase* PxDeserializationContext::resolveReference ( PxU32  kind,
size_t  reference 
) const
pure virtual

Retrieves a pointer to a deserialized PxBase object given a corresponding deserialized reference value.

This method is assumed to be called in the implementation of PxSerializer::createObject in order to update reference values on deserialization.

To update a PxBase reference the corresponding deserialized pointer value needs to be provided in order to retrieve the location of the corresponding deserialized PxBase object. (PxDeserializationContext::translatePxBase simplifies this common case).

For other kinds of references the reverence values need to be updated by deduction given the corresponding PxBase instance.

Parameters
[in]kindWhat kind of reference this is (PX_SERIAL_REF_KIND_PXBASE, PX_SERIAL_REF_KIND_MATERIAL_IDX or custom kind)
[in]referenceDeserialized reference value
Returns
PxBase object associated with the reference value
See also
PxSerializationContext::registerReference, PX_SERIAL_REF_KIND_PXBASE, PX_SERIAL_REF_KIND_MATERIAL_IDX, translatePxBase

◆ translatePxBase()

template<typename T >
void PxDeserializationContext::translatePxBase ( T *&  base)
inline

Helper function to update PxBase pointer on deserialization.

See also
resolveReference, PX_SERIAL_REF_KIND_PXBASE

References PX_SERIAL_REF_KIND_PXBASE.

Member Data Documentation

◆ mExtraDataAddress

PxU8* PxDeserializationContext::mExtraDataAddress
protected

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