14 #ifndef PX_SERIALIZER_H
15 #define PX_SERIALIZER_H
59 virtual const char* getConcreteTypeName()
const = 0;
79 virtual bool isSubordinate()
const = 0;
110 virtual size_t getClassSize()
const = 0;
143 virtual const char* getConcreteTypeName()
const
150 T& t =
static_cast<T&
>(obj);
154 virtual bool isSubordinate()
const
170 T& t =
static_cast<T&
>(obj);
171 t.exportExtraData(s);
181 T& t =
static_cast<T&
>(obj);
188 RequiresCallback& operator=(RequiresCallback&) {
PX_ASSERT(0);
return *
this; }
189 void process(physx::PxBase& base)
196 RequiresCallback callback(s);
197 t.requires(callback);
202 virtual size_t getClassSize()
const
209 return T::createObject(address, context);
225 #define PX_NEW_SERIALIZER_ADAPTER(x) \
226 *new( PxGetFoundation().getAllocatorCallback().allocate(sizeof(PxSerializerDefaultAdapter<x>), \
227 "PxSerializerDefaultAdapter", __FILE__, __LINE__ )) PxSerializerDefaultAdapter<x>(#x)
232 #define PX_DELETE_SERIALIZER_ADAPTER(x) \
233 { PxSerializer* s = x; if (s) { s->~PxSerializer(); PxGetFoundation().getAllocatorCallback().deallocate(s); } }