Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

SequenceIterator Class Reference

Base class for all sequence iterators. More...

#include <sequenceiterator.hpp>

Inheritance diagram for SequenceIterator:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SequenceIterator ()
 Constructor.
virtual ~SequenceIterator ()
 Destructor.
virtual bool hasNextTaskId ()
 Returns if there are more tasks that have to be executed.
virtual int getNextTaskId ()
 Returns the id of the next task to be executed and stores the task id in previousIds vector.
const vector< int > & getPreviousIdVector ()
 Returns a reference to the vector storing previously returned task ids.

Protected Attributes

vector< int > previousIds
 Vector which stores all previously returned task ids.

Detailed Description

Base class for all sequence iterators.

The main purpose of a sequence iterator is to return if there are more tasks to be executed and to return the task id of the next task. Users may use this class as base for implementing their own iterators by overwriting the public methods hasNextTaskId() and getNextTaskId() in a derived class. This makes loops, branches and jumps between multiple sequence files possible.

Furthermore a history of all returned task ids is kept as a vector of integers. This vector can be accessed - though not altered - via the public method getPreviousIdVector(). Derived classes can access previousIds directly.

Users who do not want to implement a own iterator find a suitable simple implementation in DefaultSequenceIterator.

Definition at line 42 of file sequenceiterator.hpp.


Constructor & Destructor Documentation

SequenceIterator::SequenceIterator  ) 
 

Constructor.

Definition at line 23 of file sequenceiterator.cpp.

SequenceIterator::~SequenceIterator  )  [virtual]
 

Destructor.

Definition at line 30 of file sequenceiterator.cpp.


Member Function Documentation

int SequenceIterator::getNextTaskId  )  [virtual]
 

Returns the id of the next task to be executed and stores the task id in previousIds vector.

Returns:
task id or -1 if there are no more tasks
Note:
The implementation of this method in this class always returns -1.

Reimplemented in DefaultSequenceIterator.

Definition at line 49 of file sequenceiterator.cpp.

Referenced by Scheduler::schedule().

const vector< int > & SequenceIterator::getPreviousIdVector  ) 
 

Returns a reference to the vector storing previously returned task ids.

Returns:
reference to the vector
Definition at line 57 of file sequenceiterator.cpp.

References previousIds.

bool SequenceIterator::hasNextTaskId  )  [virtual]
 

Returns if there are more tasks that have to be executed.

Returns:
true if there are more tasks that have to be executed, else false
Note:
The implementation of this method in this class always returns false.

Reimplemented in DefaultSequenceIterator.

Definition at line 39 of file sequenceiterator.cpp.

Referenced by Scheduler::schedule().


Member Data Documentation

vector<int> SequenceIterator::previousIds [protected]
 

Vector which stores all previously returned task ids.

Definition at line 52 of file sequenceiterator.hpp.

Referenced by getPreviousIdVector().


The documentation for this class was generated from the following files:
Generated on Fri Dec 17 14:54:31 2004 for Psychological Test Framework by doxygen 1.3.8