Changeset 9684 in orxonox.OLD for branches/new_class_id/src/lib/lang/new_object_list.h
- Timestamp:
- Aug 22, 2006, 1:34:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/lang/new_object_list.h
r9682 r9684 16 16 17 17 #define NewObjectListDeclaration(ClassName) \ 18 static NewObjectList<ClassName> objectList 18 public: \ 19 static const NewObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \ 20 private: \ 21 static NewObjectList<ClassName> _objectList 19 22 20 23 #define NewObjectListDefinitionID(ClassName, ID) \ 21 NewObjectList<ClassName> ClassName:: objectList(#ClassName, ID)24 NewObjectList<ClassName> ClassName::_objectList(#ClassName, ID) 22 25 23 26 … … 157 160 T* NewObjectList<T>::getObject(const std::string& name) const 158 161 { 159 iterator it = std::find(this->_objects.begin(), this->_objects.end(), name);160 if (it != this->_objects.end())161 return *it;162 else163 162 const_iterator it; 163 for (it = this->_objects.begin(); it != this->_objects.end(); ++it) 164 if ((*it)->getName() == name) 165 return (*it); 166 return NULL; 164 167 } 165 168
Note: See TracChangeset
for help on using the changeset viewer.