Chris@101
|
1 /* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
Chris@16
|
2 * Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
3 * (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
4 * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
5 *
|
Chris@16
|
6 * See http://www.boost.org/libs/multi_index for library home page.
|
Chris@16
|
7 */
|
Chris@16
|
8
|
Chris@16
|
9 #ifndef BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP
|
Chris@16
|
10 #define BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP
|
Chris@16
|
11
|
Chris@101
|
12 #if defined(_MSC_VER)
|
Chris@16
|
13 #pragma once
|
Chris@16
|
14 #endif
|
Chris@16
|
15
|
Chris@16
|
16 namespace boost{
|
Chris@16
|
17
|
Chris@16
|
18 namespace multi_index{
|
Chris@16
|
19
|
Chris@16
|
20 namespace detail{
|
Chris@16
|
21
|
Chris@16
|
22 /* converter offers means to access indices of a given multi_index_container
|
Chris@16
|
23 * and for convertibilty between index iterators, so providing a
|
Chris@16
|
24 * localized access point for get() and project() functions.
|
Chris@16
|
25 */
|
Chris@16
|
26
|
Chris@16
|
27 template<typename MultiIndexContainer,typename Index>
|
Chris@16
|
28 struct converter
|
Chris@16
|
29 {
|
Chris@16
|
30 static const Index& index(const MultiIndexContainer& x){return x;}
|
Chris@16
|
31 static Index& index(MultiIndexContainer& x){return x;}
|
Chris@16
|
32
|
Chris@16
|
33 static typename Index::const_iterator const_iterator(
|
Chris@16
|
34 const MultiIndexContainer& x,typename MultiIndexContainer::node_type* node)
|
Chris@16
|
35 {
|
Chris@16
|
36 return x.Index::make_iterator(node);
|
Chris@16
|
37 }
|
Chris@16
|
38
|
Chris@16
|
39 static typename Index::iterator iterator(
|
Chris@16
|
40 MultiIndexContainer& x,typename MultiIndexContainer::node_type* node)
|
Chris@16
|
41 {
|
Chris@16
|
42 return x.Index::make_iterator(node);
|
Chris@16
|
43 }
|
Chris@16
|
44 };
|
Chris@16
|
45
|
Chris@16
|
46 } /* namespace multi_index::detail */
|
Chris@16
|
47
|
Chris@16
|
48 } /* namespace multi_index */
|
Chris@16
|
49
|
Chris@16
|
50 } /* namespace boost */
|
Chris@16
|
51
|
Chris@16
|
52 #endif
|