Changeset 3585 in orxonox.OLD for orxonox/trunk/src/lib/util
- Timestamp:
- Mar 16, 2005, 11:59:51 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/list.h
r3553 r3585 86 86 T* enumerate(); 87 87 T* nextElement(); 88 T* nextElement(T* toEntity); 88 89 T* toArray(); 89 90 void debug(); … … 199 200 T* tList<T>::enumerate() 200 201 { 201 if(this-> size == 0) return NULL;202 if(this->last == this->first) return NULL; 202 203 this->currentEl = this->first; 203 204 return this->currentEl->curr; … … 208 209 T* tList<T>::nextElement() 209 210 { 210 if(this-> size == 0) return NULL;211 if(this->last == this->first) return NULL; 211 212 this->currentEl = this->currentEl->next; 212 213 if(this->currentEl == NULL) return NULL; … … 215 216 216 217 218 /** 219 \brief this returns the next element after toEntity or the first if toEntity is last 220 */ 221 template<class T> 222 T* tList<T>::nextElement(T* toEntity) 223 { 224 if( this->last == this->first) return NULL; 225 if( toEntity == NULL) return this->first->curr; 226 if( toEntity == this->last->curr ) return this->first->curr; 227 this->currentEl = this->first; 228 while(this->currentEl->curr != toEntity && this->currentEl->next != NULL) 229 { 230 this->currentEl = this->currentEl->next; 231 } 232 if(this->currentEl == NULL) return NULL; 233 return this->currentEl->next->curr; 234 } 235 236 217 237 template<class T> 218 238 T* tList<T>::toArray()
Note: See TracChangeset
for help on using the changeset viewer.