00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00048 #ifndef STLSOFT_INCL_STLSOFT_COLLECTIONS_HPP_ASSOCIATIVE_VALUE_SEQUENCE
00049 #define STLSOFT_INCL_STLSOFT_COLLECTIONS_HPP_ASSOCIATIVE_VALUE_SEQUENCE
00050
00051 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00052 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_ASSOCIATIVE_VALUE_SEQUENCE_MAJOR 2
00053 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_ASSOCIATIVE_VALUE_SEQUENCE_MINOR 1
00054 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_ASSOCIATIVE_VALUE_SEQUENCE_REVISION 1
00055 # define STLSOFT_VER_STLSOFT_COLLECTIONS_HPP_ASSOCIATIVE_VALUE_SEQUENCE_EDIT 25
00056 #endif
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00073 # include <stlsoft/stlsoft.h>
00074 #endif
00075 #ifndef STLSOFT_INCL_STLSOFT_ITERATORS_HPP_ASSOCIATIVE_SELECT_ITERATOR
00076 # include <stlsoft/iterators/associative_select_iterator.hpp>
00077 #endif
00078 #ifndef STLSOFT_INCL_STLSOFT_COLLECTIONS_UTIL_HPP_COLLECTIONS
00079 # include <stlsoft/collections/util/collections.hpp>
00080 #endif
00081 #ifndef STLSOFT_INCL_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER
00082 # include <stlsoft/util/std/iterator_helper.hpp>
00083 #endif
00084
00085 #ifndef STLSOFT_INCL_STDEXCEPT
00086 # define STLSOFT_INCL_STDEXCEPT
00087 # include <stdexcept>
00088 #endif
00089
00090 #ifdef STLSOFT_UNITTEST
00091 # include <map>
00092 #endif
00093
00094
00095
00096
00097
00098 #ifndef _STLSOFT_NO_NAMESPACE
00099 namespace stlsoft
00100 {
00101 #endif
00102
00103
00104
00105
00106
00114 template <ss_typename_param_k A>
00115 class associative_value_sequence
00116 : public stl_collection_tag
00117 {
00120 public:
00122 typedef associative_value_sequence<A> class_type;
00124 #if 0
00125 typedef ss_typename_type_k A::mapped_type value_type;
00126 #else
00127 typedef ss_typename_type_k A::value_type::second_type value_type;
00128 #endif
00130 typedef A associative_container_type;
00132 typedef ss_typename_type_k A::allocator_type allocator_type;
00133 #if 0
00138 typedef ss_typename_type_k A::const_pointer pointer;
00140 typedef ss_typename_type_k A::const_pointer const_pointer;
00141 #endif
00146 typedef ss_typename_type_k A::const_reference reference;
00148 typedef ss_typename_type_k A::const_reference const_reference;
00150 typedef ss_typename_type_k A::size_type size_type;
00152 typedef ss_typename_type_k A::difference_type difference_type;
00153
00155 typedef associative_select_iterator < ss_typename_type_k A::iterator
00156 , ::stlsoft::select_second<ss_typename_type_k A::value_type>
00157 > iterator;
00159 typedef associative_select_iterator < ss_typename_type_k A::const_iterator
00160 , ::stlsoft::select_second_const<ss_typename_type_k A::value_type>
00161 > const_iterator;
00162
00163 #if defined(STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT)
00165 typedef reverse_iterator_base < iterator
00166 , value_type
00167 , reference
00168 , value_type*
00169 , difference_type
00170 > reverse_iterator;
00171
00173 typedef const_reverse_iterator_base < const_iterator
00174 , value_type const
00175 , const_reference
00176 , value_type const*
00177 , difference_type
00178 > const_reverse_iterator;
00179 #endif
00181
00184 public:
00185 ss_explicit_k associative_value_sequence(associative_container_type const& container);
00187
00190 public:
00192 size_type size() const;
00194 size_type max_size() const;
00196 ss_bool_t empty() const;
00198
00201 public:
00205 const_iterator begin() const;
00209 const_iterator end() const;
00210
00211 #if defined(STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT)
00215 const_reverse_iterator rbegin() const;
00219 const_reverse_iterator rend() const;
00220 #endif
00222
00225 private:
00226 associative_container_type const &m_container;
00228 };
00229
00230
00231
00232
00233
00234 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00235
00236
00237
00238 template <ss_typename_param_k A>
00239 inline associative_value_sequence<A>::associative_value_sequence(ss_typename_type_k associative_value_sequence<A>::associative_container_type const& container)
00240 : m_container(container)
00241 {}
00242
00243
00244
00245 template <ss_typename_param_k A>
00246 inline ss_typename_type_ret_k associative_value_sequence<A>::size_type associative_value_sequence<A>::size() const
00247 {
00248 return m_container.size();
00249 }
00250
00251 template <ss_typename_param_k A>
00252 inline ss_typename_type_ret_k associative_value_sequence<A>::size_type associative_value_sequence<A>::max_size() const
00253 {
00254 return m_container.max_size();
00255 }
00256
00257 template <ss_typename_param_k A>
00258 inline ss_bool_t associative_value_sequence<A>::empty() const
00259 {
00260 return m_container.empty();
00261 }
00262
00263
00264
00265 template <ss_typename_param_k A>
00266 inline ss_typename_type_ret_k associative_value_sequence<A>::const_iterator associative_value_sequence<A>::begin() const
00267 {
00268 return const_iterator(m_container.begin());
00269 }
00270
00271 template <ss_typename_param_k A>
00272 inline ss_typename_type_ret_k associative_value_sequence<A>::const_iterator associative_value_sequence<A>::end() const
00273 {
00274 return const_iterator(m_container.end());
00275 }
00276
00277 # if defined(STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT)
00278 template <ss_typename_param_k A>
00279 inline ss_typename_type_ret_k associative_value_sequence<A>::const_reverse_iterator associative_value_sequence<A>::rbegin() const
00280 {
00281 return const_reverse_iterator(m_container.rbegin());
00282 }
00283
00284 template <ss_typename_param_k A>
00285 inline ss_typename_type_ret_k associative_value_sequence<A>::const_reverse_iterator associative_value_sequence<A>::rend() const
00286 {
00287 return const_reverse_iterator(m_container.rend());
00288 }
00289 # endif
00290
00291 #endif
00292
00293
00294
00295 #ifndef _STLSOFT_NO_NAMESPACE
00296 }
00297 #endif
00298
00299
00300
00301 #endif
00302
00303