Changeset 5118 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Aug 24, 2005, 2:45:46 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/list.h
r5115 r5118 333 333 334 334 T* firstElement(); 335 T* lastElement(); 335 336 T* nextElement(); 337 T* prevElement(); 336 338 T* seekElement(T* element); 337 339 T* iteratorElement(const tIterator<T>* iterator); … … 375 377 inline tIterator<T>::~tIterator () 376 378 { 377 this->currentEl = NULL;378 379 } 379 380 … … 382 383 { 383 384 this->currentEl = this->list->first; 384 if (this->currentEl == NULL) 385 return NULL; 386 else 385 if (this->currentEl != NULL) 387 386 return this->currentEl->curr; 387 else 388 return NULL; 389 } 390 391 template<class T> 392 inline T* tIterator<T>::lastElement () 393 { 394 this->currentEl = this->list->last; 395 if (this->currentEl != NULL) 396 return this->currentEl->curr; 397 else 398 return NULL; 388 399 } 389 400 … … 405 416 return NULL; 406 417 } 418 419 /** 420 * use it to iterate backwards through the list 421 * @returns next list element 422 */ 423 template<class T> 424 inline T* tIterator<T>::prevElement () 425 { 426 if( this->currentEl == NULL) 427 return NULL; 428 429 this->currentEl = this->currentEl->prev; 430 if (this->currentEl != NULL) 431 return this->currentEl->curr; 432 else 433 return NULL; 434 } 435 407 436 408 437 /**
Note: See TracChangeset
for help on using the changeset viewer.