29#ifndef CM_COLLECTION_H
30#define CM_COLLECTION_H
32#include "common/PxCollection.h"
33#include "foundation/PxHashMap.h"
34#include "foundation/PxUserAllocated.h"
35#include "foundation/PxAllocator.h"
43 class HashFn = PxHash<Key>,
44 class Allocator = PxAllocator >
54 void insertUnique(
const Key& k,
const Value& v)
56 PX_PLACEMENT_NEW(MapBase::mBase.insertUnique(k),
EntryData)(k,v);
76 virtual PxU32
getObjects(
PxBase** userBuffer, PxU32 bufferSize, PxU32 startIndex=0)
const;
86 PX_INLINE PxU32 internalGetNbObjects()
const {
return mObjects.size(); }
87 PX_INLINE PxBase* internalGetObject(PxU32 i)
const { PX_ASSERT(i<mObjects.size());
return mObjects.getEntries()[i].first; }
88 PX_INLINE const ObjectToIdMap::Entry* internalGetObjects()
const {
return mObjects.getEntries(); }
91 ObjectToIdMap mObjects;
Definition CmCollection.h:46
Definition CmCollection.h:61
virtual PxU32 getNbObjects() const
Gets number of PxBase objects in this collection.
Definition CmCollection.cpp:155
virtual void addId(PxBase &object, PxSerialObjectId id)
Adds an id to a member PxBase object.
Definition CmCollection.cpp:77
virtual PxSerialObjectId getId(const PxBase &object) const
Gets the PxSerialObjectId name of a PxBase object within the collection.
Definition CmCollection.cpp:183
virtual void remove(PxBase &object)
Removes a PxBase member object from the collection.
Definition CmCollection.cpp:60
virtual bool contains(PxBase &object) const
Returns whether the collection contains a certain PxBase object.
Definition CmCollection.cpp:72
virtual PxU32 getIds(PxSerialObjectId *userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const
Copies member PxSerialObjectId values to a user specified buffer.
Definition CmCollection.cpp:189
virtual void removeId(PxSerialObjectId id)
Removes id from a contained PxBase object.
Definition CmCollection.cpp:91
virtual PxBase * find(PxSerialObjectId ref) const
Looks for a PxBase object given a PxSerialObjectId value.
Definition CmCollection.cpp:103
virtual PxU32 getObjects(PxBase **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const
Copies member PxBase pointers to a user specified buffer.
Definition CmCollection.cpp:166
virtual PxU32 getNbIds() const
Gets number of PxSerialObjectId names in this collection.
Definition CmCollection.cpp:178
virtual void add(PxBase &object, PxSerialObjectId ref)
Adds a PxBase object to the collection.
Definition CmCollection.cpp:34
void release()
Deletes a collection object.
Definition CmCollection.h:82
virtual PxBase & getObject(PxU32 index) const
Gets the PxBase object of this collection given its index.
Definition CmCollection.cpp:160
Base class for objects that can be members of a PxCollection.
Definition PxBase.h:73
Definition PxHashMap.h:101
Collection class for serialization.
Definition PxCollection.h:104
Definition PxHashInternals.h:695
Definition PxBasicTemplates.h:67
Definition PxUserAllocated.h:43
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxU64 PxSerialObjectId
ID type for PxBase objects in a PxCollection.
Definition PxSerialFramework.h:61