Changeset 9677 in orxonox.OLD for trunk/src/lib/lang/new_object_list.cc
- Timestamp:
- Aug 21, 2006, 11:40:41 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/new_object_list.cc
r9676 r9677 23 23 : _name(className) 24 24 { 25 26 25 27 if (NewObjectListBase::_classesByID == NULL) 26 28 { … … 33 35 if (id != -1) 34 36 { 35 assert(!NewObjectListBase::classIDExists(id) && "Classes should only be included once, and no two classes should have the same ID (key value)");37 this->_id = id; 36 38 } 37 39 else 38 40 { 39 41 this->_id = NewObjectListBase::_classesByID->size(); 42 // searching for a free ID 43 while (NewObjectListBase::classIDExists(_id)) ++id; 40 44 } 45 assert(!NewObjectListBase::classIDExists(id) && "Classes should only be included once, and no two classes should have the same ID (key value)"); 46 47 /// Some Output, that will fall out later 48 std::cout << "register new ObjectList " << className << " ID: " << this->_id << std::endl; 41 49 42 50 (*NewObjectListBase::_classesByID)[this->_id] = this; … … 52 60 NewObjectListBase::~NewObjectListBase() 53 61 { 62 assert (NewObjectListBase::_classesByName != NULL && NewObjectListBase::_classesByID != NULL); 63 64 std::cout << "Erasing: " << this->_name << " "<< this->_id << std::endl; 65 66 std::cout << "SIZE OF _classByID: " << NewObjectListBase::_classesByID->size() << std::endl; 67 std::cout << "SIZE OF _classByName: " << NewObjectListBase::_classesByName->size() << std::endl; 68 54 69 NewObjectListBase::_classesByName->erase(this->_name); 55 70 NewObjectListBase::_classesByID->erase(this->_id); … … 67 82 NewObjectListBase::classIDMap* NewObjectListBase::_classesByID = NULL; 68 83 NewObjectListBase::classNameMap* NewObjectListBase::_classesByName = NULL; 69 70 71 84 72 85 /**
Note: See TracChangeset
for help on using the changeset viewer.