GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / toolchains / hndtools-arm-linux-2.6.36-uclibc-4.5.3 / arm-brcm-linux-uclibcgnueabi / include / c++ / 4.5.3 / ext / pb_ds / detail / binary_heap_ / const_iterator.hpp
blob9cb13f99cca9804a22be5fbd751c60e2667d63f0
1 // -*- C++ -*-
3 // Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 3, or (at your option) any later
9 // version.
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
25 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
27 // Permission to use, copy, modify, sell, and distribute this software
28 // is hereby granted without fee, provided that the above copyright
29 // notice appears in all copies, and that both that copyright notice
30 // and this permission notice appear in supporting documentation. None
31 // of the above authors, nor IBM Haifa Research Laboratories, make any
32 // representation about the suitability of this software for any
33 // purpose. It is provided "as is" without express or implied
34 // warranty.
36 /**
37 * @file const_iterator.hpp
38 * Contains an iterator class returned by the table's const find and insert
39 * methods.
42 #ifndef PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
43 #define PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
45 #include <ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp>
46 #include <debug/debug.h>
48 namespace __gnu_pbds
50 namespace detail
53 #define PB_DS_CLASS_C_DEC \
54 binary_heap_const_iterator_<Value_Type, Entry, Simple, Allocator>
56 #define PB_DS_BASE_C_DEC \
57 binary_heap_const_point_iterator_<Value_Type, Entry, Simple, Allocator>
59 // Const point-type iterator.
60 template<typename Value_Type,
61 typename Entry,
62 bool Simple,
63 class Allocator>
64 class binary_heap_const_iterator_ : public PB_DS_BASE_C_DEC
67 private:
68 typedef typename PB_DS_BASE_C_DEC::entry_pointer entry_pointer;
70 typedef PB_DS_BASE_C_DEC base_type;
72 public:
74 // Category.
75 typedef std::forward_iterator_tag iterator_category;
77 // Difference type.
78 typedef typename Allocator::difference_type difference_type;
80 // Iterator's value type.
81 typedef typename base_type::value_type value_type;
83 // Iterator's pointer type.
84 typedef typename base_type::pointer pointer;
86 // Iterator's const pointer type.
87 typedef typename base_type::const_pointer const_pointer;
89 // Iterator's reference type.
90 typedef typename base_type::reference reference;
92 // Iterator's const reference type.
93 typedef typename base_type::const_reference const_reference;
95 public:
97 inline
98 binary_heap_const_iterator_(entry_pointer p_e) : base_type(p_e)
99 { }
101 // Default constructor.
102 inline
103 binary_heap_const_iterator_()
106 // Copy constructor.
107 inline
108 binary_heap_const_iterator_(const PB_DS_CLASS_C_DEC& other) : base_type(other)
111 // Compares content to a different iterator object.
112 inline bool
113 operator==(const PB_DS_CLASS_C_DEC& other) const
115 return base_type::m_p_e == other.m_p_e;
118 // Compares content (negatively) to a different iterator object.
119 inline bool
120 operator!=(const PB_DS_CLASS_C_DEC& other) const
122 return base_type::m_p_e != other.m_p_e;
125 inline PB_DS_CLASS_C_DEC&
126 operator++()
128 _GLIBCXX_DEBUG_ASSERT(base_type::m_p_e != NULL);
129 inc();
130 return *this;
133 inline PB_DS_CLASS_C_DEC
134 operator++(int)
136 PB_DS_CLASS_C_DEC ret_it(base_type::m_p_e);
137 operator++();
138 return ret_it;
141 private:
142 void
143 inc()
144 { ++base_type::m_p_e; }
147 #undef PB_DS_CLASS_C_DEC
148 #undef PB_DS_BASE_C_DEC
149 } // namespace detail
150 } // namespace __gnu_pbds
152 #endif