Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/object_manager.h @ 4287

Last change on this file since 4287 was 4287, checked in by patrick, 19 years ago

orxonox/trunk: implemented the objectmanager debug functon, some small fixed in the ol code

File size: 1.4 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
20class WorldEntity;
21
22
23//! list of classes able to be loaded via the object manager
24struct classListElement
25{
26  char* name;
27};
28#include "class_list.h"
29
30
31
32template<class T> class tList; 
33template<class T> class ManagedObject;
34
35//! the object manager itself
36class ObjectManager : public BaseObject {
37
38 public:
39  static ObjectManager* getInstance(void);
40  virtual ~ObjectManager(void);
41 
42  void cache(classList index, int number, const BaseObject &copyObject);
43  void addToDeadList(const char* className, BaseObject* object);
44  BaseObject* getFromDeadList(const char* className, int number = 1);
45
46  void debug();
47
48 private:
49  ObjectManager(void);
50  static ObjectManager* singletonRef;
51
52  //BaseObject** managedObjectList;
53  tList<BaseObject>** managedObjectList;
54};
55
56
57template<class T> class ManagedObject
58{
59 public:
60  const char* className;
61  tList<T>* objectList;
62};
63
64#define createClassFromName(className)
65
66
67#endif /* _OBJECT_MANAGER_H */
Note: See TracBrowser for help on using the repository browser.