idaeim studio
 PVL: Parameter Value Language

Public Member Functions | Friends
Vectal< T >::Iterator Class Reference

An Iterator provides a random access iterator for a Vectal. More...

#include <Vectal.hh>

List of all members.

Public Member Functions

 Iterator ()
 Constructs an uninitialized Iterator.
 Iterator (const Iterator &other_iterator)
 Constructs a copy of another Iterator.
 Iterator (const Base_iterator &base_iterator)
 Constructs an Iterator from a Base_iterator.
 operator Base_iterator () const
 Type conversion operator to Base_iterator.
bool operator!= (const Iterator &other_iterator) const
 Inequality operator.
T & operator* () const
 Dereference operator.
Iterator operator+ (int distance) const
 Provides an Iterator moved forward some distance from the position of this Iterator.
Iteratoroperator++ ()
 Pre-increment operator.
Iterator operator++ (int)
 Post-increment operator.
Iteratoroperator+= (int distance)
 Moves the Iterator position forward some distance from the position of this Iterator.
Iterator operator- (int distance) const
 Provides an Iterator moved backward some distance from the position of this Iterator.
Iterator::difference_type operator- (const Iterator &other_iterator) const
 Distance operator.
Iteratoroperator-- ()
 Pre-decrement operator.
Iterator operator-- (int)
 Post-decrement operator.
Iteratoroperator-= (int distance)
 Moves the Iterator position backward some distance from the position of this Iterator.
T * operator-> () const
 Member dereference (pointer) operator.
bool operator< (const Iterator &other_iterator) const
 Less than operator.
bool operator<= (const Iterator &other_iterator) const
 Less than or equal to operator.
Iteratoroperator= (const Iterator &other_iterator)
 Assignment operator.
bool operator== (const Iterator &other_iterator) const
 Equality operator.
bool operator> (const Iterator &other_iterator) const
 Greater than operator.
bool operator>= (const Iterator &other_iterator) const
 Greater than or equal to operator.
T & operator[] (size_type index) const
 Array reference operator.

Friends

class Const_Iterator
bool operator!= (const Base_iterator &base_iterator, const Iterator &other_iterator)
 Inequality operator with a Base_iterator.
class Reverse_Iterator

Detailed Description

template<typename T>
class idaeim::Vectal< T >::Iterator

An Iterator provides a random access iterator for a Vectal.

An Iterator operates the same as the Base_iterator - an interator over a vector of pointer objects - that provides the backing implementation, except that reference semantics are provided to the object pointed to rather that to the pointer.


Constructor & Destructor Documentation

Iterator ( ) [inline]

Constructs an uninitialized Iterator.

N.B.: The iterator is invalid until assigned.

Iterator ( const Iterator other_iterator) [inline]

Constructs a copy of another Iterator.

Parameters:
other_iteratorAn Iterator to be copied.
Iterator ( const Base_iterator base_iterator) [inline]

Constructs an Iterator from a Base_iterator.

Implements implicit type conversion.

Parameters:
base_iteratorA Base_iterator from which to construct this Iterator.

Member Function Documentation

Iterator& operator= ( const Iterator other_iterator) [inline]

Assignment operator.

Parameters:
other_iteratorAn Iterator to be assigned to this Iterator.
Returns:
This Iterator.
operator Base_iterator ( ) const [inline]

Type conversion operator to Base_iterator.

The backing Base_iterator for this Iterator is returned.

T& operator* ( ) const [inline]

Dereference operator.

Reference semantics are implemented, even though the backing Base_iterator operates on pointer objects.

Returns:
A reference to the value at this Iterator's current position.
T* operator-> ( ) const [inline]

Member dereference (pointer) operator.

The semantics for a container of objects of type T are implemented, even though the backing Base_iterator operates on a container of pointers to objects of type T.

Returns:
A pointer to the value at this Iterator's current position.
T& operator[] ( size_type  index) const [inline]

Array reference operator.

