source:
orxonox.OLD/trunk/src/lib/lang/base_object.h
@
6027
Last change on this file since 6027 was 5791, checked in by bensch, 19 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[4591] | 1 | /*! |
[5039] | 2 | * @file base_object.h |
[4836] | 3 | * Definition of the base object class. |
[4470] | 4 | |
5 | This is a global handler for all classes. | |
[3302] | 6 | */ |
7 | ||
8 | ||
9 | #ifndef _BASE_OBJECT_H | |
10 | #define _BASE_OBJECT_H | |
11 | ||
[4742] | 12 | #include "class_id.h" |
[5511] | 13 | #include "debug.h" |
[4436] | 14 | #ifndef NULL |
[5279] | 15 | #define NULL 0 //!< NULL |
[4436] | 16 | #endif |
[3302] | 17 | |
[4436] | 18 | class TiXmlElement; |
19 | ||
[4382] | 20 | //! A class all other classes are derived from |
[3302] | 21 | class BaseObject { |
22 | ||
23 | public: | |
[4436] | 24 | BaseObject (const TiXmlElement* root = NULL); |
[3531] | 25 | virtual ~BaseObject (); |
[3302] | 26 | |
[4436] | 27 | void loadParams(const TiXmlElement* root); |
[4539] | 28 | void setName (const char* newName); |
[5113] | 29 | /** returns the Name of this Object */ |
[4746] | 30 | inline const char* getName ()const { return this->objectName; }; |
[4318] | 31 | |
[4836] | 32 | /** @returns the className of the corresponding Object */ |
[4746] | 33 | inline const char* getClassName() const { return this->className; }; |
[4836] | 34 | /** @returns the classID of the corresponding Object */ |
[4933] | 35 | inline int getClassID() const { return this->classID; }; |
[3302] | 36 | |
[4747] | 37 | bool isA (long classID) const; |
[5513] | 38 | bool isA (const char* className) const; |
[4746] | 39 | void whatIs() const; |
[4470] | 40 | |
[5791] | 41 | bool operator==(const char* objectName); |
[5626] | 42 | |
[4539] | 43 | protected: |
[5791] | 44 | void setClassID(ClassID classID, const char* className); |
[4539] | 45 | |
[4742] | 46 | private: |
47 | const char* className; //!< the name of the class | |
[4744] | 48 | long classID; //!< this is the id from the class_id.h enumeration |
[4742] | 49 | char* objectName; //!< The name of this object |
[3302] | 50 | }; |
51 | ||
52 | #endif /* _BASE_OBJECT_H */ |
Note: See TracBrowser
for help on using the repository browser.