Last change
on this file since 4754 was
4754,
checked in by bensch, 19 years ago
|
orxonox/trunk: implemented a very slow exists function for ClassList
|
File size:
1.6 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file class_list.h |
---|
3 | \brief Definition of the Class List, that handles a Class-Specific-Control structure |
---|
4 | |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _CLASS_LIST_H |
---|
8 | #define _CLASS_LIST_H |
---|
9 | |
---|
10 | #include "class_id.h" |
---|
11 | |
---|
12 | // FORWARD DEFINITION |
---|
13 | class BaseObject; |
---|
14 | template<class T> class tList; |
---|
15 | |
---|
16 | |
---|
17 | //! A class that handles Pointers to Objects of all type. |
---|
18 | /** |
---|
19 | here all the Pointers to all the Object of orxonox are stored, that implement BaseObject |
---|
20 | for now, this is only for debugging reasons, and we should be able to detect undeleted |
---|
21 | Objects. |
---|
22 | */ |
---|
23 | class ClassList { |
---|
24 | |
---|
25 | public: |
---|
26 | ClassList(const long& classID, const char* className); |
---|
27 | virtual ~ClassList(); |
---|
28 | |
---|
29 | static void addToClassList(BaseObject* objectPointer, const long& classID, const char* className); |
---|
30 | static void removeFromClassList(BaseObject* objectPointer); |
---|
31 | |
---|
32 | bool exists(BaseObject* object, long classID = CL_NULL); |
---|
33 | |
---|
34 | static void debug(unsigned int debugLevel = 0); |
---|
35 | |
---|
36 | private: |
---|
37 | tList<BaseObject>* objectList; //!< A list of Objects belonging to this Class |
---|
38 | |
---|
39 | long classID; //!< ClassID stored in this ClassList \see ClassID |
---|
40 | const char* className; //!< Name of the Class Stored here |
---|
41 | |
---|
42 | ClassList* next; //!< Pointer to the next class in the List |
---|
43 | |
---|
44 | // STATIC MEMBERS |
---|
45 | static ClassList* first; //!< The first Class in the List (should be BaseObject) |
---|
46 | static unsigned int classCount; //!< The Count of classes that have been registered (should match the lower description) |
---|
47 | }; |
---|
48 | |
---|
49 | #endif /* _CLASS_LIST_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.