Iterator.hpp
#if !defined(__ITERATOR_HPP)
#define __ITERATOR_HPP
/*
CoreLinux++
Copyright (C) 2000 CoreLinux Consortium
The CoreLinux++ Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The CoreLinux++ Library Library is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined(__COMMON_HPP)
#include <Common.hpp>
#endif
#include <IteratorBoundsException.hpp>
namespace corelinux
{
DECLARE_CLASS( IteratorBoundsException );
DECLARE_CLASS( InvalidIteratorException );
template< class ElementType >
class Iterator : public CoreLinuxObject
{
public:
//
// Constructors and destructor
//
Iterator( void )
:
CoreLinuxObject()
{
; // do nothing
}
Iterator( const Iterator &aRef )
:
CoreLinuxObject( aRef )
{
; // do nothing
}
virtual ~Iterator( void )
{
; // do nothing
}
//
// Operator overloads
//
Iterator & operator=( const Iterator & )
{
return (*this);
}
bool operator==( const Iterator & aRef ) const
{
return (this == &aRef);
}
//
// Accessors
//
virtual bool isValid( void ) const = 0;
virtual ElementType getElement( void )
const throw(IteratorBoundsException) = 0;
//
// Mutators
//
virtual void setFirst( void ) = 0;
virtual void setNext( void )
throw(IteratorBoundsException) = 0;
virtual void setPrevious( void )
throw(IteratorBoundsException) = 0;
virtual void setLast( void )
throw(IteratorBoundsException) = 0;
};
}
#endif // if !defined(__ITERATOR_HPP)
/*
Common rcs information do not modify
$Author: prudhomm $
$Revision: 1.2 $
$Date: 2000/08/31 22:52:20 $
$Locker: $
*/
corelinux::IteratorBoundsException
IteratorBoundsException is thrown when a Iterator has position before the begining or past the end po...
Definition: IteratorBoundsException.hpp:44
corelinux::Iterator::Iterator
Iterator(void)
Default constructor.
Definition: Iterator.hpp:54
corelinux::Iterator::setFirst
virtual void setFirst(void)=0
Set iterator to first element.
corelinux
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
corelinux::Iterator::setLast
virtual void setLast(void)=0
Set iterator to last element if it is the iterator is over an empty collection.
corelinux::Iterator::Iterator
Iterator(const Iterator &aRef)
Copy constructor.
Definition: Iterator.hpp:66
corelinux::Iterator::~Iterator
virtual ~Iterator(void)
Destructor.
Definition: Iterator.hpp:75
corelinux::Iterator
The Iterator provides a way to access the elements of an collection type sequentially without exposin...
Definition: Iterator.hpp:44
corelinux::CoreLinuxObject
An CoreLinuxObject is a base class for the library.
Definition: CoreLinuxObject.hpp:39
corelinux::Iterator::operator==
bool operator==(const Iterator &aRef) const
Equality operator.
Definition: Iterator.hpp:101
corelinux::Iterator::isValid
virtual bool isValid(void) const =0
isValid abstract interface for implementation to determine if the current position points to a valid ...
corelinux::Iterator::getElement
virtual ElementType getElement(void) const =0
getElement returns the ElementType instance that is currently pointed to by the Iterator ...
corelinux::Iterator::setNext
virtual void setNext(void)=0
Set iterator to next element if attempt to position past end of elements.
corelinux::Iterator::operator=
Iterator & operator=(const Iterator &)
Assignment operator.
Definition: Iterator.hpp:90
corelinux::Iterator::setPrevious
virtual void setPrevious(void)=0
Set iterator to previous element if attempt to position before begining of elements.

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