Last change
on this file since 5514 was
5513,
checked in by bensch, 19 years ago
|
orxonox/trunk: color adaption in the shell
isA also with String (slow)
|
File size:
1.3 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file base_object.h |
---|
3 | * Definition of the base object class. |
---|
4 | |
---|
5 | This is a global handler for all classes. |
---|
6 | */ |
---|
7 | |
---|
8 | |
---|
9 | #ifndef _BASE_OBJECT_H |
---|
10 | #define _BASE_OBJECT_H |
---|
11 | |
---|
12 | #include "class_id.h" |
---|
13 | #include "debug.h" |
---|
14 | #ifndef NULL |
---|
15 | #define NULL 0 //!< NULL |
---|
16 | #endif |
---|
17 | |
---|
18 | class TiXmlElement; |
---|
19 | |
---|
20 | //! A class all other classes are derived from |
---|
21 | class BaseObject { |
---|
22 | |
---|
23 | public: |
---|
24 | BaseObject (const TiXmlElement* root = NULL); |
---|
25 | virtual ~BaseObject (); |
---|
26 | |
---|
27 | void loadParams(const TiXmlElement* root); |
---|
28 | void setName (const char* newName); |
---|
29 | /** returns the Name of this Object */ |
---|
30 | inline const char* getName ()const { return this->objectName; }; |
---|
31 | |
---|
32 | /** @returns the className of the corresponding Object */ |
---|
33 | inline const char* getClassName() const { return this->className; }; |
---|
34 | /** @returns the classID of the corresponding Object */ |
---|
35 | inline int getClassID() const { return this->classID; }; |
---|
36 | |
---|
37 | bool isA (long classID) const; |
---|
38 | bool isA (const char* className) const; |
---|
39 | void whatIs() const; |
---|
40 | |
---|
41 | protected: |
---|
42 | void setClassID(long classID, const char* className); |
---|
43 | |
---|
44 | private: |
---|
45 | const char* className; //!< the name of the class |
---|
46 | long classID; //!< this is the id from the class_id.h enumeration |
---|
47 | char* objectName; //!< The name of this object |
---|
48 | }; |
---|
49 | |
---|
50 | #endif /* _BASE_OBJECT_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.