Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Aug 21, 2006, 6:22:53 PM (18 years ago)
Author:
bensch
Message:

ClassList seems to work as it should.

File:
1 edited

Legend:

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

    r9672 r9673  
    55class BaseObject
    66{
    7   public:
    8     void setName(const std::string& name) { this->_objectName = name; };
     7public:
     8  void setName(const std::string& name) { this->_objectName = name; };
    99  const std::string& name() const { return _objectName; };
    1010  bool operator==(const std::string& name) const { return _objectName == name; };
     
    1616  BaseObject(const std::string& objectName = "") : _objectName(objectName) { this->registerObject(this, objectList); };
    1717  template<class T>
    18       inline void registerObject(T* object, NewObjectList<T>& objectList) { _id.registerObject(object, objectList); };
    19   private:
     18  inline void registerObject(T* object, NewObjectList<T>& objectList) { _id.registerObject(object, objectList); };
     19private:
    2020  NewClassID    _id;
    2121  std::string   _objectName;
     
    4141{
    4242  this->registerObject(this, Test::objectList);
    43   std::cout << "Test()\n";
     43 // std::cout << "Test()\n";
    4444};
    4545Test::~Test()
    46 { std::cout << "~Test()\n"; }
     46{
     47//  std::cout << "~Test()\n";
     48}
    4749
    4850class Bone : public BaseObject
    4951{
    5052public:
    51   Bone() {
     53  Bone()
     54  {
    5255    this->registerObject(this, Bone::objectList);
    53     std::cout << "Bone()\n"; };
    54   ~Bone() { std::cout << "~Bone()\n"; };
     56    //std::cout << "Bone()\n";
     57  };
     58  ~Bone() {
     59  //  std::cout << "~Bone()\n";
     60  };
    5561  NewObjectListDeclaration(Bone);
    5662};
     
    5965int main()
    6066{
    61   Test* test = new Test();
    62   test->setName("Test-object");
    63 
    64   Test::objectList.debug();
    6567
    6668
    67   Test::objectList.debug();
     69
     70  Test* test = new Test[1000000];
     71  //test->setName("Test-object");
     72
     73//  Test::objectList.debug();
     74/*
    6875  Bone* bone = new Bone();
    69   bone->setName("Bone-object");
     76  bone->setName("Bone-object");*/
    7077
    71   std::cout << "Here is debug of all Classes\n";
    72   BaseObject::objectList.debug();
    73   delete bone;
    74   delete test;
    75 
     78  //std::cout << "Here is debug of all Classes\n";
     79  //BaseObject::objectList.debug();
     80//   delete bone;
     81  delete []test;
    7682}
    7783
Note: See TracChangeset for help on using the changeset viewer.