Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / bimap / views / unordered_multiset_view.hpp
1 // Boost.Bimap
2 //
3 // Copyright (c) 2006-2007 Matias Capeletto
4 //
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8
9 /// \file views/unordered_multiset_view.hpp
10 /// \brief View of a bimap that is signature compatible with tr1::unordered_multiset.
11
12 #ifndef BOOST_BIMAP_VIEWS_UNORDERED_MULTISET_VIEW_HPP
13 #define BOOST_BIMAP_VIEWS_UNORDERED_MULTISET_VIEW_HPP
14
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
16 #pragma once
17 #endif
18
19 #include <boost/config.hpp>
20
21 #include <boost/bimap/container_adaptor/unordered_multiset_adaptor.hpp>
22 #include <boost/bimap/detail/non_unique_views_helper.hpp>
23 #include <boost/bimap/detail/set_view_base.hpp>
24
25 namespace boost {
26 namespace bimaps {
27 namespace views {
28
29 /// \brief View of a bimap that is signature compatible with std::unordered_multiset.
30 /**
31
32 This class uses container_adaptor and iterator_adaptor to wrapped a index of the
33 multi_index bimap core so it can be used as a std::unordered_multiset.
34
35 See also const_unordered_multiset_view.
36                                                                                     **/
37
38 template< class CoreIndex >
39 class unordered_multiset_view
40 :
41     public BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
42         unordered_multiset_adaptor,
43         CoreIndex,
44         local_iterator,
45         const_local_iterator
46
47     ),
48
49     public ::boost::bimaps::detail::
50                 set_view_base< unordered_multiset_view< CoreIndex >, CoreIndex >
51 {
52     BOOST_BIMAP_SET_VIEW_BASE_FRIEND(unordered_multiset_view,CoreIndex)
53
54     typedef BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
55         unordered_multiset_adaptor,
56         CoreIndex,
57         local_iterator,
58         const_local_iterator
59
60     ) base_;
61
62     public:
63
64     unordered_multiset_view(BOOST_DEDUCED_TYPENAME base_::base_type & c)
65         : base_(c) {}
66
67     BOOST_BIMAP_NON_UNIQUE_VIEW_INSERT_FUNCTIONS
68
69     unordered_multiset_view & operator=(const unordered_multiset_view & v)
70     {
71         this->base() = v.base();
72         return *this;
73     }
74 };
75
76
77 } // namespace views
78 } // namespace bimaps
79 } // namespace boost
80
81 #endif // BOOST_BIMAP_VIEWS_UNORDERED_MULTISET_VIEW_HPP
82
83