Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / basic / HashIterator2D.h
bloba5732f43805be57712f4f29d7cf98b902fc41ba1
1 /*
2 * $Revision: 2523 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of class HashIterator2D.
12 * This class implements an iterator for the HashArray2D.
14 * \author René Weiskircher
16 * \par License:
17 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * \par
20 * Copyright (C)<br>
21 * See README.txt in the root directory of the OGDF installation for details.
23 * \par
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU General Public License
26 * Version 2 or 3 as published by the Free Software Foundation;
27 * see the file LICENSE.txt included in the packaging of this file
28 * for details.
30 * \par
31 * This program is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
36 * \par
37 * You should have received a copy of the GNU General Public
38 * License along with this program; if not, write to the Free
39 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
40 * Boston, MA 02110-1301, USA.
42 * \see http://www.gnu.org/copyleft/gpl.html
43 ***************************************************************/
46 #ifdef _MSC_VER
47 #pragma once
48 #endif
51 #ifndef OGDF_HASHITERATOR2D_H
52 #define OGDF_HASHITERATOR2D_H
55 namespace ogdf {
58 /**
59 * \brief Const-iterator for 2D-hash arrays.
62 template< class I1_, class I2_, class E_,
63 class Hash1_ = DefHashFunc<I1_>,
64 class Hash2_ = DefHashFunc<I2_> >
65 class HashConstIterator2D :
66 private HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >
68 public:
69 //! Creates an (invalid) iterator.
70 HashConstIterator2D() { }
72 //! Copy constructor.
73 HashConstIterator2D(const HashConstIterator2D<I1_,I2_,E_,Hash1_,Hash2_> &it)
74 : HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >(it) { }
76 //! Copy constructor (from HashConstIterator).
77 HashConstIterator2D(const HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> > &it)
78 : HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >(it) { }
80 //! Assignemnt operator.
81 HashConstIterator2D<I1_,I2_,E_,Hash1_,Hash2_> &
82 operator=(const HashConstIterator2D<I1_,I2_,E_,Hash1_,Hash2_> &it)
84 HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >::operator=(it);
85 return *this;
88 //! Returns true iff the iterator points to an element.
89 bool valid() const {
90 return HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >::valid();
93 //! Returns the first key of the hash element pointed to.
94 const I1_ &key1() const {
95 return HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >::key().x1();
98 //! Returns the second key of the hash element pointed to.
99 const I2_ &key2() const {
100 return HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >::key().x2();
103 //! Returns the information of the element pointed to.
104 const E_ &info() const {
105 return HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >::info();
108 //! Sets the iterator to the next element in the 2D-hash array.
109 HashConstIterator2D<I1_,I2_,E_,Hash1_,Hash2_> &operator++() {
110 HashConstIterator<Tuple2<I1_,I2_>,E_,HashFuncTuple<I1_,I2_,Hash1_,Hash2_> >::operator++();
111 return *this;
119 #endif