Last change
on this file since 4303 was
4288,
checked in by patrick, 20 years ago
|
orxonox/trunk: implementing the add/get from DeadList functions, resturctured the garbage collector hirarchy
|
File size:
1.2 KB
|
Rev | Line | |
---|
[4245] | 1 | /*! |
---|
| 2 | \file object_manager.h |
---|
| 3 | \brief this manager will ceep track of the objects in the world |
---|
| 4 | |
---|
| 5 | This is specially designed to: |
---|
| 6 | - Give an interface to the world data |
---|
| 7 | - separate the world data from the world build,update,draw process |
---|
| 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 | - control the garbage collector |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | #ifndef _OBJECT_MANAGER_H |
---|
| 14 | #define _OBJECT_MANAGER_H |
---|
| 15 | |
---|
| 16 | #include "base_object.h" |
---|
| 17 | |
---|
| 18 | #define OM_ |
---|
| 19 | |
---|
[4288] | 20 | #include "class_list.h" |
---|
[4245] | 21 | |
---|
| 22 | |
---|
[4288] | 23 | class WorldEntity; |
---|
| 24 | class GarbageCollector; |
---|
[4285] | 25 | |
---|
| 26 | |
---|
[4245] | 27 | template<class T> class tList; |
---|
[4285] | 28 | template<class T> class ManagedObject; |
---|
[4245] | 29 | |
---|
| 30 | //! the object manager itself |
---|
| 31 | class ObjectManager : public BaseObject { |
---|
| 32 | |
---|
| 33 | public: |
---|
| 34 | static ObjectManager* getInstance(void); |
---|
| 35 | virtual ~ObjectManager(void); |
---|
[4285] | 36 | |
---|
[4286] | 37 | void cache(classList index, int number, const BaseObject ©Object); |
---|
[4288] | 38 | void addToDeadList(classList index, BaseObject* object); |
---|
| 39 | BaseObject* getFromDeadList(classList index, int number = 1); |
---|
[4245] | 40 | |
---|
[4287] | 41 | void debug(); |
---|
| 42 | |
---|
[4245] | 43 | private: |
---|
| 44 | ObjectManager(void); |
---|
| 45 | static ObjectManager* singletonRef; |
---|
| 46 | |
---|
[4286] | 47 | //BaseObject** managedObjectList; |
---|
| 48 | tList<BaseObject>** managedObjectList; |
---|
[4288] | 49 | GarbageCollector* garbageCollector; |
---|
[4285] | 50 | }; |
---|
[4245] | 51 | |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | #endif /* _OBJECT_MANAGER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.