corelinux::Iterator< ElementType > Class Template Reference

The Iterator provides a way to access the elements of an collection type sequentially without exposing its underlying representation. More...

#include <Iterator.hpp>

Inheritance diagram for corelinux::Iterator< ElementType >:

corelinux::CoreLinuxObject corelinux::AssociativeIterator< KeyType, ElementType > corelinux::CoreLinuxIterator< TraverseType, ElementType > corelinux::CoreLinuxAssociativeIterator< TraverseType, KeyType, ElementType > List of all members.

Public Member Functions

 Iterator (void)
 Default constructor.
 Iterator (const Iterator &aRef)
 Copy constructor.
virtual ~Iterator (void)
 Destructor.
Iteratoroperator= (const Iterator &)
 Assignment operator.
bool operator== (const Iterator &aRef) const
 Equality operator.
virtual bool isValid (void) const =0
 isValid abstract interface for implementation to determine if the current position points to a valid EntityType instance
virtual ElementType getElement (void) const =0 throw (IteratorBoundsException)
 getElement returns the ElementType instance that is currently pointed to by the Iterator
virtual void setFirst (void)=0
 Set iterator to first element.
virtual void setNext (void)=0 throw (IteratorBoundsException)
 Set iterator to next element
Exceptions:
IteratorBoundsException if attempt to position past end of elements.

virtual void setPrevious (void)=0 throw (IteratorBoundsException)
 Set iterator to previous element
Exceptions:
IteratorBoundsException if attempt to position before begining of elements.

virtual void setLast (void)=0 throw (IteratorBoundsException)
 Set iterator to last element
Exceptions:
IteratorBoundsException if it is the iterator is over an empty collection.


Detailed Description

template<class ElementType>
class corelinux::Iterator< ElementType >

The Iterator provides a way to access the elements of an collection type sequentially without exposing its underlying representation.

The implementation requires a template argument that describes the ElementType being iterated over.


Constructor & Destructor Documentation

template<class ElementType>
corelinux::Iterator< ElementType >::Iterator const Iterator< ElementType > &  aRef  )  [inline]
 

Copy constructor.

Parameters:
Iterator const reference


Member Function Documentation

template<class ElementType>
virtual ElementType corelinux::Iterator< ElementType >::getElement void   )  const throw (IteratorBoundsException) [pure virtual]
 

getElement returns the ElementType instance that is currently pointed to by the Iterator

Returns:
ElementType
Exceptions:
IteratorBoundsException if the Iterator is not positioned correctley.

Implemented in corelinux::CoreLinuxAssociativeIterator< TraverseType, KeyType, ElementType >, and corelinux::CoreLinuxIterator< TraverseType, ElementType >.

template<class ElementType>
virtual bool corelinux::Iterator< ElementType >::isValid void   )  const [pure virtual]
 

isValid abstract interface for implementation to determine if the current position points to a valid EntityType instance

Returns:
bool true if valid, false otherwise

Implemented in corelinux::CoreLinuxAssociativeIterator< TraverseType, KeyType, ElementType >, and corelinux::CoreLinuxIterator< TraverseType, ElementType >.

template<class ElementType>
Iterator& corelinux::Iterator< ElementType >::operator= const Iterator< ElementType > &   )  [inline]
 

Assignment operator.

Parameters:
Iterator const reference
Returns:
Iterator reference

template<class ElementType>
bool corelinux::Iterator< ElementType >::operator== const Iterator< ElementType > &  aRef  )  const [inline]
 

Equality operator.

Parameters:
Iterator const reference
Returns:
bool - true if instances are equal


The documentation for this class was generated from the following file:
This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium