Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9672 in orxonox.OLD for trunk/src/lib/lang/test_object_list.cc


Ignore:
Timestamp:
Aug 21, 2006, 5:58:01 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: ClassList objectively implemented. This is not the fastest, but the most modular approach.
Now is the question of redundancy in code writing:
Should the ClassWriter explicitely declare a Class with superclasses, or should on runtime each object decide for itself, as it is done in BaseObject at the moment… questions questions questions…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/test_object_list.cc

    r9671 r9672  
    1010  bool operator==(const std::string& name) const { return _objectName == name; };
    1111
     12  NewObjectListDeclaration(BaseObject);
     13
     14
    1215protected:
     16  BaseObject(const std::string& objectName = "") : _objectName(objectName) { this->registerObject(this, objectList); };
    1317  template<class T>
    1418      inline void registerObject(T* object, NewObjectList<T>& objectList) { _id.registerObject(object, objectList); };
     
    1721  std::string   _objectName;
    1822
     23
    1924};
     25NewObjectListDefinition(BaseObject);
     26
    2027
    2128class Test : public BaseObject
     
    5360{
    5461  Test* test = new Test();
    55   test->setName("Testing");
     62  test->setName("Test-object");
    5663
    5764  Test::objectList.debug();
    5865
    59   delete test;
    6066
    6167  Test::objectList.debug();
    6268  Bone* bone = new Bone();
     69  bone->setName("Bone-object");
     70
     71  std::cout << "Here is debug of all Classes\n";
     72  BaseObject::objectList.debug();
    6373  delete bone;
     74  delete test;
    6475
    65 
    66 
    67   std::cout << NewObjectListBase::classCount() << std::endl;
    6876}
    6977
Note: See TracChangeset for help on using the changeset viewer.