Last change
on this file since 4299 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
|
Line | |
---|
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 | |
---|
20 | #include "class_list.h" |
---|
21 | |
---|
22 | |
---|
23 | class WorldEntity; |
---|
24 | class GarbageCollector; |
---|
25 | |
---|
26 | |
---|
27 | template<class T> class tList; |
---|
28 | template<class T> class ManagedObject; |
---|
29 | |
---|
30 | //! the object manager itself |
---|
31 | class ObjectManager : public BaseObject { |
---|
32 | |
---|
33 | public: |
---|
34 | static ObjectManager* getInstance(void); |
---|
35 | virtual ~ObjectManager(void); |
---|
36 | |
---|
37 | void cache(classList index, int number, const BaseObject ©Object); |
---|
38 | void addToDeadList(classList index, BaseObject* object); |
---|
39 | BaseObject* getFromDeadList(classList index, int number = 1); |
---|
40 | |
---|
41 | void debug(); |
---|
42 | |
---|
43 | private: |
---|
44 | ObjectManager(void); |
---|
45 | static ObjectManager* singletonRef; |
---|
46 | |
---|
47 | //BaseObject** managedObjectList; |
---|
48 | tList<BaseObject>** managedObjectList; |
---|
49 | GarbageCollector* garbageCollector; |
---|
50 | }; |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | #endif /* _OBJECT_MANAGER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.