File indexing completed on 2025-01-18 09:38:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_INTERPROCESS_FLAT_MAP_INDEX_HPP
0011 #define BOOST_INTERPROCESS_FLAT_MAP_INDEX_HPP
0012
0013 #ifndef BOOST_CONFIG_HPP
0014 # include <boost/config.hpp>
0015 #endif
0016 #
0017 #if defined(BOOST_HAS_PRAGMA_ONCE)
0018 # pragma once
0019 #endif
0020
0021 #include <boost/interprocess/detail/config_begin.hpp>
0022 #include <boost/interprocess/detail/workaround.hpp>
0023
0024
0025 #include <boost/interprocess/containers/flat_map.hpp>
0026 #include <boost/interprocess/allocators/allocator.hpp>
0027
0028 #include <boost/intrusive/detail/minimal_pair_header.hpp> //std::pair
0029 #include <boost/intrusive/detail/minimal_less_equal_header.hpp> //std::less
0030
0031
0032
0033
0034
0035
0036
0037 namespace boost { namespace interprocess {
0038
0039 #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
0040
0041
0042 template <class MapConfig>
0043 struct flat_map_index_aux
0044 {
0045 typedef typename MapConfig::key_type key_type;
0046 typedef typename MapConfig::mapped_type mapped_type;
0047 typedef typename MapConfig::
0048 segment_manager_base segment_manager_base;
0049 typedef std::less<key_type> key_less;
0050 typedef std::pair<key_type, mapped_type> value_type;
0051 typedef allocator<value_type
0052 ,segment_manager_base> allocator_type;
0053 typedef flat_map<key_type, mapped_type,
0054 key_less, allocator_type> index_t;
0055 };
0056
0057 #endif
0058
0059
0060
0061 template <class MapConfig>
0062 class flat_map_index
0063
0064 : public flat_map_index_aux<MapConfig>::index_t
0065 {
0066 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0067 typedef flat_map_index_aux<MapConfig> index_aux;
0068 typedef typename index_aux::index_t base_type;
0069 typedef typename index_aux::
0070 segment_manager_base segment_manager_base;
0071 #endif
0072
0073 public:
0074
0075 flat_map_index(segment_manager_base *segment_mngr)
0076 : base_type(typename index_aux::key_less(),
0077 typename index_aux::allocator_type(segment_mngr))
0078 {}
0079
0080
0081 void reserve(typename segment_manager_base::size_type n)
0082 { base_type::reserve(n); }
0083
0084
0085 void shrink_to_fit()
0086 { base_type::shrink_to_fit(); }
0087 };
0088
0089 }}
0090
0091 #include <boost/interprocess/detail/config_end.hpp>
0092
0093 #endif