PxRepXSerializer Class Referenceabstract

Serializer interface for RepX (Xml) serialization. More...

#include <PxRepXSerializer.h>

Public Member Functions

virtual const char * getTypeName ()=0
 The type this Serializer is meant to operate on. More...
 
virtual void objectToFile (const PxRepXObject &inLiveObject, PxCollection *inCollection, XmlWriter &inWriter, MemoryBuffer &inTempBuffer, PxRepXInstantiationArgs &inArgs)=0
 Convert from a RepX object to a key-value pair hierarchy. More...
 
virtual PxRepXObject fileToObject (XmlReader &inReader, XmlMemoryAllocator &inAllocator, PxRepXInstantiationArgs &inArgs, PxCollection *inCollection)=0
 Convert from a descriptor to a live object. Must be an object of this Serializer type. More...
 

Protected Member Functions

virtual ~PxRepXSerializer ()
 

Detailed Description

Serializer interface for RepX (Xml) serialization.

In order to serialize a class to RepX both a PxSerializer and a PxRepXSerializer implementation are needed.

A repx Serializer provides the ability to capture a live object to a descriptor or static state and the ability to write that state out to a file. Objects allocated by the Serializer using the allocator are freed when the collection itself is freed. SnRepXCoreSerializers.cpp implements a set of Serializers for the core PhysX types.

Note
Implementing a PxRepXSerializer is currently not practical without including the internal PhysXExtension header "SnRepXSerializerImpl.h".
See also
PxSerializer, PX_NEW_REPX_SERIALIZER, PxSerializationRegistry::registerRepXSerializer

Constructor & Destructor Documentation

◆ ~PxRepXSerializer()

virtual PxRepXSerializer::~PxRepXSerializer ( )
inlineprotectedvirtual

Member Function Documentation

◆ fileToObject()

virtual PxRepXObject PxRepXSerializer::fileToObject ( XmlReader &  inReader,
XmlMemoryAllocator &  inAllocator,
PxRepXInstantiationArgs inArgs,
PxCollection inCollection 
)
pure virtual

Convert from a descriptor to a live object. Must be an object of this Serializer type.

Parameters
[in]inReaderThe inverse of the writer, a key-value pair database.
[in]inAllocatorAn allocator to use for temporary allocations. These will be freed after instantiation completes.
[in]inArgsThe arguments used in create resources and objects.
[in]inCollectionThe collection used to find references.
Returns
The new live object. It can be an invalid object if the instantiation cannot take place.

◆ getTypeName()

virtual const char* PxRepXSerializer::getTypeName ( )
pure virtual

The type this Serializer is meant to operate on.

See also
PxRepXObject::typeName

◆ objectToFile()

virtual void PxRepXSerializer::objectToFile ( const PxRepXObject inLiveObject,
PxCollection inCollection,
XmlWriter &  inWriter,
MemoryBuffer &  inTempBuffer,
PxRepXInstantiationArgs inArgs 
)
pure virtual

Convert from a RepX object to a key-value pair hierarchy.

Parameters
[in]inLiveObjectThe object to convert to the passed in descriptor.
[in]inCollectionThe collection to use to find ids of references of this object.
[in]inWriterInterface to write data to.
[in]inTempBufferused to for temporary allocations.
[in]inArgsThe arguments used in create resources and objects.

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