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

PrevUpHomeNext

unconstrained_set_of.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 unconstrained_set_of.hpp
00010 /// \brief Include support for set constrains for the bimap container
00011 
00012 #ifndef BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP
00013 #define BOOST_BIMAP_UNCONSTRAINED_SET_OF_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/bimap/detail/user_interface_config.hpp>
00022 
00023 #include <boost/mpl/bool.hpp>
00024 
00025 #include <boost/bimap/detail/concept_tags.hpp>
00026 
00027 #include <boost/bimap/detail/generate_index_binder.hpp>
00028 #include <boost/bimap/detail/generate_view_binder.hpp>
00029 #include <boost/bimap/detail/generate_relation_binder.hpp>
00030 
00031 #include <boost/bimap/views/unconstrained_map_view.hpp>
00032 #include <boost/bimap/views/unconstrained_set_view.hpp>
00033 
00034 namespace boost {
00035 namespace bimaps {
00036 
00037 /// \brief Set Type Specification
00038 /**
00039 This struct is used to specify a set specification.
00040 It is not a container, it is just a metaprogramming facility to
00041 express the type of a set. Generally, this specification will
00042 be used in other place to create a container.
00043 The first parameter is the type of the objects in the set.
00044 
00045 \code
00046 
00047 using namespace support;
00048 
00049 BOOST_STATIC_ASSERT( is_set_type_of< unconstrained_set_of<Type> >::value );
00050 
00051 \endcode
00052 
00053 See also unconstrained_set_of_relation.
00054                                                                         **/
00055 
00056 template
00057 <
00058     class KeyType
00059 >
00060 struct unconstrained_set_of : public ::boost::bimaps::detail::set_type_of_tag
00061 {
00062     /// Type of the object that will be stored in the set
00063     typedef KeyType value_type;
00064 
00065     BOOST_BIMAP_GENERATE_INDEX_BINDER_FAKE
00066 
00067     BOOST_BIMAP_GENERATE_MAP_VIEW_BINDER(
00068 
00069         // binds to
00070         views::unconstrained_map_view
00071     );
00072 
00073     BOOST_BIMAP_GENERATE_SET_VIEW_BINDER(
00074 
00075         // binds to
00076         views::unconstrained_set_view
00077     );
00078 
00079     typedef mpl::bool_<true> mutable_key;
00080 };
00081 
00082 /// \brief Set Of Relation Specification
00083 /**
00084 This struct is similar to unconstrained_set_of but it is bind
00085 logically to a relation. It is used in the bimap instantiation to
00086 specify the desired type of the main view.
00087 
00088 See also unconstrained_set_of, is_set_type_of_relation.
00089                                                                 **/
00090 
00091 struct unconstrained_set_of_relation : public ::boost::bimaps::detail::set_type_of_relation_tag
00092 {
00093 
00094     BOOST_BIMAP_GENERATE_RELATION_BINDER_0CP(
00095 
00096         // binds to
00097         unconstrained_set_of
00098     );
00099 
00100     typedef mpl::bool_<true>  left_mutable_key;
00101     typedef mpl::bool_<true> right_mutable_key;
00102 };
00103 
00104 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
00105 
00106 namespace detail {
00107 
00108 template<class T>
00109 struct is_unconstrained_set_of :
00110     ::boost::mpl::false_ {};
00111 
00112 template<class T>
00113 struct is_unconstrained_set_of< unconstrained_set_of<T> > :
00114     ::boost::mpl::true_ {};
00115 
00116 } // namespace detail
00117 
00118 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
00119 
00120 } // namespace bimaps
00121 } // namespace boost
00122 
00123 
00124 /** \struct boost::bimaps::detail::is_unconstrained_set_of
00125 \brief Trait to check if a type is unconstrained_set_of.
00126 \code
00127 template< class T >
00128 struct is_unconstrained_set_of;
00129 \endcode
00130                                                                             **/
00131 
00132 
00133 #endif // BOOST_BIMAP_UNCONSTRAINED_SET_OF_HPP
00134 
Copyright 2006 Matias Capeletto

PrevUpHomeNext