Chris@16
|
1 // Boost.Bimap
|
Chris@16
|
2 //
|
Chris@16
|
3 // Copyright (c) 2006-2007 Matias Capeletto
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8
|
Chris@16
|
9 /// \file detail/generate_index_binder.hpp
|
Chris@16
|
10 /// \brief Define macros to help building the set type of definitions
|
Chris@16
|
11
|
Chris@16
|
12
|
Chris@16
|
13 #ifndef BOOST_BIMAP_DETAIL_GENERATE_INDEX_BINDER_HPP
|
Chris@16
|
14 #define BOOST_BIMAP_DETAIL_GENERATE_INDEX_BINDER_HPP
|
Chris@16
|
15
|
Chris@101
|
16 #if defined(_MSC_VER)
|
Chris@16
|
17 #pragma once
|
Chris@16
|
18 #endif
|
Chris@16
|
19
|
Chris@16
|
20 #include <boost/config.hpp>
|
Chris@16
|
21
|
Chris@16
|
22 #include <boost/multi_index/tag.hpp>
|
Chris@16
|
23
|
Chris@16
|
24
|
Chris@16
|
25 /*===========================================================================*/
|
Chris@16
|
26 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_0CP( \
|
Chris@16
|
27 \
|
Chris@16
|
28 MULTI_INDEX_TYPE \
|
Chris@16
|
29 \
|
Chris@16
|
30 ) \
|
Chris@16
|
31 \
|
Chris@16
|
32 template< class KeyExtractor, class Tag > \
|
Chris@16
|
33 struct index_bind \
|
Chris@16
|
34 { \
|
Chris@16
|
35 typedef MULTI_INDEX_TYPE \
|
Chris@16
|
36 < \
|
Chris@16
|
37 multi_index::tag< Tag >, \
|
Chris@16
|
38 KeyExtractor \
|
Chris@16
|
39 \
|
Chris@16
|
40 > type; \
|
Chris@16
|
41 };
|
Chris@16
|
42 /*===========================================================================*/
|
Chris@16
|
43
|
Chris@16
|
44
|
Chris@16
|
45
|
Chris@16
|
46 /*===========================================================================*/
|
Chris@16
|
47 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP( \
|
Chris@16
|
48 \
|
Chris@16
|
49 MULTI_INDEX_TYPE, \
|
Chris@16
|
50 CONFIG_PARAMETER \
|
Chris@16
|
51 \
|
Chris@16
|
52 ) \
|
Chris@16
|
53 \
|
Chris@16
|
54 template< class KeyExtractor, class Tag > \
|
Chris@16
|
55 struct index_bind \
|
Chris@16
|
56 { \
|
Chris@16
|
57 typedef MULTI_INDEX_TYPE \
|
Chris@16
|
58 < \
|
Chris@16
|
59 multi_index::tag< Tag >, \
|
Chris@16
|
60 KeyExtractor, \
|
Chris@16
|
61 CONFIG_PARAMETER \
|
Chris@16
|
62 \
|
Chris@16
|
63 > type; \
|
Chris@16
|
64 };
|
Chris@16
|
65 /*===========================================================================*/
|
Chris@16
|
66
|
Chris@16
|
67
|
Chris@16
|
68
|
Chris@16
|
69
|
Chris@16
|
70 /*===========================================================================*/
|
Chris@16
|
71 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_2CP( \
|
Chris@16
|
72 \
|
Chris@16
|
73 MULTI_INDEX_TYPE, \
|
Chris@16
|
74 CONFIG_PARAMETER_1, \
|
Chris@16
|
75 CONFIG_PARAMETER_2 \
|
Chris@16
|
76 ) \
|
Chris@16
|
77 \
|
Chris@16
|
78 template< class KeyExtractor, class Tag > \
|
Chris@16
|
79 struct index_bind \
|
Chris@16
|
80 { \
|
Chris@16
|
81 typedef MULTI_INDEX_TYPE \
|
Chris@16
|
82 < \
|
Chris@16
|
83 multi_index::tag< Tag >, \
|
Chris@16
|
84 KeyExtractor, \
|
Chris@16
|
85 CONFIG_PARAMETER_1, \
|
Chris@16
|
86 CONFIG_PARAMETER_2 \
|
Chris@16
|
87 \
|
Chris@16
|
88 > type; \
|
Chris@16
|
89 \
|
Chris@16
|
90 };
|
Chris@16
|
91 /*===========================================================================*/
|
Chris@16
|
92
|
Chris@16
|
93
|
Chris@16
|
94 // This is a special registration to allow sequenced and random access indices
|
Chris@16
|
95 // to play along smoothly with the other index types.
|
Chris@16
|
96
|
Chris@16
|
97 /*===========================================================================*/
|
Chris@16
|
98 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_0CP_NO_EXTRACTOR( \
|
Chris@16
|
99 \
|
Chris@16
|
100 MULTI_INDEX_TYPE \
|
Chris@16
|
101 \
|
Chris@16
|
102 ) \
|
Chris@16
|
103 \
|
Chris@16
|
104 template< class KeyExtractor, class Tag > \
|
Chris@16
|
105 struct index_bind \
|
Chris@16
|
106 { \
|
Chris@16
|
107 typedef MULTI_INDEX_TYPE< multi_index::tag< Tag > > type; \
|
Chris@16
|
108 };
|
Chris@16
|
109 /*===========================================================================*/
|
Chris@16
|
110
|
Chris@16
|
111
|
Chris@16
|
112 // This is yet another special registration to allow unconstrained sets
|
Chris@16
|
113 // to play along smoothly with the other index types.
|
Chris@16
|
114
|
Chris@16
|
115 /*===========================================================================*/
|
Chris@16
|
116 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_FAKE \
|
Chris@16
|
117 \
|
Chris@16
|
118 template< class KeyExtractor, class Tag > \
|
Chris@16
|
119 struct index_bind \
|
Chris@16
|
120 { \
|
Chris@16
|
121 typedef void type; \
|
Chris@16
|
122 }; \
|
Chris@16
|
123 /*===========================================================================*/
|
Chris@16
|
124
|
Chris@16
|
125 #endif // BOOST_BIMAP_DETAIL_GENERATE_INDEX_BINDER_HPP
|