Changeset 5073 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Aug 19, 2005, 1:06:28 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/list.h
r5068 r5073 131 131 132 132 void add(T* entity); 133 void addFirst(T* entity); 133 134 void remove(T* entity); 134 135 void removeLast(); … … 203 204 if( unlikely(el->prev == NULL)) this->first = el; /* if first element */ 204 205 else el->prev->next = el; 206 this->size++; 207 } 208 209 /** 210 * add an entity to the list 211 * @param entity: the entity to add 212 */ 213 template<class T> 214 inline void tList<T>::addFirst(T* entity) 215 { 216 if( unlikely(entity == NULL)) return; 217 listElement<T>* el = new listElement<T>; 218 el->next = this->first; 219 el->curr = entity; 220 el->prev = NULL; 221 222 this->first = el; 223 224 if( unlikely(el->next == NULL)) this->first = el; /* if first element */ 225 else el->next->prev = el; 205 226 this->size++; 206 227 }
Note: See TracChangeset
for help on using the changeset viewer.