Changeset 9661 in orxonox.OLD for trunk/src/lib/lang/new_class_list.cc
- Timestamp:
- Aug 20, 2006, 12:21:18 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/new_class_list.cc
r9660 r9661 20 20 21 21 22 NewClassListBase::NewClassListBase(const std::string& className) 23 : _id(-1), _name(className) 22 NewObjectListBase::NewObjectListBase(const std::string& className) 23 : _id(-1), _name(className) 24 { 25 if (NewObjectListBase::_classes == NULL) 26 NewObjectListBase::_classes = new cList; 27 assert(!NewObjectListBase::exists(className) && "Classes should not be included once, and no two classes should have the same name (key value)"); 28 29 30 31 } 32 33 NewObjectListBase::~NewObjectListBase() 24 34 { 25 35 26 36 } 37 38 int NewObjectListBase::_idCounter = 0; 39 NewObjectListBase::cList* NewObjectListBase::_classes = NULL; 40 41 42 43 /** 44 * @brief Checks if a Class with name already exists. 45 * @param name The Name of the Class to check. 46 * @return true if such a class already exists. 47 */ 48 bool NewObjectListBase::exists(const std::string& name) 49 { 50 cList::iterator it; 51 for (it = NewObjectListBase::_classes->begin(); it != NewObjectListBase::_classes->end(); it++) 52 if(*it != NULL && (*it)->name() != name) 53 return true; 54 return false; 55 }
Note: See TracChangeset
for help on using the changeset viewer.