navi homeaboutscreenshotsdownloaddevelopmentforum



The BaseObject is the top-most SuperClass of (most but not) all Classes in orxonox.

Derived From:

  • nothing


BaseObject is a container for

  • The Name of the Object (how the object is called)
  • The Class' Name of the Object (in what class this object is)
  • The ClassID of the Object (what is the Identity of the class (see ClassID)


  • Registration:
    Each class, that extends BaseObject must implement the following function:
    1. In the Class-Declaration use the following syntax (taken your class is named OrxClass)
        class OrxClass : public !BaseObject // here you could also specify any class derived from !BaseObject
          /// ... rest of the Declaration;
    2. At the top of the cc-file of the Class (in the definiton) write:
    3. In the constructor of each class implementing BaseObject write the following:
      this->registerObject(this, OrxClass::_objectList);
    4. you can then set a Name to the Object using
      this->setName("the name");
  • isA:
    isA is a function, that queries, if the Object is of a Specified type. e.g. given a class Player that is derived from BaseObject and PNode one can do the following check :
     Player* player = new Player();
     if (player->isA(PNode::staticClassID()) {
       /* do something terrible with it */ }

Advanced Topics

An interessting Function, that BaseObject provides is the ObjectList. With it, one can retrieve lists of any one kind of derived classes from BaseObject.

Last modified 9 years ago Last modified on Nov 28, 2007, 12:20:30 AM