31 #ifndef PX_SERIALIZER_H 32 #define PX_SERIALIZER_H 79 virtual const char* getConcreteTypeName()
const = 0;
99 virtual bool isSubordinate()
const = 0;
130 virtual size_t getClassSize()
const = 0;
170 T& t =
static_cast<T&
>(obj);
171 t.requiresObjects(c);
190 T& t =
static_cast<T&
>(obj);
191 t.exportExtraData(s);
197 T* copy =
reinterpret_cast<T*
>(allocator.
allocate(
sizeof(T),
"TmpAllocExportData", __FILE__, __LINE__));
199 copy->preExportDataReset();
206 T& t =
static_cast<T&
>(obj);
213 RequiresCallback& operator=(RequiresCallback&) {
PX_ASSERT(0);
return *
this; }
214 void process(physx::PxBase& base)
221 RequiresCallback callback(s);
222 t.requiresObjects(callback);
234 return T::createObject(address, context);
250 #define PX_NEW_SERIALIZER_ADAPTER(x) \ 251 *new( PxGetFoundation().getAllocatorCallback().allocate(sizeof(PxSerializerDefaultAdapter<x>), \ 252 "PxSerializerDefaultAdapter", __FILE__, __LINE__ )) PxSerializerDefaultAdapter<x>(#x) 257 #define PX_DELETE_SERIALIZER_ADAPTER(x) \ 258 { PxSerializer* s = x; if (s) { s->~PxSerializer(); PxGetFoundation().getAllocatorCallback().deallocate(s); } } Definition: GuContactBuffer.h:37
#define PX_SERIAL_REF_KIND_PXBASE
Reference kind value for PxBase objects.
Definition: PxSerialFramework.h:68
virtual void exportExtraData(PxBase &obj, PxSerializationContext &s) const
Exports object's extra data to stream.
Definition: PxSerializer.h:188
PX_FORCE_INLINE void * PxMemCopy(void *dest, const void *src, PxU32 count)
Copies the bytes of one memory block to another. The memory blocks must not overlap.
Definition: PxMemory.h:84
virtual void exportData(PxBase &obj, PxSerializationContext &s) const
Exports object's data to stream.
Definition: PxSerializer.h:194
virtual void requiresObjects(PxBase &obj, PxProcessPxBaseCallback &c) const
Adds required objects to the collection.
Definition: PxSerializer.h:168
Serialization interface class.
Definition: PxSerializer.h:64
virtual void deallocate(void *ptr)=0
Frees memory previously allocated by allocate().
virtual void * allocate(size_t size, const char *typeName, const char *filename, int line)=0
Allocates size bytes of memory, which must be 16-byte aligned.
uint8_t PxU8
Definition: PxSimpleTypes.h:75
virtual bool isSubordinate() const
Whether the object is subordinate.
Definition: PxSerializer.h:174
virtual PxBase * createObject(PxU8 *&address, PxDeserializationContext &context) const
Create object at a given address, resolve references and import extra data.
Definition: PxSerializer.h:232
virtual ~PxSerializer()
Definition: PxSerializer.h:143
Abstract base class for an application defined memory allocator that can be used by the Nv library...
Definition: PxAllocatorCallback.h:52
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxSerializer.h:163
PX_C_EXPORT PX_FOUNDATION_API physx::PxFoundation &PX_CALL_CONV PxGetFoundation()
Retrieves the Foundation SDK after it has been created.
Binary deserialization context class.
Definition: PxSerialFramework.h:174
virtual size_t getClassSize() const
Returns size needed to create the class instance.
Definition: PxSerializer.h:227
virtual void registerReference(PxBase &base, PxU32 kind, size_t reference)=0
Registers a reference value corresponding to a PxBase object.
#define PX_ASSERT(exp)
Definition: PxAssert.h:59
PxSerializerDefaultAdapter(const char *name)
Definition: PxSerializer.h:161
virtual void registerReferences(PxBase &obj, PxSerializationContext &s) const
Register references that the object maintains to other objects.
Definition: PxSerializer.h:204
virtual void writeData(const void *data, PxU32 size)=0
Serializes object data and object extra data.
Base class for objects that can be members of a PxCollection.
Definition: PxBase.h:73
Binary serialization context class.
Definition: PxSerialFramework.h:99
Callback class used to process PxBase objects.
Definition: PxSerialFramework.h:81
const char * mTypeName
Definition: PxSerializer.h:242
Default PxSerializer implementation.
Definition: PxSerializer.h:151