]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/bimap/views/list_set_view.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / bimap / views / list_set_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/list_set_view.hpp
10 /// \brief View of a side of a bimap that is signature compatible with std::list.
11
12 #ifndef BOOST_BIMAP_VIEWS_LIST_SET_VIEW_HPP
13 #define BOOST_BIMAP_VIEWS_LIST_SET_VIEW_HPP
14
15 #if defined(_MSC_VER)
16 #pragma once
17 #endif
18
19 #include <boost/config.hpp>
20
21 #include <boost/bimap/container_adaptor/list_adaptor.hpp>
22 #include <boost/bimap/detail/set_view_base.hpp>
23 #include <boost/bimap/detail/map_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::list.
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::list.
34
35 See also const_list_set_view.
36 **/
37
38 template< class CoreIndex >
39 class list_set_view
40 :
41 public BOOST_BIMAP_SEQUENCED_SET_VIEW_CONTAINER_ADAPTOR(
42 list_adaptor,
43 CoreIndex,
44 reverse_iterator, const_reverse_iterator
45 ),
46
47 public ::boost::bimaps::detail::
48 set_view_base< list_set_view< CoreIndex >, CoreIndex >
49 {
50 BOOST_BIMAP_SET_VIEW_BASE_FRIEND(list_set_view,CoreIndex)
51
52 typedef BOOST_BIMAP_SEQUENCED_SET_VIEW_CONTAINER_ADAPTOR(
53 list_adaptor,
54 CoreIndex,
55 reverse_iterator, const_reverse_iterator
56
57 ) base_;
58
59 public:
60
61 list_set_view(BOOST_DEDUCED_TYPENAME base_::base_type & c) :
62 base_(c) {}
63
64 list_set_view & operator=(const list_set_view & v)
65 {
66 this->base() = v.base();
67 return *this;
68 }
69
70 BOOST_BIMAP_VIEW_ASSIGN_IMPLEMENTATION(base_)
71
72 BOOST_BIMAP_VIEW_FRONT_BACK_IMPLEMENTATION(base_)
73
74 // Rearrange Operations
75
76 void relocate(BOOST_DEDUCED_TYPENAME base_::iterator position,
77 BOOST_DEDUCED_TYPENAME base_::iterator i)
78 {
79 this->base().relocate(
80 this->template functor<
81 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(position),
82 this->template functor<
83 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(i)
84 );
85 }
86
87 void relocate(BOOST_DEDUCED_TYPENAME base_::iterator position,
88 BOOST_DEDUCED_TYPENAME base_::iterator first,
89 BOOST_DEDUCED_TYPENAME base_::iterator last)
90 {
91 this->base().relocate(
92 this->template functor<
93 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(position),
94 this->template functor<
95 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(first),
96 this->template functor<
97 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(last)
98 );
99 }
100 };
101
102
103 } // namespace views
104 } // namespace bimaps
105 } // namespace boost
106
107
108 #endif // BOOST_BIMAP_VIEWS_LIST_SET_VIEW_HPP
109