File indexing completed on 2024-11-15 09:04:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_BIMAP_VIEWS_MULTIMAP_VIEW_HPP
0013 #define BOOST_BIMAP_VIEWS_MULTIMAP_VIEW_HPP
0014
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018
0019 #include <boost/config.hpp>
0020
0021 #include <boost/bimap/container_adaptor/multimap_adaptor.hpp>
0022 #include <boost/bimap/detail/non_unique_views_helper.hpp>
0023 #include <boost/bimap/support/iterator_type_by.hpp>
0024 #include <boost/bimap/detail/map_view_base.hpp>
0025
0026 namespace boost {
0027 namespace bimaps {
0028 namespace views {
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 template< class Tag, class BimapType >
0040 class multimap_view
0041 :
0042 public BOOST_BIMAP_MAP_VIEW_CONTAINER_ADAPTOR(
0043 multimap_adaptor,
0044 Tag,BimapType,
0045 reverse_map_view_iterator,const_reverse_map_view_iterator
0046 ),
0047 public ::boost::bimaps::detail::
0048 map_view_base< multimap_view<Tag,BimapType>,Tag,BimapType >
0049
0050 {
0051 typedef BOOST_BIMAP_MAP_VIEW_CONTAINER_ADAPTOR(
0052 multimap_adaptor,
0053 Tag,BimapType,
0054 reverse_map_view_iterator,const_reverse_map_view_iterator
0055
0056 ) base_;
0057
0058 BOOST_BIMAP_MAP_VIEW_BASE_FRIEND(multimap_view,Tag,BimapType)
0059
0060 public:
0061
0062 typedef BOOST_DEDUCED_TYPENAME base_::value_type::info_type info_type;
0063
0064 multimap_view(BOOST_DEDUCED_TYPENAME base_::base_type & c)
0065 : base_(c) {}
0066
0067 BOOST_BIMAP_MAP_VIEW_RANGE_IMPLEMENTATION(base_)
0068
0069 multimap_view & operator=(const multimap_view & v)
0070 {
0071 this->base() = v.base();
0072 return *this;
0073 }
0074
0075 BOOST_BIMAP_NON_UNIQUE_VIEW_INSERT_FUNCTIONS
0076 };
0077
0078
0079 }
0080
0081
0082 #define BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEF(MAP_VIEW,SIDE,TYPENAME) \
0083 typedef BOOST_DEDUCED_TYPENAME MAP_VIEW::TYPENAME \
0084 BOOST_PP_CAT(SIDE,BOOST_PP_CAT(_,TYPENAME));
0085
0086
0087
0088 #define BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEFS_BODY(MAP_VIEW,SIDE) \
0089 BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEF(MAP_VIEW,SIDE,reverse_iterator) \
0090 BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEF(MAP_VIEW,SIDE,const_reverse_iterator) \
0091 BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEF(MAP_VIEW,SIDE,range_type) \
0092 BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEF(MAP_VIEW,SIDE,const_range_type) \
0093 BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEF(MAP_VIEW,SIDE,key_compare)
0094
0095
0096 namespace detail {
0097
0098 template< class Tag, class BimapType >
0099 struct left_map_view_extra_typedefs< ::boost::bimaps::views::multimap_view<Tag,BimapType> >
0100 {
0101 private: typedef ::boost::bimaps::views::multimap_view<Tag,BimapType> map_view_;
0102 public : BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEFS_BODY(map_view_,left)
0103 };
0104
0105 template< class Tag, class BimapType >
0106 struct right_map_view_extra_typedefs< ::boost::bimaps::views::multimap_view<Tag,BimapType> >
0107 {
0108 private: typedef ::boost::bimaps::views::multimap_view<Tag,BimapType> map_view_;
0109 public : BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEFS_BODY(map_view_,right)
0110 };
0111
0112 }
0113
0114
0115 #undef BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEF
0116 #undef BOOST_BIMAP_MAP_VIEW_EXTRA_TYPEDEFS_BODY
0117
0118
0119 }
0120 }
0121
0122 #endif
0123