corelinux::CoreLinuxIterator< TraverseType, ElementType > Class Template Reference

The CoreLinuxIterator provides a way to access the elements of any of the non-associative STL collections. More...

`#include <CoreLinuxIterator.hpp>`

## Public Member Functions

| throw (InvalidIteratorException)

Default constructor

Exceptions

  InvalidIteratorException | - the CoreLinuxIterator requires being constructed with a valid collection.

| CoreLinuxIterator (TraverseType aBegin, TraverseType aEnd)
| Initializing constructor. More...
| CoreLinuxIterator (const CoreLinuxIterator &aRef)
| Copy constructor. More...
virtual | ~CoreLinuxIterator (void)
| Destructor.
CoreLinuxIterator & | operator= (const CoreLinuxIterator &aRef)
| Assignment operator. More...
bool | operator== (const CoreLinuxIterator &aRef) const
| Equality operator. More...
virtual bool | isValid (void) const
| isValid implementation for determining if the current position points to a valid EntityType instance More...
virtual ElementType | getElement (void) const throw (IteratorBoundsException)
| getElement returns the ElementType instance that is currently managed by the CoreLinuxIterator More...
virtual void | setFirst (void)
| Set iterator to first element.
virtual void | setNext (void) throw (IteratorBoundsException)

Set iterator to next element

Exceptions

  IteratorBoundsException | if attempt to position past end of elements.

virtual void | setPrevious (void) throw (IteratorBoundsException)

Set iterator to previous element

Exceptions

  IteratorBoundsException | if attempt to position before begining of elements.

virtual void | setLast (void) throw (IteratorBoundsException)
| Set iterator to last element.
Public Member Functions inherited from corelinux::Iterator< ElementType >
| Iterator (void)
| Default constructor.
| Iterator (const Iterator &aRef)
| Copy constructor. More...
virtual | ~Iterator (void)
| Destructor.
Iterator & | operator= (const Iterator &)
| Assignment operator. More...
bool | operator== (const Iterator &aRef) const
| Equality operator. More...
Public Member Functions inherited from corelinux::CoreLinuxObject
| CoreLinuxObject (void)
| Default Constructor.
| CoreLinuxObject (CoreLinuxObjectCref)
| Copy Constructor. More...
virtual | ~CoreLinuxObject (void)
| Virtual Destructor.
CoreLinuxObjectRef | operator= (CoreLinuxObjectCref)
| Assignment operator overload. More...
bool | operator== (CoreLinuxObjectCref) const
| Equality operator overload. More...
bool | operator!= (CoreLinuxObjectCref) const
| Non-equality operator overload. More...

## Protected Attributes

TraverseType | theBegin
| The first position.
TraverseType | theEnd
| The last position.
TraverseType | theCurrent
| The current position.

## Detailed Description

### template<class TraverseType, class ElementType>
class corelinux::CoreLinuxIterator< TraverseType, ElementType >

The CoreLinuxIterator provides a way to access the elements of any of the non-associative STL collections.

By defining a CoreLinuxIterator with a CORELINUX_COLLECTION nameIterator definition and the Element Type.

## Constructor & Destructor Documentation

template<class TraverseType , class ElementType >

corelinux::CoreLinuxIterator< TraverseType, ElementType >::CoreLinuxIterator | ( | TraverseType | aBegin,
|  | TraverseType | aEnd
| ) |  |

inline

Initializing constructor.

Parameters

  TraverseType | aBegin first position
  TraverseType | aEnd last position

template<class TraverseType , class ElementType >

corelinux::CoreLinuxIterator< TraverseType, ElementType >::CoreLinuxIterator | ( | const CoreLinuxIterator< TraverseType, ElementType > & | aRef | ) |

inline

Copy constructor.

Parameters

  CoreLinuxIterator | const reference

## Member Function Documentation

template<class TraverseType , class ElementType >

virtual ElementType corelinux::CoreLinuxIterator< TraverseType, ElementType >::getElement | ( | void |  | ) | const
throw | ( | IteratorBoundsException
| ) |  |

inline virtual

getElement returns the ElementType instance that is currently managed by the CoreLinuxIterator

Returns
  ElementType

Exceptions

  IteratorBoundsException | if the Iterator is not positioned correctley.

Implements corelinux::Iterator< ElementType >.

References corelinux::CoreLinuxIterator< TraverseType, ElementType >::isValid(), and corelinux::CoreLinuxIterator< TraverseType, ElementType >::theCurrent.

template<class TraverseType , class ElementType >

virtual bool corelinux::CoreLinuxIterator< TraverseType, ElementType >::isValid | ( | void |  | ) | const

inline virtual

isValid implementation for determining if the current position points to a valid EntityType instance

Returns
  bool true if valid, false otherwise

Implements corelinux::Iterator< ElementType >.

References corelinux::CoreLinuxIterator< TraverseType, ElementType >::theCurrent, and corelinux::CoreLinuxIterator< TraverseType, ElementType >::theEnd.

Referenced by corelinux::CoreLinuxIterator< TraverseType, ElementType >::getElement().

template<class TraverseType , class ElementType >

CoreLinuxIterator& corelinux::CoreLinuxIterator< TraverseType, ElementType >::operator= | ( | const CoreLinuxIterator< TraverseType, ElementType > & | aRef | ) |

inline

Assignment operator.

Parameters

  CoreLinuxIterator | const reference

Returns
  CoreLinuxIterator reference

References corelinux::CoreLinuxIterator< TraverseType, ElementType >::theBegin, corelinux::CoreLinuxIterator< TraverseType, ElementType >::theCurrent, and corelinux::CoreLinuxIterator< TraverseType, ElementType >::theEnd.

template<class TraverseType , class ElementType >

bool corelinux::CoreLinuxIterator< TraverseType, ElementType >::operator== | ( | const CoreLinuxIterator< TraverseType, ElementType > & | aRef | ) | const

inline

Equality operator.

Parameters

  CoreLinuxIterator | const reference

Returns
  bool - true if the respective positions are equal.

References corelinux::CoreLinuxIterator< TraverseType, ElementType >::theBegin, and corelinux::CoreLinuxIterator< TraverseType, ElementType >::theEnd.

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

- CoreLinuxIterator.hpp

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium