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

PrevUpHomeNext

concept_tags.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/concept_tags.hpp
00010 /// \brief Bimap tags and concepts
00011 
00012 #ifndef BOOST_BIMAP_DETAIL_CONCEPT_TAGS_HPP
00013 #define BOOST_BIMAP_DETAIL_CONCEPT_TAGS_HPP
00014 
00015 #if defined(_MSC_VER) && (_MSC_VER>=1200)
00016 #pragma once
00017 #endif
00018 
00019 #include <boost/config.hpp>
00020 
00021 #include <boost/mpl/identity.hpp>
00022 #include <boost/mpl/placeholders.hpp>
00023 #include <boost/mpl/bool.hpp>
00024 
00025 namespace boost {
00026 namespace bimaps {
00027 namespace detail {
00028 
00029 /// \brief Tag of {SetType}_of definition classes
00030 /**
00031 The {SetType}_of classes are derived from this class so it is easy to construct
00032 metafunctions. For example now is easy to create a is_set_type_of metafunction.
00033                                                                                 **/
00034 
00035 struct set_type_of_tag          {};
00036 
00037 /// \brief Tag of {SetType}_of_relation defition classes
00038 
00039 struct set_type_of_relation_tag {};
00040 
00041 /// \brief Tag of {Side}_based identifiers
00042 
00043 struct side_based_tag : set_type_of_relation_tag {};
00044 
00045 } // namespace detail
00046 
00047 
00048 /** \struct boost::bimaps::left_based
00049     \brief Tag to indicate that the main view will be based on the left side.
00050 
00051 This is convenient because the multi-index core will be more efficient.
00052 If possible use this options or the right based one.
00053 
00054 See also right_based.
00055                                                                             **/
00056 
00057 /** \struct boost::bimaps::right_based
00058     \brief Tag to indicate that the main view will be based on the right side.
00059 
00060 This is convenient because the multi-index core will be more efficient.
00061 If possible use this options or the right based one.
00062 
00063 See also left_based.
00064                                                                             **/
00065 
00066 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
00067 
00068 struct left_based : ::boost::bimaps::detail::side_based_tag
00069 {
00070     // I run into troubles if I do not define bind for side based tags.
00071     // Maybe a more coherent way of binding the relation can be developped.
00072     template< class Relation > struct bind_to { typedef void type; };
00073 
00074     typedef mpl::bool_<true>  left_mutable_key;
00075     typedef mpl::bool_<true> right_mutable_key;
00076 };
00077 
00078 struct right_based : ::boost::bimaps::detail::side_based_tag
00079 {
00080     // I run into troubles if I do not define bind for side based tags.
00081     // Maybe a more coherent way of binding the relation can be developped.
00082     template< class Relation > struct bind_to { typedef void type; };
00083 
00084     typedef mpl::bool_<true>  left_mutable_key;
00085     typedef mpl::bool_<true> right_mutable_key;
00086 };
00087 
00088 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
00089 
00090 typedef mpl::_ _relation;
00091 
00092 } // namespace bimaps
00093 } // namespace boost
00094 
00095 
00096 #endif // BOOST_BIMAP_DETAIL_CONCEPT_TAGS_HPP
00097 
Copyright 2006 Matias Capeletto

PrevUpHomeNext