Changeset 9673 in orxonox.OLD for trunk/src/lib/lang/test_object_list.cc
- Timestamp:
- Aug 21, 2006, 6:22:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/test_object_list.cc
r9672 r9673 5 5 class BaseObject 6 6 { 7 8 7 public: 8 void setName(const std::string& name) { this->_objectName = name; }; 9 9 const std::string& name() const { return _objectName; }; 10 10 bool operator==(const std::string& name) const { return _objectName == name; }; … … 16 16 BaseObject(const std::string& objectName = "") : _objectName(objectName) { this->registerObject(this, objectList); }; 17 17 template<class T> 18 19 18 inline void registerObject(T* object, NewObjectList<T>& objectList) { _id.registerObject(object, objectList); }; 19 private: 20 20 NewClassID _id; 21 21 std::string _objectName; … … 41 41 { 42 42 this->registerObject(this, Test::objectList); 43 std::cout << "Test()\n";43 // std::cout << "Test()\n"; 44 44 }; 45 45 Test::~Test() 46 { std::cout << "~Test()\n"; } 46 { 47 // std::cout << "~Test()\n"; 48 } 47 49 48 50 class Bone : public BaseObject 49 51 { 50 52 public: 51 Bone() { 53 Bone() 54 { 52 55 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 }; 55 61 NewObjectListDeclaration(Bone); 56 62 }; … … 59 65 int main() 60 66 { 61 Test* test = new Test();62 test->setName("Test-object");63 64 Test::objectList.debug();65 67 66 68 67 Test::objectList.debug(); 69 70 Test* test = new Test[1000000]; 71 //test->setName("Test-object"); 72 73 // Test::objectList.debug(); 74 /* 68 75 Bone* bone = new Bone(); 69 bone->setName("Bone-object"); 76 bone->setName("Bone-object");*/ 70 77 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; 76 82 } 77 83
Note: See TracChangeset
for help on using the changeset viewer.