Changeset 4288 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 26, 2005, 12:38:44 AM (20 years ago)
- Location:
- orxonox/trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/object_manager.cc
r4287 r4288 11 11 ### File Specific: 12 12 main-programmer: Patrick Boenzli 13 co-programmer: ...14 13 */ 15 14 … … 17 16 18 17 #include "object_manager.h" 18 #include "garbage_collector.h" 19 19 #include "list.h" 20 #include "world_entity.h" 20 21 21 22 22 using namespace std; … … 32 32 //this->managedObjectList = new BaseObject*[CL_NUMBER]; 33 33 this->managedObjectList = new tList<BaseObject>*[CL_NUMBER]; 34 35 this->garbageCollector = GarbageCollector::getInstance(); 34 36 } 35 37 … … 71 73 72 74 73 void ObjectManager::addToDeadList(const char* className, BaseObject* object) 74 {} 75 void ObjectManager::addToDeadList(classList index, BaseObject* object) 76 { 77 if( likely(this->managedObjectList[index] != NULL)) 78 this->managedObjectList[index]->add(object); 79 else 80 PRINTF(0)(" Error: unable to add object to the list nr. %i, ignoring\n", index); 81 } 75 82 76 83 77 BaseObject* ObjectManager::getFromDeadList(c onst char* className, int number)84 BaseObject* ObjectManager::getFromDeadList(classList index, int number) 78 85 {} 79 86 -
orxonox/trunk/src/util/object_manager.h
r4287 r4288 18 18 #define OM_ 19 19 20 class WorldEntity; 20 #include "class_list.h" 21 21 22 22 23 //! list of classes able to be loaded via the object manager 24 struct classListElement 25 { 26 char* name; 27 }; 28 #include "class_list.h" 29 23 class WorldEntity; 24 class GarbageCollector; 30 25 31 26 … … 41 36 42 37 void cache(classList index, int number, const BaseObject ©Object); 43 void addToDeadList(c onst char* className, BaseObject* object);44 BaseObject* getFromDeadList(c onst char* className, int number = 1);38 void addToDeadList(classList index, BaseObject* object); 39 BaseObject* getFromDeadList(classList index, int number = 1); 45 40 46 41 void debug(); … … 52 47 //BaseObject** managedObjectList; 53 48 tList<BaseObject>** managedObjectList; 49 GarbageCollector* garbageCollector; 54 50 }; 55 51 56 52 57 template<class T> class ManagedObject58 {59 public:60 const char* className;61 tList<T>* objectList;62 };63 64 #define createClassFromName(className)65 66 53 67 54 #endif /* _OBJECT_MANAGER_H */
Note: See TracChangeset
for help on using the changeset viewer.