Changeset 4313 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 26, 2005, 11:24:27 PM (20 years ago)
- Location:
- orxonox/trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/object_manager.cc
r4312 r4313 31 31 this->setClassName ("ObjectManager"); 32 32 33 //this->managedObjectList = new BaseObject*[CL_NUMBER];34 33 this->managedObjectList = new tList<BaseObject>*[CL_NUMBER]; 35 34 … … 61 60 ObjectManager::singletonRef = NULL; 62 61 } 63 64 65 /*66 void ObjectManager::cache(classList index, int number, Projectile* copyObject)67 {68 //this->managedObjectList[index] = new BaseObject[number];69 this->managedObjectList[index] = new tList<BaseObject>();70 for(int i = 0; i < number; ++i)71 {72 this->managedObjectList[index]->add(new Projectile(*copyObject));73 }74 }75 */76 62 77 63 -
orxonox/trunk/src/util/object_manager.h
r4312 r4313 8 8 - recycle deleted objects: specific for Projectils since there is a lot of world entity creation/deletion (and this needs a lot of time) 9 9 - control the garbage collector 10 11 TO ADD SUPPORT FOR A CLASS do the following steps: 12 1. include the hader file : #include "class_header.h" 13 2. add the class to the type enum classList {}; 14 3. define a function void mCache( ClassName ) in class ObjectManager 15 10 16 */ 11 17 … … 35 41 36 42 37 template<class T> class tList; 38 template<class T> class ManagedObject; 39 40 41 42 43 43 //! This defines the "template" makro function for cache(...) 44 44 #define mCache( Class ) \ 45 45 cache(classList index, int number, Class * copyObject) \ … … 61 61 virtual ~ObjectManager(void); 62 62 63 64 63 void mCache(Projectile); 65 66 64 void addToDeadList(classList index, BaseObject* object); 67 65 BaseObject* getFromDeadList(classList index, int number = 1); 68 69 70 66 71 67 void debug(); … … 73 69 private: 74 70 ObjectManager(void); 75 //void cache(classList index, int number, Projectile* copyObject);76 71 77 72 static ObjectManager* singletonRef; 78 73 79 //BaseObject** managedObjectList;80 74 tList<BaseObject>** managedObjectList; 81 75 GarbageCollector* garbageCollector;
Note: See TracChangeset
for help on using the changeset viewer.