comparison DEPENDENCIES/generic/include/boost/interprocess/indexes/iset_index.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
9 ////////////////////////////////////////////////////////////////////////////// 9 //////////////////////////////////////////////////////////////////////////////
10 10
11 #ifndef BOOST_INTERPROCESS_ISET_INDEX_HPP 11 #ifndef BOOST_INTERPROCESS_ISET_INDEX_HPP
12 #define BOOST_INTERPROCESS_ISET_INDEX_HPP 12 #define BOOST_INTERPROCESS_ISET_INDEX_HPP
13 13
14 #ifndef BOOST_CONFIG_HPP
15 # include <boost/config.hpp>
16 #endif
17 #
18 #if defined(BOOST_HAS_PRAGMA_ONCE)
19 # pragma once
20 #endif
21
14 #include <boost/interprocess/detail/config_begin.hpp> 22 #include <boost/interprocess/detail/config_begin.hpp>
15 #include <boost/interprocess/detail/workaround.hpp> 23 #include <boost/interprocess/detail/workaround.hpp>
16 24
17 #include <string> 25 #include <boost/intrusive/detail/minimal_pair_header.hpp>
18 #include <functional>
19 #include <utility>
20 #include <boost/interprocess/detail/utilities.hpp> 26 #include <boost/interprocess/detail/utilities.hpp>
27 #include <boost/intrusive/detail/minimal_pair_header.hpp> //std::pair
28 #include <boost/intrusive/detail/minimal_less_equal_header.hpp> //std::less
29 #include <boost/container/detail/minimal_char_traits_header.hpp> //std::char_traits
21 #include <boost/intrusive/set.hpp> 30 #include <boost/intrusive/set.hpp>
22
23 31
24 //!\file 32 //!\file
25 //!Describes index adaptor of boost::intrusive::set container, to use it 33 //!Describes index adaptor of boost::intrusive::set container, to use it
26 //!as name/shared memory index 34 //!as name/shared memory index
27 35
28 namespace boost { 36 namespace boost {
29 namespace interprocess { 37 namespace interprocess {
30 38
31 /// @cond 39 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
32 40
33 //!Helper class to define typedefs from IndexTraits 41 //!Helper class to define typedefs from IndexTraits
34 template <class MapConfig> 42 template <class MapConfig>
35 struct iset_index_aux 43 struct iset_index_aux
36 { 44 {
50 typedef typename bi::make_set 58 typedef typename bi::make_set
51 < value_type 59 < value_type
52 , bi::base_hook<derivation_hook> 60 , bi::base_hook<derivation_hook>
53 >::type index_t; 61 >::type index_t;
54 }; 62 };
55 /// @endcond 63 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
56 64
57 //!Index type based in boost::intrusive::set. 65 //!Index type based in boost::intrusive::set.
58 //!Just derives from boost::intrusive::set 66 //!Just derives from boost::intrusive::set
59 //!and defines the interface needed by managed memory segments*/ 67 //!and defines the interface needed by managed memory segments*/
60 template <class MapConfig> 68 template <class MapConfig>
61 class iset_index 69 class iset_index
62 //Derive class from map specialization 70 //Derive class from map specialization
63 : public iset_index_aux<MapConfig>::index_t 71 : public iset_index_aux<MapConfig>::index_t
64 { 72 {
65 /// @cond 73 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
66 typedef iset_index_aux<MapConfig> index_aux; 74 typedef iset_index_aux<MapConfig> index_aux;
67 typedef typename index_aux::index_t index_type; 75 typedef typename index_aux::index_t index_type;
68 typedef typename MapConfig:: 76 typedef typename MapConfig::
69 intrusive_compare_key_type intrusive_compare_key_type; 77 intrusive_compare_key_type intrusive_compare_key_type;
70 typedef typename MapConfig::char_type char_type; 78 typedef typename MapConfig::char_type char_type;
71 /// @endcond 79 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
72 80
73 public: 81 public:
74 typedef typename index_type::iterator iterator; 82 typedef typename index_type::iterator iterator;
75 typedef typename index_type::const_iterator const_iterator; 83 typedef typename index_type::const_iterator const_iterator;
76 typedef typename index_type::insert_commit_data insert_commit_data; 84 typedef typename index_type::insert_commit_data insert_commit_data;
77 typedef typename index_type::value_type value_type; 85 typedef typename index_type::value_type value_type;
78 86
79 /// @cond 87 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
80 private: 88 private:
81 89
82 struct intrusive_key_value_less 90 struct intrusive_key_value_less
83 { 91 {
84 bool operator()(const intrusive_compare_key_type &i, const value_type &b) const 92 bool operator()(const intrusive_compare_key_type &i, const value_type &b) const
98 std::char_traits<char_type>::compare 106 std::char_traits<char_type>::compare
99 (b.name(), i.mp_str, i.m_len) < 0); 107 (b.name(), i.mp_str, i.m_len) < 0);
100 } 108 }
101 }; 109 };
102 110
103 /// @endcond 111 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
104 112
105 public: 113 public:
106 114
107 //!Constructor. Takes a pointer to the 115 //!Constructor. Takes a pointer to the
108 //!segment manager. Can throw 116 //!segment manager. Can throw
128 std::pair<iterator, bool>insert_check 136 std::pair<iterator, bool>insert_check
129 (const intrusive_compare_key_type &key, insert_commit_data &commit_data) 137 (const intrusive_compare_key_type &key, insert_commit_data &commit_data)
130 { return index_type::insert_check(key, intrusive_key_value_less(), commit_data); } 138 { return index_type::insert_check(key, intrusive_key_value_less(), commit_data); }
131 }; 139 };
132 140
133 /// @cond 141 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
134 142
135 //!Trait class to detect if an index is an intrusive 143 //!Trait class to detect if an index is an intrusive
136 //!index. 144 //!index.
137 template<class MapConfig> 145 template<class MapConfig>
138 struct is_intrusive_index 146 struct is_intrusive_index
139 <boost::interprocess::iset_index<MapConfig> > 147 <boost::interprocess::iset_index<MapConfig> >
140 { 148 {
141 static const bool value = true; 149 static const bool value = true;
142 }; 150 };
143 /// @endcond 151 #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
144 152
145 } //namespace interprocess { 153 } //namespace interprocess {
146 } //namespace boost 154 } //namespace boost
147 155
148 #include <boost/interprocess/detail/config_end.hpp> 156 #include <boost/interprocess/detail/config_end.hpp>