CoreLinux++  0.4.32
Public Member Functions | List of all members
corelinux::Iterator< ElementType > Class Template Referenceabstract

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

#include <Iterator.hpp>

Public Member Functions

 Iterator (void)
 Default constructor.
 
 Iterator (const Iterator &aRef)
 Copy constructor. More...
 
virtual ~Iterator (void)
 Destructor.
 
Iteratoroperator= (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

Exceptions
IteratorBoundsExceptionif attempt to position past end of elements.

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

Exceptions
IteratorBoundsExceptionif attempt to position before begining of elements.

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

Exceptions
IteratorBoundsExceptionif it is the iterator is over an empty collection.

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

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
Iteratorconst reference

Member Function Documentation

template<class ElementType>
virtual ElementType corelinux::Iterator< ElementType >::getElement ( void  ) const
throw (IteratorBoundsException
)
pure virtual
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 >.

Referenced by corelinux::Subject::notifyAllObservers(), corelinux::Subject::notifyObservers(), corelinux::Mediator::operator==(), and corelinux::Iterator< ElementType >::operator==().

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

Assignment operator.

Parameters
Iteratorconst reference
Returns
Iterator reference
template<class ElementType>
bool corelinux::Iterator< ElementType >::operator== ( const Iterator< ElementType > &  aRef) const
inline

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

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