Add Boost.Test karmic valgrind suppressions
[senf.git] / boost_ext / 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) && (_MSC_VER>=1200)
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
24 namespace boost {
25 namespace bimaps {
26 namespace views {
27
28 /// \brief View of a bimap that is signature compatible with std::list.
29 /**
30
31 This class uses container_adaptor and iterator_adaptor to wrapped a index of the
32 multi_index bimap core so it can be used as a std::list.
33
34 See also const_list_set_view.
35                                                                                     **/
36
37 template< class CoreIndex >
38 class list_set_view
39 :
40     public BOOST_BIMAP_SEQUENCED_SET_VIEW_CONTAINER_ADAPTOR(
41         list_adaptor,
42         CoreIndex,
43         reverse_iterator, const_reverse_iterator
44     ),
45
46     public ::boost::bimaps::detail::
47         set_view_base< list_set_view< CoreIndex >, CoreIndex >
48 {
49     BOOST_BIMAP_SET_VIEW_BASE_FRIEND(list_set_view,CoreIndex)
50
51     typedef BOOST_BIMAP_SEQUENCED_SET_VIEW_CONTAINER_ADAPTOR(
52         list_adaptor,
53         CoreIndex,
54         reverse_iterator, const_reverse_iterator
55
56     ) base_;
57
58     public:
59
60     list_set_view(BOOST_DEDUCED_TYPENAME base_::base_type & c) :
61         base_(c) {}
62
63     list_set_view & operator=(const list_set_view & v) 
64     {
65         this->base() = v.base();
66         return *this;
67     }
68
69     BOOST_BIMAP_VIEW_ASSIGN_IMPLEMENTATION(base_)
70
71     BOOST_BIMAP_VIEW_FRONT_BACK_IMPLEMENTATION(base_)
72
73     // Rearrange Operations
74
75     void relocate(BOOST_DEDUCED_TYPENAME base_::iterator position, 
76                   BOOST_DEDUCED_TYPENAME base_::iterator i)
77     {
78         this->base().relocate(
79             this->template functor<
80                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(position),
81             this->template functor<
82                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(i)
83         );
84     }
85
86     void relocate(BOOST_DEDUCED_TYPENAME base_::iterator position,
87                   BOOST_DEDUCED_TYPENAME base_::iterator first,
88                   BOOST_DEDUCED_TYPENAME base_::iterator last)
89     {
90         this->base().relocate(
91             this->template functor<
92                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(position),
93             this->template functor<
94                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(first),
95             this->template functor<
96                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(last)
97         );
98     }
99 };
100
101
102 } // namespace views
103 } // namespace bimaps
104 } // namespace boost
105
106
107 #endif // BOOST_BIMAP_VIEWS_LIST_SET_VIEW_HPP
108