Changeset 871 for code/trunk/src/orxonox/core/ObjectList.h
- Timestamp:
- Mar 9, 2008, 4:44:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/core/ObjectList.h
r790 r871 26 26 */ 27 27 28 /* !28 /** 29 29 @file ObjectList.h 30 30 @brief Definition and implementation of the ObjectList class. … … 40 40 #include "CorePrereqs.h" 41 41 #include "Iterator.h" 42 #include "ClassManager.h" 42 43 43 44 namespace orxonox … … 83 84 { 84 85 public: 85 static ObjectList<T>* getList(); 86 ObjectList(); 87 ~ObjectList(); 86 88 87 89 ObjectListElement<T>* add(T* object); 88 90 // void remove(OrxonoxClass* object, bool bIterateForwards = true); 89 91 90 /** @ returns the first element in the list */92 /** @brief Returns the first element in the list. @return The first element */ 91 93 inline static Iterator<T> start() 92 { return Iterator<T>( getList()->first_); }93 94 /** @ returns the first element in the list */94 { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->first_); } 95 96 /** @brief Returns the first element in the list. @return The first element */ 95 97 inline static Iterator<T> begin() 96 { return Iterator<T>( getList()->first_); }97 98 /** @ returns the last element in the list */98 { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->first_); } 99 100 /** @brief Returns the last element in the list. @return The last element */ 99 101 inline static Iterator<T> end() 100 { return Iterator<T>( getList()->last_); }102 { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->last_); } 101 103 102 104 ObjectListElement<T>* first_; //!< The first element in the list 103 105 ObjectListElement<T>* last_; //!< The last element in the list 104 105 private:106 ObjectList();107 ~ObjectList();108 106 }; 109 107 … … 131 129 this->first_ = temp; 132 130 } 133 }134 135 /**136 @returns a pointer to the only existing instance for the given class T.137 */138 template <class T>139 ObjectList<T>* ObjectList<T>::getList()140 {141 static ObjectList<T> theOnlyObjectListObjectForClassT = ObjectList<T>();142 return &theOnlyObjectListObjectForClassT;143 131 } 144 132
Note: See TracChangeset
for help on using the changeset viewer.