3 // Copyright (C) 2005 Free Software Foundation, Inc.
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
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING. If not, write to the Free
18 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 // As a special exception, you may use this file as part of a free software
22 // library without restriction. Specifically, if other files instantiate
23 // templates or use macros or inline functions from this file, or you compile
24 // this file and link it with other files to produce an executable, this
25 // file does not by itself cause the resulting executable to be covered by
26 // the GNU General Public License. This exception does not however
27 // invalidate any other reasons why the executable file might be covered by
28 // the GNU General Public License.
30 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
32 // Permission to use, copy, modify, sell, and distribute this software
33 // is hereby granted without fee, provided that the above copyright
34 // notice appears in all copies, and that both that copyright notice and
35 // this permission notice appear in supporting documentation. None of
36 // the above authors, nor IBM Haifa Research Laboratories, make any
37 // representation about the suitability of this software for any
38 // purpose. It is provided "as is" without express or implied warranty.
42 * Contains an it_ for an adapter of mapping levels.
45 #define PB_ASSOC_IT_C_DEC \
52 #define PB_ASSOC_OIT_T_DEC \
53 template<class OIt0, class OIt1, bool OHas_Data, bool OConst>
55 #define PB_ASSOC_OIT_C_DEC \
62 template<class It0, class It1, bool Has_Data, bool Const>
67 typedef typename it_value_type_traits_t::value_type value_type;
69 typedef typename it_value_type_traits_t::reference reference;
72 typename it_value_type_traits_t::const_reference
75 typedef typename it_value_type_traits_t::pointer pointer;
77 typedef typename it_value_type_traits_t::const_pointer const_pointer;
83 It1 it1 = It1()) : m_it0(it0),
89 it_(const PB_ASSOC_IT_C_DEC& r_other) : m_it0(r_other.m_it0),
90 m_end_it0(r_other.m_end_it0),
96 it_(const PB_ASSOC_OIT_C_DEC& r_other) : m_it0(r_other.m_it0),
97 m_end_it0(r_other.m_end_it0),
102 operator==(const PB_ASSOC_IT_C_DEC& r_other) const
104 if (m_it0 != r_other.m_it0)
107 if (m_it0 == m_end_it0)
110 return (m_it1 == r_other.m_it1);
114 operator!=(const PB_ASSOC_IT_C_DEC& r_other) const
116 return (!operator==(r_other));
119 inline PB_ASSOC_IT_C_DEC&
124 if (m_it1 == m_it0->second.end())
129 while (m_it0 != m_end_it0&& m_it0->second.empty());
131 if (m_it0 != m_end_it0&& !m_it0->second.empty())
132 m_it1 = m_it0->second.begin();
137 inline PB_ASSOC_IT_C_DEC
140 PB_ASSOC_IT_C_DEC ret =* this;
150 it_value_type_traits_t::make_valid(m_value_type_holder, m_it0->first, * m_it1);
152 return (it_value_type_traits_t::recast(m_value_type_holder));
158 // Tmp Ami PB_ASSOC_STATIC_ASSERT(non_const, !Const);
160 it_value_type_traits_t::make_valid(m_value_type_holder, m_it0->first, * m_it1);
162 return (it_value_type_traits_t::recast(m_value_type_holder));
165 inline const_reference
168 return (*operator->());
174 PB_ASSOC_STATIC_ASSERT(non_const, !Const);
176 return (*operator->());
185 int_to_type<Has_Data> m_has_data;
188 mutable typename it_value_type_traits_t::value_type_holder m_value_type_holder;
191 #undef PB_ASSOC_IT_C_DEC
193 #undef PB_ASSOC_OIT_T_DEC
195 #undef PB_ASSOC_OIT_C_DEC