31 #ifndef PX_SERIALIZER_H 32 #define PX_SERIALIZER_H 76 virtual const char* getConcreteTypeName()
const = 0;
96 virtual bool isSubordinate()
const = 0;
127 virtual size_t getClassSize()
const = 0;
167 T& t =
static_cast<T&
>(obj);
168 t.requiresObjects(c);
187 T& t =
static_cast<T&
>(obj);
188 t.exportExtraData(s);
198 T& t =
static_cast<T&
>(obj);
205 RequiresCallback& operator=(RequiresCallback&) {
PX_ASSERT(0);
return *
this; }
206 void process(physx::PxBase& base)
213 RequiresCallback callback(s);
214 t.requiresObjects(callback);
226 return T::createObject(address, context);
242 #define PX_NEW_SERIALIZER_ADAPTER(x) \ 243 *new( PxGetFoundation().getAllocatorCallback().allocate(sizeof(PxSerializerDefaultAdapter<x>), \ 244 "PxSerializerDefaultAdapter", __FILE__, __LINE__ )) PxSerializerDefaultAdapter<x>(#x) 249 #define PX_DELETE_SERIALIZER_ADAPTER(x) \ 250 { 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:185
virtual void exportData(PxBase &obj, PxSerializationContext &s) const
Exports object's data to stream.
Definition: PxSerializer.h:191
virtual void requiresObjects(PxBase &obj, PxProcessPxBaseCallback &c) const
Adds required objects to the collection.
Definition: PxSerializer.h:165
Serialization interface class.
Definition: PxSerializer.h:61
uint8_t PxU8
Definition: PxSimpleTypes.h:75
virtual bool isSubordinate() const
Whether the object is subordinate.
Definition: PxSerializer.h:171
virtual PxBase * createObject(PxU8 *&address, PxDeserializationContext &context) const
Create object at a given address, resolve references and import extra data.
Definition: PxSerializer.h:224
virtual ~PxSerializer()
Definition: PxSerializer.h:140
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxSerializer.h:160
Binary deserialization context class.
Definition: PxSerialFramework.h:174
virtual size_t getClassSize() const
Returns size needed to create the class instance.
Definition: PxSerializer.h:219
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:61
PxSerializerDefaultAdapter(const char *name)
Definition: PxSerializer.h:158
virtual void registerReferences(PxBase &obj, PxSerializationContext &s) const
Register references that the object maintains to other objects.
Definition: PxSerializer.h:196
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:234
Default PxSerializer implementation.
Definition: PxSerializer.h:148