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 FUNCTIONS |
---|
30 | static void addToClassList(BaseObject* objectPointer, const long& classID, const char* className); |
---|
31 | static void removeFromClassList(BaseObject* objectPointer); |
---|
32 | |
---|
33 | static bool exists(BaseObject* object, long classID = CL_NULL); |
---|
34 | |
---|
35 | static void debug(unsigned int debugLevel = 0); |
---|
36 | |
---|
37 | private: |
---|
38 | tList<BaseObject>* objectList; //!< A list of Objects belonging to this Class |
---|
39 | |
---|
40 | long classID; //!< ClassID stored in this ClassList \see ClassID |
---|
41 | const char* className; //!< Name of the Class Stored here |
---|
42 | |
---|
43 | ClassList* next; //!< Pointer to the next class in the List |
---|
44 | |
---|
45 | // STATIC MEMBERS |
---|
46 | static ClassList* first; //!< The first Class in the List (should be BaseObject) |
---|
47 | static unsigned int classCount; //!< The Count of classes that have been registered (should match the lower description) |
---|
48 | }; |
---|
49 | |
---|
50 | #endif /* _CLASS_LIST_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.