1 ////////////////////////////////////////////////////////////////////////////// 2 // 3 // (C) Copyright Ion Gaztanaga 2005-2014. Distributed under the Boost 4 // Software License, Version 1.0. (See accompanying file 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // See http://www.boost.org/libs/container for documentation. 8 // 9 ////////////////////////////////////////////////////////////////////////////// 10 11 #ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP 12 #define BOOST_CONTAINER_CONTAINER_FWD_HPP 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 22 //! \file 23 //! This header file forward declares the following containers: 24 //! - boost::container::vector 25 //! - boost::container::stable_vector 26 //! - boost::container::static_vector 27 //! - boost::container::small_vector 28 //! - boost::container::slist 29 //! - boost::container::list 30 //! - boost::container::set 31 //! - boost::container::multiset 32 //! - boost::container::map 33 //! - boost::container::multimap 34 //! - boost::container::flat_set 35 //! - boost::container::flat_multiset 36 //! - boost::container::flat_map 37 //! - boost::container::flat_multimap 38 //! - boost::container::basic_string 39 //! - boost::container::string 40 //! - boost::container::wstring 41 //! 42 //! Forward declares the following allocators: 43 //! - boost::container::allocator 44 //! - boost::container::node_allocator 45 //! - boost::container::adaptive_pool 46 //! 47 //! Forward declares the following polymorphic resource classes: 48 //! - boost::container::pmr::memory_resource 49 //! - boost::container::pmr::polymorphic_allocator 50 //! - boost::container::pmr::monotonic_buffer_resource 51 //! - boost::container::pmr::pool_options 52 //! - boost::container::pmr::unsynchronized_pool_resource 53 //! - boost::container::pmr::synchronized_pool_resource 54 //! 55 //! And finally it defines the following types 56 57 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 58 59 //Std forward declarations 60 #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP 61 #include <boost/container/detail/std_fwd.hpp> 62 #endif 63 64 namespace boost{ 65 namespace intrusive{ 66 namespace detail{ 67 //Create namespace to avoid compilation errors 68 }}} 69 70 namespace boost{ namespace container{ namespace container_detail{ 71 namespace bi = boost::intrusive; 72 namespace bid = boost::intrusive::detail; 73 }}} 74 75 namespace boost{ namespace container{ namespace pmr{ 76 namespace bi = boost::intrusive; 77 namespace bid = boost::intrusive::detail; 78 }}} 79 80 #include <cstddef> 81 82 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 83 84 ////////////////////////////////////////////////////////////////////////////// 85 // Containers 86 ////////////////////////////////////////////////////////////////////////////// 87 88 namespace boost { 89 namespace container { 90 91 //! Enumeration used to configure ordered associative containers 92 //! with a concrete tree implementation. 93 enum tree_type_enum 94 { 95 red_black_tree, 96 avl_tree, 97 scapegoat_tree, 98 splay_tree 99 }; 100 101 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 102 103 template<class T> 104 class new_allocator; 105 106 template <class T 107 ,class Allocator = new_allocator<T> > 108 class vector; 109 110 template <class T 111 ,class Allocator = new_allocator<T> > 112 class stable_vector; 113 114 template <class T, std::size_t Capacity> 115 class static_vector; 116 117 template < class T, std::size_t N 118 , class Allocator= new_allocator<T> > 119 class small_vector; 120 121 template <class T 122 ,class Allocator = new_allocator<T> > 123 class deque; 124 125 template <class T 126 ,class Allocator = new_allocator<T> > 127 class list; 128 129 template <class T 130 ,class Allocator = new_allocator<T> > 131 class slist; 132 133 template<tree_type_enum TreeType, bool OptimizeSize> 134 struct tree_opt; 135 136 typedef tree_opt<red_black_tree, true> tree_assoc_defaults; 137 138 template <class Key 139 ,class Compare = std::less<Key> 140 ,class Allocator = new_allocator<Key> 141 ,class Options = tree_assoc_defaults > 142 class set; 143 144 template <class Key 145 ,class Compare = std::less<Key> 146 ,class Allocator = new_allocator<Key> 147 ,class Options = tree_assoc_defaults > 148 class multiset; 149 150 template <class Key 151 ,class T 152 ,class Compare = std::less<Key> 153 ,class Allocator = new_allocator<std::pair<const Key, T> > 154 ,class Options = tree_assoc_defaults > 155 class map; 156 157 template <class Key 158 ,class T 159 ,class Compare = std::less<Key> 160 ,class Allocator = new_allocator<std::pair<const Key, T> > 161 ,class Options = tree_assoc_defaults > 162 class multimap; 163 164 template <class Key 165 ,class Compare = std::less<Key> 166 ,class Allocator = new_allocator<Key> > 167 class flat_set; 168 169 template <class Key 170 ,class Compare = std::less<Key> 171 ,class Allocator = new_allocator<Key> > 172 class flat_multiset; 173 174 template <class Key 175 ,class T 176 ,class Compare = std::less<Key> 177 ,class Allocator = new_allocator<std::pair<Key, T> > > 178 class flat_map; 179 180 template <class Key 181 ,class T 182 ,class Compare = std::less<Key> 183 ,class Allocator = new_allocator<std::pair<Key, T> > > 184 class flat_multimap; 185 186 template <class CharT 187 ,class Traits = std::char_traits<CharT> 188 ,class Allocator = new_allocator<CharT> > 189 class basic_string; 190 191 typedef basic_string 192 <char 193 ,std::char_traits<char> 194 ,new_allocator<char> > 195 string; 196 197 typedef basic_string 198 <wchar_t 199 ,std::char_traits<wchar_t> 200 ,new_allocator<wchar_t> > 201 wstring; 202 203 static const std::size_t ADP_nodes_per_block = 256u; 204 static const std::size_t ADP_max_free_blocks = 2u; 205 static const std::size_t ADP_overhead_percent = 1u; 206 static const std::size_t ADP_only_alignment = 0u; 207 208 template < class T 209 , std::size_t NodesPerBlock = ADP_nodes_per_block 210 , std::size_t MaxFreeBlocks = ADP_max_free_blocks 211 , std::size_t OverheadPercent = ADP_overhead_percent 212 , unsigned Version = 2 213 > 214 class adaptive_pool; 215 216 template < class T 217 , unsigned Version = 2 218 , unsigned int AllocationDisableMask = 0> 219 class allocator; 220 221 static const std::size_t NodeAlloc_nodes_per_block = 256u; 222 223 template 224 < class T 225 , std::size_t NodesPerBlock = NodeAlloc_nodes_per_block 226 , std::size_t Version = 2> 227 class node_allocator; 228 229 namespace pmr { 230 231 class memory_resource; 232 233 template<class T> 234 class polymorphic_allocator; 235 236 class monotonic_buffer_resource; 237 238 struct pool_options; 239 240 template <class Allocator> 241 class resource_adaptor_imp; 242 243 class unsynchronized_pool_resource; 244 245 class synchronized_pool_resource; 246 247 } //namespace pmr { 248 249 #else 250 251 //! Default options for tree-based associative containers 252 //! - tree_type<red_black_tree> 253 //! - optimize_size<true> 254 typedef implementation_defined tree_assoc_defaults; 255 256 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 257 258 //! Type used to tag that the input range is 259 //! guaranteed to be ordered 260 struct ordered_range_t 261 {}; 262 263 //! Value used to tag that the input range is 264 //! guaranteed to be ordered 265 static const ordered_range_t ordered_range = ordered_range_t(); 266 267 //! Type used to tag that the input range is 268 //! guaranteed to be ordered and unique 269 struct ordered_unique_range_t 270 : public ordered_range_t 271 {}; 272 273 //! Value used to tag that the input range is 274 //! guaranteed to be ordered and unique 275 static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t(); 276 277 //! Type used to tag that the inserted values 278 //! should be default initialized 279 struct default_init_t 280 {}; 281 282 //! Value used to tag that the inserted values 283 //! should be default initialized 284 static const default_init_t default_init = default_init_t(); 285 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 286 287 //! Type used to tag that the inserted values 288 //! should be value initialized 289 struct value_init_t 290 {}; 291 292 //! Value used to tag that the inserted values 293 //! should be value initialized 294 static const value_init_t value_init = value_init_t(); 295 296 namespace container_detail_really_deep_namespace { 297 298 //Otherwise, gcc issues a warning of previously defined 299 //anonymous_instance and unique_instance 300 struct dummy 301 { dummyboost::container::container_detail_really_deep_namespace::dummy302 dummy() 303 { 304 (void)ordered_range; 305 (void)ordered_unique_range; 306 (void)default_init; 307 } 308 }; 309 310 } //detail_really_deep_namespace { 311 312 313 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 314 315 }} //namespace boost { namespace container { 316 317 #endif //#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP 318