- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Utils::Containers::VectorIterator< Container, Element > Class Template Reference

Iterator for Vector. More...

`#include <Vector.h>`

Collaboration diagram for Mers::Utils::Containers::VectorIterator< Container, Element >:

[legend]
List of all members.

## Public Member Functions
| VectorIterator (Container *myVector, size_type myIndex)
| Creates a new const iterator on the specified list with the given index.
bool | operator== (const VectorIterator &other) const
| Returns true if the two iterators point to the same data.
bool | operator!= (const VectorIterator &other) const
| Returns true if the two iterators do not point to the same data.
Element | operator * () const
Element | operator-> () const
VectorIterator & | operator++ ()
VectorIterator | operator++ (int)
VectorIterator & | operator-- ()
VectorIterator | operator-- (int)
VectorIterator & | operator+= (int value)
VectorIterator | operator+ (int value)
VectorIterator & | operator-= (int value)
VectorIterator | operator- (int value)
Element | operator[] (int value)
int | operator- (const VectorIterator &other)

## Detailed Description

### template<class Container, class Element>
class Mers::Utils::Containers::VectorIterator< Container, Element >

Iterator for Vector.

Definition at line 161 of file Vector.h.

## Member Function Documentation

template<class Container, class Element>

Element Mers::Utils::Containers::VectorIterator< Container, Element >::operator * | ( |  | ) | const`[inline]`

Returns a reference to the element pointed to by this iterator.

Exceptions:

  | out_of_range | if the iterator does not point to a valid element

Attention:
  Change from Base model v. 1: The operator returns a pointer to an object in the vector, rather than a direct reference to the object. Hence, the iterator conforms to the STL vector::iterator convention.

Definition at line 210 of file Vector.h.

template<class Container, class Element>

VectorIterator& Mers::Utils::Containers::VectorIterator< Container, Element >::operator++ | ( |  | ) | `[inline]`

Increments this iterator to point to the next element in the vector.

Returns:
  a reference to this object, which points to the next element

Definition at line 224 of file Vector.h.

template<class Container, class Element>

VectorIterator Mers::Utils::Containers::VectorIterator< Container, Element >::operator++ | ( | int |  | ) | `[inline]`

Post-incerements this iterator to point to the next element in the vector.

Returns:
  a copy of the iterator, which points to the element prior to incrementing

Definition at line 236 of file Vector.h.

template<class Container, class Element>

VectorIterator& Mers::Utils::Containers::VectorIterator< Container, Element >::operator-- | ( |  | ) | `[inline]`

Decrements this iterator to point to the previous element in the vector.

Returns:
  a reference to this object, which points to the previous element

Definition at line 247 of file Vector.h.

template<class Container, class Element>

VectorIterator Mers::Utils::Containers::VectorIterator< Container, Element >::operator-- | ( | int |  | ) | `[inline]`

Post-decrements this iterator to point to the previous element in the vector.

Returns:
  a copy of the iterator, which points to the element prior to decrementing

Definition at line 259 of file Vector.h.

template<class Container, class Element>

VectorIterator& Mers::Utils::Containers::VectorIterator< Container, Element >::operator+= | ( | int | value | ) | `[inline]`

Increments this iterator by the given value (which can be negative).

Returns:
  a reference to this object after it's been incremented.

Definition at line 270 of file Vector.h.

template<class Container, class Element>

VectorIterator Mers::Utils::Containers::VectorIterator< Container, Element >::operator+ | ( | int | value | ) | `[inline]`

Returns a copy of the iterator, incremented by the given amount.

Definition at line 279 of file Vector.h.

References Mers::Utils::Containers::VectorIterator< Container, Element >::VectorIterator().

Here is the call graph for this function:

template<class Container, class Element>

VectorIterator& Mers::Utils::Containers::VectorIterator< Container, Element >::operator-= | ( | int | value | ) | `[inline]`

Decrements this iterator by the given value (which can be negative).

Returns:
  a reference to this object after it's been decremented

Definition at line 288 of file Vector.h.

template<class Container, class Element>

VectorIterator Mers::Utils::Containers::VectorIterator< Container, Element >::operator- | ( | int | value | ) | `[inline]`

Returns a copy of the iterator, decremented by the given amount.

Definition at line 297 of file Vector.h.

References Mers::Utils::Containers::VectorIterator< Container, Element >::VectorIterator().

Here is the call graph for this function:

template<class Container, class Element>

int Mers::Utils::Containers::VectorIterator< Container, Element >::operator- | ( | const VectorIterator< Container, Element > & | other | ) | `[inline]`

Returns the difference between the indices of the two iterators. Throws invalid_argument exception (from standard C++ library) if the two iterators do not point to the same vector.

Definition at line 312 of file Vector.h.

References Mers::Utils::Containers::VectorIterator< Container, Element >::index, and Mers::Utils::Containers::VectorIterator< Container, Element >::vector.

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

- /Users/fpy/titan-1-5-MBARI/Mers/Utils/Containers/Vector.h