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

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

# Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container > Class Template Reference

`#include <Iterators.h>`

Inheritance diagram for Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >:

[legend]
Collaboration diagram for Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >:

[legend]
List of all members.

## Public Types
typedef IteratorTraits< t_Iterand >::difference_type | difference_type
typedef IteratorTraits< t_Iterand >::value_type | value_type
| The Iterand value.
typedef IteratorTraits< t_Iterand >::pointer | pointer
| A pointer to the iterand.
typedef IteratorTraits< t_Iterand >::reference | reference
| A referance to the iterand.
typedef IteratorTraits< t_Iterand >::const_reference | const_reference
| A constant reference.
typedef IteratorTemplate< t_Iterand, t_Container > | iterator
| This iterator type.
## Public Member Functions
| IteratorTemplate ()
| IteratorTemplate (t_Container *container, unsigned int myIndex=0)
template<typename to_Iterand>
| IteratorTemplate (const IteratorTemplate< to_Iterand, t_Container > &other)
reference | operator * () const
pointer | operator-> () const
iterator & | operator++ ()
iterator | operator++ (int)
iterator & | operator-- ()
iterator | operator-- (int)
reference | operator[] (const difference_type &offset) const
iterator & | operator+= (const difference_type &offset)
iterator | operator+ (const difference_type &offset) const
iterator & | operator-= (const difference_type &offset)
iterator | operator- (const difference_type &offset) const
const_reference | base () const
template<typename to_Iterand>
bool | operator== (const IteratorTemplate< to_Iterand, t_Container > &other) const
template<typename to_Iterand>
bool | operator!= (const IteratorTemplate< to_Iterand, t_Container > &other) const
## Friends
class | IteratorTemplate

## Detailed Description

### template<typename t_Iterand, typename t_Container>
class Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >

A generic template form of the iterators that re-uses iterator code.

Definition at line 268 of file Iterators.h.

## Member Typedef Documentation

template<typename t_Iterand, typename t_Container>

typedef IteratorTraits<t_Iterand>::difference_type Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::difference_type

The type of value that one can add to change the object that this iterator points to.

Definition at line 278 of file Iterators.h.

## Constructor & Destructor Documentation

template<typename t_Iterand, typename t_Container>

Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::IteratorTemplate | ( |  | ) | `[inline]`

Creates a new empty iterator

Definition at line 293 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::IteratorTemplate | ( | t_Container * | container,
|  | unsigned int | myIndex = `0` |
| ) |  |  | `[inline]`

Creates a new iterator on the object container starting at the specified index.

Parameters:

  | container | The container that contains the appropriate data.
  | myIndex | The index of the data within the container.

Definition at line 304 of file Iterators.h.

template<typename t_Iterand, typename t_Container>
template<typename to_Iterand>

Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::IteratorTemplate | ( | const IteratorTemplate< to_Iterand, t_Container > & | other | ) | `[inline]`

Creates a new iterator based on the data from the other iterator.

Parameters:

  | other | The iterator providing the initial iterator data.

Definition at line 316 of file Iterators.h.

## Member Function Documentation

template<typename t_Iterand, typename t_Container>

reference Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator * | ( |  | ) | const`[inline]`

Returns a reference to the current object.

Definition at line 326 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

pointer Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator-> | ( |  | ) | const`[inline]`

Returns a pointer to the object pointed to by this iterator.

Definition at line 333 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator& Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator++ | ( |  | ) | `[inline]`

Increments this iterator to point to the next element in the array and then returns a reference to this object, pointing to the next element.

Reimplemented from Mers::Utils::Containers::IConstantIterator.

Definition at line 342 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator++ | ( | int |  | ) | `[inline]`

Post-increments this iterator to point to the next element in the array. It then returns a copy of the iterator pointing to the previous element.

Parameters:

  | v | Presence of this parameter indicate that this is a post-increment function rather than a pre-increment function.

Reimplemented from Mers::Utils::Containers::IConstantIterator.

Definition at line 356 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator& Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator-- | ( |  | ) | `[inline]`

Decrements this iterator to point to the previous element in the array. It then returns a reference to this object, which points to the previous element.

Reimplemented from Mers::Utils::Containers::IConstantIterator.

Definition at line 367 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator-- | ( | int |  | ) | `[inline]`

Post-decrements this iterator to point to the previous element in the array. It then returns a copy of the iterator pointing to the original element.

Parameters:

  | v | Presence of this parameter indicate that this is a post-decrement function rather than a pre-decrement function.

Reimplemented from Mers::Utils::Containers::IConstantIterator.

Definition at line 381 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

reference Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator[] | ( | const difference_type & | offset | ) | const`[inline]`

Returns an element at a relative index from the current index.

Parameters:

  | offset | The offset from the current index desired.

Definition at line 393 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator& Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator+= | ( | const difference_type & | offset | ) | `[inline]`

Increments the iterator by the specified amount.

Parameters:

  | ival | The offset to add to the current index.

Definition at line 403 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator+ | ( | const difference_type & | offset | ) | const`[inline]`

Returns an interator this is incremented from this iterator by the specified amount.

Parameters:

  | ival | The offset to add to the current index.

Definition at line 414 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator& Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator-= | ( | const difference_type & | offset | ) | `[inline]`

Decrements the iterator by the specified amount.

Parameters:

  | ival | The offset to subtract from the current index.

Definition at line 425 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

iterator Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator- | ( | const difference_type & | offset | ) | const`[inline]`

Returns an interator this is decremented from this iterator by the specified amount.

Parameters:

  | ival | The offset to subtract from the current index.

Definition at line 436 of file Iterators.h.

template<typename t_Iterand, typename t_Container>

const_reference Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::base | ( |  | ) | const`[inline]`

Returns a reference to the object.

Definition at line 445 of file Iterators.h.

template<typename t_Iterand, typename t_Container>
template<typename to_Iterand>

bool Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator== | ( | const IteratorTemplate< to_Iterand, t_Container > & | other | ) | const`[inline]`

Returns true if the two iterators point to the same data.

Parameters:

  | other | the other object being compared to this object.

Returns:
  true if the iterators are the same.

Definition at line 458 of file Iterators.h.

References Mers::Utils::Containers::IConstantIterator::operator==().

Here is the call graph for this function:

template<typename t_Iterand, typename t_Container>
template<typename to_Iterand>

bool Mers::Utils::Containers::IteratorTemplate< t_Iterand, t_Container >::operator!= | ( | const IteratorTemplate< to_Iterand, t_Container > & | other | ) | const`[inline]`

Returns false if the two iterators point to the same data.

Parameters:

  | other | the other object being compared to this object.

Returns:
  true if the iterators are different.

Definition at line 471 of file Iterators.h.

References Mers::Utils::Containers::IConstantIterator::operator!=().

Here is the call graph for this function:

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

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