Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:10

0001 // Boost.Bimap
0002 //
0003 // Copyright (c) 2006-2007 Matias Capeletto
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 /// \file views/list_set_view.hpp
0010 /// \brief View of a side of a bimap that is signature compatible with std::list.
0011 
0012 #ifndef BOOST_BIMAP_VIEWS_LIST_SET_VIEW_HPP
0013 #define BOOST_BIMAP_VIEWS_LIST_SET_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/list_adaptor.hpp>
0022 #include <boost/bimap/detail/set_view_base.hpp>
0023 #include <boost/bimap/detail/map_view_base.hpp>
0024 
0025 namespace boost {
0026 namespace bimaps {
0027 namespace views {
0028 
0029 /// \brief View of a bimap that is signature compatible with std::list.
0030 /**
0031 
0032 This class uses container_adaptor and iterator_adaptor to wrapped a index of the
0033 multi_index bimap core so it can be used as a std::list.
0034 
0035 See also const_list_set_view.
0036                                                                                     **/
0037 
0038 template< class CoreIndex >
0039 class list_set_view
0040 :
0041     public BOOST_BIMAP_SEQUENCED_SET_VIEW_CONTAINER_ADAPTOR(
0042         list_adaptor,
0043         CoreIndex,
0044         reverse_iterator, const_reverse_iterator
0045     ),
0046 
0047     public ::boost::bimaps::detail::
0048         set_view_base< list_set_view< CoreIndex >, CoreIndex >
0049 {
0050     BOOST_BIMAP_SET_VIEW_BASE_FRIEND(list_set_view,CoreIndex)
0051 
0052     typedef BOOST_BIMAP_SEQUENCED_SET_VIEW_CONTAINER_ADAPTOR(
0053         list_adaptor,
0054         CoreIndex,
0055         reverse_iterator, const_reverse_iterator
0056 
0057     ) base_;
0058 
0059     public:
0060 
0061     list_set_view(BOOST_DEDUCED_TYPENAME base_::base_type & c) :
0062         base_(c) {}
0063 
0064     list_set_view & operator=(const list_set_view & v) 
0065     {
0066         this->base() = v.base();
0067         return *this;
0068     }
0069 
0070     BOOST_BIMAP_VIEW_ASSIGN_IMPLEMENTATION(base_)
0071 
0072     BOOST_BIMAP_VIEW_FRONT_BACK_IMPLEMENTATION(base_)
0073 
0074     // Rearrange Operations
0075 
0076     void relocate(BOOST_DEDUCED_TYPENAME base_::iterator position, 
0077                   BOOST_DEDUCED_TYPENAME base_::iterator i)
0078     {
0079         this->base().relocate(
0080             this->template functor<
0081                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(position),
0082             this->template functor<
0083                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(i)
0084         );
0085     }
0086 
0087     void relocate(BOOST_DEDUCED_TYPENAME base_::iterator position,
0088                   BOOST_DEDUCED_TYPENAME base_::iterator first,
0089                   BOOST_DEDUCED_TYPENAME base_::iterator last)
0090     {
0091         this->base().relocate(
0092             this->template functor<
0093                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(position),
0094             this->template functor<
0095                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(first),
0096             this->template functor<
0097                 BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(last)
0098         );
0099     }
0100 };
0101 
0102 
0103 } // namespace views
0104 } // namespace bimaps
0105 } // namespace boost
0106 
0107 
0108 #endif // BOOST_BIMAP_VIEWS_LIST_SET_VIEW_HPP
0109