Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UnitCollection::FastIterator Class Reference

#include <oldcollection.h>

Public Member Functions

void remove ()
 removes something after pos. eg the first valid unit. or current() More...
 
void preinsert (Unit *unit)
 inserts in front of current More...
 
void postinsert (Unit *unit)
 inserts after current More...
 
 FastIterator ()
 
 FastIterator (const FastIterator &orig)
 
 FastIterator (UnitListNode *start)
 
 ~FastIterator ()
 
Unitcurrent ()
 
void advance ()
 
Unitoperator++ (int)
 
Unitoperator++ ()
 
Unitoperator* ()
 
Unitnext ()
 
bool isDone () const
 
bool notDone () const
 

Detailed Description

Definition at line 243 of file oldcollection.h.

Constructor & Destructor Documentation

UnitCollection::FastIterator::FastIterator ( )
inline

Definition at line 258 of file oldcollection.h.

258 : pos( NULL ) {}
UnitCollection::FastIterator::FastIterator ( const FastIterator orig)
inline

Definition at line 259 of file oldcollection.h.

259 : pos( orig.pos ) {}
UnitCollection::FastIterator::FastIterator ( UnitListNode *  start)
inline

Definition at line 260 of file oldcollection.h.

260 : pos( start ) {}
UnitCollection::FastIterator::~FastIterator ( )
inline

Definition at line 261 of file oldcollection.h.

262  {
263  pos = NULL;
264  }

Member Function Documentation

void UnitCollection::FastIterator::advance ( )
inline

Definition at line 269 of file oldcollection.h.

Referenced by next(), and operator++().

270  {
271  pos = pos->next;
272  }
Unit* UnitCollection::FastIterator::current ( )
inline

Definition at line 265 of file oldcollection.h.

Referenced by next(), operator*(), and operator++().

266  {
267  return pos->next->unit;
268  }
bool UnitCollection::FastIterator::isDone ( ) const
inline

Definition at line 293 of file oldcollection.h.

294  {
295  return pos->next->unit == NULL;
296  }
Unit* UnitCollection::FastIterator::next ( )
inline

Definition at line 288 of file oldcollection.h.

References advance(), and current().

289  {
290  advance();
291  return current();
292  }
bool UnitCollection::FastIterator::notDone ( ) const
inline

Definition at line 297 of file oldcollection.h.

298  {
299  return pos->next->unit != NULL;
300  }
Unit* UnitCollection::FastIterator::operator* ( )
inline

Definition at line 284 of file oldcollection.h.

References current().

285  {
286  return current();
287  }
Unit* UnitCollection::FastIterator::operator++ ( int  )
inline

Definition at line 273 of file oldcollection.h.

References advance(), and current().

274  {
275  Unit *un = current();
276  advance();
277  return un;
278  }
Unit* UnitCollection::FastIterator::operator++ ( )
inline

Definition at line 279 of file oldcollection.h.

References advance(), and current().

280  {
281  advance();
282  return current();
283  }
void UnitCollection::FastIterator::postinsert ( Unit unit)

inserts after current

Definition at line 120 of file oldcollection.cpp.

121 {
122  pos->PostInsert( unit );
123 }
void UnitCollection::FastIterator::preinsert ( Unit unit)
inline

inserts in front of current

Definition at line 252 of file oldcollection.h.

253  {
254  pos->next = new UnitListNode( unit, pos->next );
255  }
void UnitCollection::FastIterator::remove ( )

removes something after pos. eg the first valid unit. or current()

Definition at line 140 of file oldcollection.cpp.

141 {
142  pos->Remove();
143 }

The documentation for this class was generated from the following files: