CoreLinux++  0.4.32
AssociativeIterator.hpp
1 #if !defined(__ASSOCIATIVEITERATOR_HPP)
2 #define __ASSOCIATIVEITERATOR_HPP
3 
4 /*
5  CoreLinux++
6  Copyright (C) 2000 CoreLinux Consortium
7 
8  The CoreLinux++ Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12 
13  The CoreLinux++ Library Library is distributed in the hope that it will
14  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public
19  License along with the GNU C Library; see the file COPYING.LIB. If not,
20  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA 02111-1307, USA.
22 */
23 
24 #if !defined(__COMMON_HPP)
25 #include <Common.hpp>
26 #endif
27 
28 #if !defined(__ITERATOR_HPP)
29 #include <Iterator.hpp>
30 #endif
31 
32 namespace corelinux
33 {
34 
43  template< class KeyType, class ElementType >
44  class AssociativeIterator : public Iterator<ElementType>
45  {
46  public:
47 
48  //
49  // Constructors and destructor
50  //
51 
53 
55  :
56  Iterator<ElementType>()
57  {
58  ; // do nothing
59  }
60 
67  :
68  Iterator<ElementType>( aRef )
69  {
70  ; // do nothing
71  }
72 
74 
75  virtual ~AssociativeIterator( void )
76  {
77  ; // do nothing
78  }
79 
80  //
81  // Operator overloads
82  //
83 
91  {
92  return (*this);
93  }
94 
101  bool operator==( const AssociativeIterator & aRef ) const
102  {
103  return (this == &aRef);
104  }
105 
106 
107  //
108  // Accessors
109  //
110 
119  virtual KeyType getKey( void )
120  const throw(IteratorBoundsException) = 0;
121 
122  };
123 }
124 
125 #endif // if !defined(__ASSOCIATIVEITERATOR_HPP)
126 
127 /*
128  Common rcs information do not modify
129  $Author: prudhomm $
130  $Revision: 1.1 $
131  $Date: 2000/04/23 20:43:13 $
132  $Locker: $
133 */
134 
135 
AssociativeIterator(const AssociativeIterator &aRef)
Copy constructor.
Definition: AssociativeIterator.hpp:66
IteratorBoundsException is thrown when a Iterator has position before the begining or past the end po...
Definition: IteratorBoundsException.hpp:44
virtual ~AssociativeIterator(void)
Destructor.
Definition: AssociativeIterator.hpp:75
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
virtual KeyType getKey(void) const =0
getKey returns the KeyType instance that is currently pointed to by the AssociativeIterator ...
The AssociativeIterator that extends Iterator to include the interface for describing an associative ...
Definition: AssociativeIterator.hpp:44
The Iterator provides a way to access the elements of an collection type sequentially without exposin...
Definition: Iterator.hpp:44
AssociativeIterator(void)
Default constructor.
Definition: AssociativeIterator.hpp:54
bool operator==(const AssociativeIterator &aRef) const
Equality operator.
Definition: AssociativeIterator.hpp:101
AssociativeIterator & operator=(const AssociativeIterator &)
Assignment operator.
Definition: AssociativeIterator.hpp:90

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