Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

corelinux::Iterator 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::

corelinux::CoreLinuxObject corelinux::AssociativeIterator corelinux::CoreLinuxIterator corelinux::CoreLinuxAssociativeIterator List of all members.

Public Methods

 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...

virtual bool isValid (void) const=0
 isValid abstract interface for implementation to determine if the current position points to a valid EntityType instance. More...

virtual ElementType getElement (void) const=0 throw (IteratorBoundsException)
 getElement returns the ElementType instance that is currently pointed to by the Iterator. More...

virtual void setFirst (void)=0
 Set iterator to first element.

virtual void setNext (void)=0 throw (IteratorBoundsException)
 Set iterator to next element. More...

virtual void setPrevious (void)=0 throw (IteratorBoundsException)
 Set iterator to previous element. More...

virtual void setLast (void)=0 throw (IteratorBoundsException)
 Set iterator to last element. More...


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.

Reimplemented in corelinux::CoreLinuxAssociativeIterator, and corelinux::CoreLinuxIterator.

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

Reimplemented in corelinux::CoreLinuxAssociativeIterator, and corelinux::CoreLinuxIterator.

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

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

Set iterator to last element.

Exceptions:
IteratorBoundsException  if it is the iterator is over an empty collection

Reimplemented in corelinux::CoreLinuxAssociativeIterator, and corelinux::CoreLinuxIterator.

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

Set iterator to next element.

Exceptions:
IteratorBoundsException  if attempt to position past end of elements

Reimplemented in corelinux::CoreLinuxAssociativeIterator, and corelinux::CoreLinuxIterator.

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

Set iterator to previous element.

Exceptions:
IteratorBoundsException  if attempt to position before begining of elements

Reimplemented in corelinux::CoreLinuxAssociativeIterator, and corelinux::CoreLinuxIterator.


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