Last change
on this file since 4438 was
4436,
checked in by bensch, 20 years ago
|
orxonox/trunk: baseObject now implements loading of objectNames
|
File size:
1.4 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file base_object.h |
---|
3 | \brief Definition of the base object class. that is a global handler for all classes. |
---|
4 | */ |
---|
5 | |
---|
6 | |
---|
7 | #ifndef _BASE_OBJECT_H |
---|
8 | #define _BASE_OBJECT_H |
---|
9 | |
---|
10 | #include "class_list.h" |
---|
11 | #ifndef NULL |
---|
12 | #define NULL 0x0 |
---|
13 | #endif |
---|
14 | |
---|
15 | class TiXmlElement; |
---|
16 | |
---|
17 | //! A class all other classes are derived from |
---|
18 | class BaseObject { |
---|
19 | |
---|
20 | public: |
---|
21 | BaseObject (const TiXmlElement* root = NULL); |
---|
22 | virtual ~BaseObject (); |
---|
23 | |
---|
24 | void loadParams(const TiXmlElement* root); |
---|
25 | |
---|
26 | void setClassID(int id); |
---|
27 | void setClassName(const char* className); |
---|
28 | void setClassID(int id, const char* className); |
---|
29 | |
---|
30 | /** \returns the className of the corresponding Object */ |
---|
31 | inline const char* getClassName(void) const { return this->className;}; |
---|
32 | /** \returns the classID of the corresponding Object */ |
---|
33 | inline int getClassID(void) const { return this->id; } |
---|
34 | bool isA (char* className); |
---|
35 | |
---|
36 | /** \returns if the object is finalized */ |
---|
37 | inline bool isFinalized() { return this->finalized; } |
---|
38 | void finalize(); |
---|
39 | |
---|
40 | void setName (const char* newName); |
---|
41 | const char* getName (void)const { return this->objectName; }; |
---|
42 | |
---|
43 | private: |
---|
44 | const char* className; //!< the name of the class |
---|
45 | int id; //!< this is the id from the class_list.h enumeration |
---|
46 | bool finalized; //!< is true if the object is ready to be garbage collected |
---|
47 | |
---|
48 | char* objectName; //!< The name of this object |
---|
49 | }; |
---|
50 | |
---|
51 | #endif /* _BASE_OBJECT_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.