Boost C++ Libraries Boost.Bimap Home Libraries People FAQ More

PrevUpHomeNext

generate_index_binder.hpp

Go to the documentation of this file.
00001 // Boost.Bimap
00002 //
00003 // Copyright (c) 2006-2007 Matias Capeletto
00004 //
00005 // Distributed under the Boost Software License, Version 1.0.
00006 // (See accompanying file LICENSE_1_0.txt or copy at
00007 // http://www.boost.org/LICENSE_1_0.txt)
00008 
00009 /// \file detail/generate_index_binder.hpp
00010 /// \brief Define macros to help building the set type of definitions
00011 
00012 
00013 #ifndef BOOST_BIMAP_DETAIL_GENERATE_INDEX_BINDER_HPP
00014 #define BOOST_BIMAP_DETAIL_GENERATE_INDEX_BINDER_HPP
00015 
00016 #if defined(_MSC_VER) && (_MSC_VER>=1200)
00017 #pragma once
00018 #endif
00019 
00020 #include <boost/config.hpp>
00021 
00022 #include <boost/multi_index/tag.hpp>
00023 
00024 
00025 /*===========================================================================*/
00026 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_0CP(                                \
00027                                                                               \
00028     MULTI_INDEX_TYPE                                                          \
00029                                                                               \
00030 )                                                                             \
00031                                                                               \
00032 template< class KeyExtractor, class Tag >                                     \
00033 struct index_bind                                                             \
00034 {                                                                             \
00035     typedef MULTI_INDEX_TYPE                                                  \
00036     <                                                                         \
00037         multi_index::tag< Tag >,                                              \
00038         KeyExtractor                                                          \
00039                                                                               \
00040     > type;                                                                   \
00041 };
00042 /*===========================================================================*/
00043 
00044 
00045 
00046 /*===========================================================================*/
00047 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP(                                \
00048                                                                               \
00049     MULTI_INDEX_TYPE,                                                         \
00050     CONFIG_PARAMETER                                                          \
00051                                                                               \
00052 )                                                                             \
00053                                                                               \
00054 template< class KeyExtractor, class Tag >                                     \
00055 struct index_bind                                                             \
00056 {                                                                             \
00057     typedef MULTI_INDEX_TYPE                                                  \
00058     <                                                                         \
00059         multi_index::tag< Tag >,                                              \
00060         KeyExtractor,                                                         \
00061         CONFIG_PARAMETER                                                      \
00062                                                                               \
00063     > type;                                                                   \
00064 };
00065 /*===========================================================================*/
00066 
00067 
00068 
00069 
00070 /*===========================================================================*/
00071 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_2CP(                                \
00072                                                                               \
00073     MULTI_INDEX_TYPE,                                                         \
00074     CONFIG_PARAMETER_1,                                                       \
00075     CONFIG_PARAMETER_2                                                        \
00076 )                                                                             \
00077                                                                               \
00078 template< class KeyExtractor, class Tag >                                     \
00079 struct index_bind                                                             \
00080 {                                                                             \
00081     typedef MULTI_INDEX_TYPE                                                  \
00082     <                                                                         \
00083         multi_index::tag< Tag >,                                              \
00084         KeyExtractor,                                                         \
00085         CONFIG_PARAMETER_1,                                                   \
00086         CONFIG_PARAMETER_2                                                    \
00087                                                                               \
00088     > type;                                                                   \
00089                                                                               \
00090 };
00091 /*===========================================================================*/
00092 
00093 
00094 // This is a special registration to allow sequenced and random access indices
00095 // to play along smoothly with the other index types.
00096 
00097 /*===========================================================================*/
00098 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_0CP_NO_EXTRACTOR(                   \
00099                                                                               \
00100     MULTI_INDEX_TYPE                                                          \
00101                                                                               \
00102 )                                                                             \
00103                                                                               \
00104 template< class KeyExtractor, class Tag >                                     \
00105 struct index_bind                                                             \
00106 {                                                                             \
00107     typedef MULTI_INDEX_TYPE< multi_index::tag< Tag > > type;                 \
00108 };
00109 /*===========================================================================*/
00110 
00111 
00112 // This is yet another special registration to allow unconstrained sets
00113 // to play along smoothly with the other index types.
00114 
00115 /*===========================================================================*/
00116 #define BOOST_BIMAP_GENERATE_INDEX_BINDER_FAKE                                \
00117                                                                               \
00118 template< class KeyExtractor, class Tag >                                     \
00119 struct index_bind                                                             \
00120 {                                                                             \
00121     typedef void type;                                                        \
00122 };                                                                            \
00123 /*===========================================================================*/
00124 
00125 #endif // BOOST_BIMAP_DETAIL_GENERATE_INDEX_BINDER_HPP
Copyright 2006 Matias Capeletto

PrevUpHomeNext