Parameters:
indexAn element index of a value in the Vectal. N.B.: The validity of the index is not checked.
Returns:
A reference to the value at the Vectal index.
Iterator& operator++ ( ) [inline]

Pre-increment operator.

Returns:
A reference to this Iterator after its position has been incremented.
Iterator operator++ ( int  ) [inline]

Post-increment operator.

This Iterator is incremented to the next position after a copy of this Iterator has been made.

Returns:
A copy of this Iterator at its original position.
Iterator& operator-- ( ) [inline]

Pre-decrement operator.

Returns:
A reference to this Iterator after its position has been decremented.
Iterator operator-- ( int  ) [inline]

Post-decrement operator.

This Iterator is decremented to the previous position after a copy of this Iterator has been made.

Returns:
A copy of this Iterator at its original position.
Iterator& operator+= ( int  distance) [inline]

Moves the Iterator position forward some distance from the position of this Iterator.

Parameters:
distanceThe distance (number of values) to move.
Returns:
This Iterator.
Iterator operator+ ( int  distance) const [inline]

Provides an Iterator moved forward some distance from the position of this Iterator.

A copy of this Iterator is made and the copy is repositioned.

Parameters:
distanceThe distance - number of values - to move the Iterator copy position.
Returns:
A copy of this Iterator at the new position.
Iterator& operator-= ( int  distance) [inline]

Moves the Iterator position backward some distance from the position of this Iterator.

Parameters:
distanceThe distance - number of values - to move.
Returns:
This Iterator.
Iterator operator- ( int  distance) const [inline]

Provides an Iterator moved backward some distance from the position of this Iterator.

A copy of this Iterator is made and the copy is repositioned.

Parameters:
distanceThe distance - number of values - to move.
Returns:
A copy of this Iterator at the new position.
Iterator::difference_type operator- ( const Iterator other_iterator) const [inline]

Distance operator.

Parameters:
other_iteratorAnother Iterator from which to obtain the distance from this Iterator.
Returns:
The distance, in values, between this and the other Iterator.
bool operator== ( const Iterator other_iterator) const [inline]

Equality operator.

Parameters:
other_iteratorAnother Iterator to compare with this Iterator.
Returns:
true if the Iterators are equal; false otherwise.
bool operator!= ( const Iterator other_iterator) const [inline]

Inequality operator.

Parameters:
other_iteratorAnother Iterator to compare with this Iterator.
Returns:
true if the Iterators are not equal; false otherwise.
bool operator< ( const Iterator other_iterator) const [inline]

Less than operator.

Parameters:
other_iteratorAnother Iterator to compare with this Iterator.
Returns:
true if this Iterator is at a position before (less than) the position of the other Iterator; false otherwise.
bool operator<= ( const Iterator other_iterator) const [inline]

Less than or equal to operator.

Parameters:
other_iteratorAnother Iterator to compare with this Iterator.
Returns:
true if this Iterator is not at a position after the position of the other Iterator; false otherwise.
bool operator> ( const Iterator other_iterator) const [inline]

Greater than operator.

Parameters:
other_iteratorAnother Iterator to compare with this Iterator.
Returns:
true if this Iterator is at a position after (greater than) the position of the other Iterator; false otherwise.
bool operator>= ( const Iterator other_iterator) const [inline]

Greater than or equal to operator.

Parameters:
other_iteratorAnother Iterator to compare with this Iterator.
Returns:
true if this Iterator is not at a position before the position of the other Iterator; false otherwise.

Friends And Related Function Documentation

friend class Const_Iterator [friend]
friend class Reverse_Iterator [friend]
bool operator!= ( const Base_iterator base_iterator,
const Iterator other_iterator 
) [friend]

Inequality operator with a Base_iterator.

Parameters:
base_iteratorA Base_iterator to compare with another Iterator.
other_iteratorAnother Iterator to compare with the Base_iterator.
Returns:
true if the iterators are not equal; false otherwise.

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