29#ifndef SN_REPX_SERIALIZER_IMPL_H
30#define SN_REPX_SERIALIZER_IMPL_H
32#include "foundation/PxUserAllocated.h"
33#include "SnXmlVisitorWriter.h"
34#include "SnXmlVisitorReader.h"
44 template<
typename TLiveType>
55 : mAllocator( inAllocator )
63 const TLiveType* theObj =
reinterpret_cast<const TLiveType*
>( inLiveObject.
serializable );
64 objectToFileImpl( theObj, inCollection, inWriter, inTempBuffer, inArgs );
69 TLiveType* theObj( allocateObject( inArgs ) );
71 if(fileToObjectImpl( theObj, inReader, inAllocator, inArgs, inCollection ))
78 writeAllProperties( inObj, inWriter, inTempBuffer, *inCollection );
81 virtual bool fileToObjectImpl( TLiveType* inObj, XmlReader& inReader, XmlMemoryAllocator& inAllocator, PxRepXInstantiationArgs& inArgs, PxCollection* inCollection )
83 return readAllProperties( inArgs, inReader, inObj, inAllocator, *inCollection );
86 virtual TLiveType* allocateObject( PxRepXInstantiationArgs& inArgs ) = 0;
Definition SnXmlMemoryPoolStreams.h:165
Abstract base class for an application defined memory allocator that can be used by the Nv library.
Definition PxAllocatorCallback.h:53
Collection class for serialization.
Definition PxCollection.h:104
Serializer interface for RepX (Xml) serialization.
Definition PxRepXSerializer.h:67
Definition PxUserAllocated.h:43
Definition SnXmlSimpleXmlWriter.h:37
Definition SnXmlMemoryAllocator.h:37
Definition SnXmlReader.h:42
PX_INLINE physx::PxRepXObject PxCreateRepXObject(const TDataType *inType, const physx::PxSerialObjectId inId)
Inline helper template function to create PxRepXObject from TDataType type supporting PxTypeInfo<TDat...
Definition PxRepXSerializer.h:111
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Arguments required to instantiate a serializable object from RepX.
Definition PxRepXSimpleType.h:83
Helper class containing the mapping of id to object, and type name.
Definition PxRepXSimpleType.h:50
const void * serializable
Pointer to the serializable this was created from.
Definition PxRepXSimpleType.h:60
a structure containing per-type information for types inheriting from PxBase
Definition PxTypeInfo.h:113
Definition SnRepXSerializerImpl.h:46
virtual const char * getTypeName()
The type this Serializer is meant to operate on.
Definition SnRepXSerializerImpl.h:59
virtual PxRepXObject fileToObject(XmlReader &inReader, XmlMemoryAllocator &inAllocator, PxRepXInstantiationArgs &inArgs, PxCollection *inCollection)
Convert from a descriptor to a live object. Must be an object of this Serializer type.
Definition SnRepXSerializerImpl.h:67
virtual void objectToFile(const PxRepXObject &inLiveObject, PxCollection *inCollection, XmlWriter &inWriter, MemoryBuffer &inTempBuffer, PxRepXInstantiationArgs &inArgs)
Convert from a RepX object to a key-value pair hierarchy.
Definition SnRepXSerializerImpl.h:61