Changeset 9718 in orxonox.OLD for branches/new_class_id/src/lib/lang/object_list.h
- Timestamp:
- Sep 1, 2006, 11:56:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/lang/object_list.h
r9716 r9718 72 72 virtual void getBaseObjectList(base_list* list) const = 0; 73 73 74 static const ClassID& retrieveIdentity(int id);75 static const ClassID& retrieveIdentity(const std::string& name);76 77 static const ObjectListBase* const getObjectList(int classID);78 static const ObjectListBase* const getObjectList(const std::string& className);79 static const ObjectListBase* const getObjectList(const ClassID& classID);74 static const ClassID& retrieveIdentity(int id); 75 static const ClassID& retrieveIdentity(const std::string& name); 76 77 static const ObjectListBase* const getObjectList(int classID); 78 static const ObjectListBase* const getObjectList(const std::string& className); 79 static const ObjectListBase* const getObjectList(const ClassID& classID); 80 80 81 81 static BaseObject* getBaseObject(int classID, const std::string& objectName); … … 115 115 116 116 private: 117 int _id; 117 int _id; //!< The Unique ID of the Class. 118 118 const std::string _name; //!< The Name of the Class. 119 ClassID _identity; //!< The Identity of the Class. (equal to _id and _name)119 ClassID _identity; //!< The Identity of the Class. (equal to _id and _name) 120 120 121 121 private: … … 169 169 { 170 170 public: 171 typedef std::list<T*> list; 172 typedef typename list::iterator iterator; 173 typedef typename list::const_iterator const_iterator; 174 175 171 typedef std::list<T*> list; //!< The list of Type T* (used for Objects in this ObjectList) 172 typedef typename list::iterator iterator; //!< The iterator for the List of type T (use with ObjectList<Type>::iterator) 173 typedef typename list::const_iterator const_iterator; //!< A constant iterator for the List of type T (use with ObjectList<Type>::const_iterator) 174 175 176 //! An iterator to store Objects in the BaseObject, and remove Objects fast. 176 177 class Iterator : public ObjectListBase::IteratorBase 177 178 { 178 179 public: 179 Iterator(iterator it) { _it = it; } 180 /** @brief creates an Iterator fast. @param it the Iterator. */ 181 inline Iterator(iterator it) { _it = it; } 182 /** @returns the Iterator */ 180 183 inline iterator& it() { return _it; } 181 typename ObjectList::iterator _it; 184 private: 185 typename ObjectList::iterator _it; //!< Stored Iterator 182 186 }; 183 187 … … 210 214 211 215 212 ObjectListBase::IteratorBase* registerObject(T* object);216 ObjectListBase::IteratorBase* registerObject(T* object); 213 217 virtual void unregisterObject(IteratorBase* iterator); 214 218 … … 288 292 */ 289 293 template <class T> 290 294 bool ObjectList<T>::exists(const T* const object) const 291 295 { 292 296 return (std::find(_objects.begin(), _objects.end(), object) != _objects.end());
Note: See TracChangeset
for help on using the changeset viewer.