Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/lang/base_object.h @ 4436

Last change on this file since 4436 was 4436, checked in by bensch, 19 years ago

orxonox/trunk: baseObject now implements loading of objectNames

File size: 1.4 KB
RevLine 
[3302]1/*!
[4382]2    \file base_object.h
3    \brief Definition of the base object class. that is a global handler for all classes.
[3302]4*/
5
6
7#ifndef _BASE_OBJECT_H
8#define _BASE_OBJECT_H
9
[4318]10#include "class_list.h"
[4436]11#ifndef NULL
12#define NULL 0x0
13#endif
[3302]14
[4436]15class TiXmlElement;
16
[4382]17//! A class all other classes are derived from
[3302]18class BaseObject {
19
20 public:
[4436]21  BaseObject (const TiXmlElement* root = NULL);
[3531]22  virtual ~BaseObject ();
[3302]23
[4436]24  void loadParams(const TiXmlElement* root);
25
[4318]26  void setClassID(int id);
[4320]27  void setClassName(const char* className);
28  void setClassID(int id, const char* className);
[4318]29
[4382]30  /** \returns the className of the corresponding Object */
[4320]31  inline const char* getClassName(void) const { return this->className;};
[4382]32  /** \returns the classID of the corresponding Object */
[4318]33  inline int getClassID(void) const { return this->id; }
[3302]34  bool isA (char* className);
35
[4382]36  /** \returns if the object is finalized */
[3651]37  inline bool isFinalized() { return this->finalized; }
[3646]38  void finalize();
39
[4435]40  void setName (const char* newName);
41  const char* getName (void)const { return this->objectName; };
42
[3302]43 private:
[4435]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               
[3302]49};
50
51#endif /* _BASE_OBJECT_H */
Note: See TracBrowser for help on using the repository browser.