Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

fixed out some warnings

File size: 2.0 KB
RevLine 
[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"
[8035]14#include <string>
[3302]15
[6341]16#include "stdincl.h"
17
[6517]18class TiXmlNode;
[4436]19class TiXmlElement;
[6280]20class ClassList;
[4436]21
[4382]22//! A class all other classes are derived from
[8350]23class BaseObject
24{
[3302]25
[8350]26public:
27  BaseObject (const std::string& objectName = "");
[7779]28
[3531]29  virtual ~BaseObject ();
[3302]30
[6512]31  virtual void loadParams(const TiXmlElement* root);
[7221]32  void setName (const std::string& newName);
[5113]33  /** returns the Name of this Object */
[7221]34  inline const char* getName ()const { return this->objectName.c_str(); };
[6587]35  /** @returns the XML-Element with whicht this Object was loaded */
36  inline TiXmlNode* getXmlElem() const { return this->xmlElem; };
[4318]37
[4836]38  /** @returns the className of the corresponding Object */
[7221]39  inline const char* getClassName() const { return this->className.c_str(); };
[4836]40  /** @returns the classID of the corresponding Object */
[4933]41  inline int getClassID() const { return this->classID; };
[7954]42  const ClassID& getLeafClassID() const;
[3302]43
[6077]44  bool isA (ClassID classID) const;
[7221]45  bool isA (const std::string& className) const;
[4746]46  void whatIs() const;
[4470]47
[7221]48  bool operator==(const std::string& objectName);
[6077]49  /** @param classID comparer for a ClassID @returns true on match, false otherwise */
50  bool operator==(ClassID classID) { return this->isA(classID); };
[5626]51
[8350]52protected:
53  void setClassID(ClassID classID, const std::string& className);
[4539]54
[8350]55protected:
56  std::string        objectName;       //!< The name of this object
[6280]57
[8350]58private:
[6517]59
[8350]60  std::string        className;        //!< the name of the class
61  long               classID;          //!< this is the id from the class_id.h enumeration
62  ClassID            leafClassID;      //!< The Leaf Class ID
63
64  ClassList*         classList;        //!< Pointer to the ClassList this Object is inside of
65
66  TiXmlNode*         xmlElem;          //!< The XML Element with wich this Object was loaded(saved).
[3302]67};
68
69#endif /* _BASE_OBJECT_H */
Note: See TracBrowser for help on using the repository browser.