• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_base
28 //!   - boost::container::small_vector
29 //!   - boost::container::slist
30 //!   - boost::container::list
31 //!   - boost::container::set
32 //!   - boost::container::multiset
33 //!   - boost::container::map
34 //!   - boost::container::multimap
35 //!   - boost::container::flat_set
36 //!   - boost::container::flat_multiset
37 //!   - boost::container::flat_map
38 //!   - boost::container::flat_multimap
39 //!   - boost::container::basic_string
40 //!   - boost::container::string
41 //!   - boost::container::wstring
42 //!
43 //! Forward declares the following allocators:
44 //!   - boost::container::allocator
45 //!   - boost::container::node_allocator
46 //!   - boost::container::adaptive_pool
47 //!
48 //! Forward declares the following polymorphic resource classes:
49 //!   - boost::container::pmr::memory_resource
50 //!   - boost::container::pmr::polymorphic_allocator
51 //!   - boost::container::pmr::monotonic_buffer_resource
52 //!   - boost::container::pmr::pool_options
53 //!   - boost::container::pmr::unsynchronized_pool_resource
54 //!   - boost::container::pmr::synchronized_pool_resource
55 //!
56 //! And finally it defines the following types
57 
58 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
59 
60 //Std forward declarations
61 #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP
62    #include <boost/container/detail/std_fwd.hpp>
63 #endif
64 
65 namespace boost{
66 namespace intrusive{
67 namespace detail{
68    //Create namespace to avoid compilation errors
69 }}}
70 
71 namespace boost{ namespace container{ namespace dtl{
72    namespace bi = boost::intrusive;
73    namespace bid = boost::intrusive::detail;
74 }}}
75 
76 namespace boost{ namespace container{ namespace pmr{
77    namespace bi = boost::intrusive;
78    namespace bid = boost::intrusive::detail;
79 }}}
80 
81 #include <cstddef>
82 
83 #endif   //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
84 
85 //////////////////////////////////////////////////////////////////////////////
86 //                             Containers
87 //////////////////////////////////////////////////////////////////////////////
88 
89 namespace boost {
90 namespace container {
91 
92 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
93 
94 template<class T1, class T2>
95 struct pair;
96 
97 template<class T>
98 class new_allocator;
99 
100 template <class T
101          ,class Allocator = void
102          ,class Options   = void>
103 class vector;
104 
105 template <class T
106          ,class Allocator = void >
107 class stable_vector;
108 
109 template < class T
110          , std::size_t Capacity
111          , class Options = void>
112 class static_vector;
113 
114 template < class T
115          , class Allocator = void
116          , class Options   = void >
117 class small_vector_base;
118 
119 template < class T
120          , std::size_t N
121          , class Allocator = void
122          , class Options   = void  >
123 class small_vector;
124 
125 template <class T
126          ,class Allocator = void
127          ,class Options   = void>
128 class deque;
129 
130 template <class T
131          ,class Allocator = void >
132 class list;
133 
134 template <class T
135          ,class Allocator = void >
136 class slist;
137 
138 template <class Key
139          ,class Compare  = std::less<Key>
140          ,class Allocator = void
141          ,class Options = void>
142 class set;
143 
144 template <class Key
145          ,class Compare  = std::less<Key>
146          ,class Allocator = void
147          ,class Options = void >
148 class multiset;
149 
150 template <class Key
151          ,class T
152          ,class Compare  = std::less<Key>
153          ,class Allocator = void
154          ,class Options = void >
155 class map;
156 
157 template <class Key
158          ,class T
159          ,class Compare  = std::less<Key>
160          ,class Allocator = void
161          ,class Options = void >
162 class multimap;
163 
164 template <class Key
165          ,class Compare  = std::less<Key>
166          ,class Allocator = void >
167 class flat_set;
168 
169 template <class Key
170          ,class Compare  = std::less<Key>
171          ,class Allocator = void >
172 class flat_multiset;
173 
174 template <class Key
175          ,class T
176          ,class Compare  = std::less<Key>
177          ,class Allocator = void >
178 class flat_map;
179 
180 template <class Key
181          ,class T
182          ,class Compare  = std::less<Key>
183          ,class Allocator = void >
184 class flat_multimap;
185 
186 #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
187 
188 //! Alias templates for small_flat_[multi]{set|map} using small_vector as container
189 
190 template < class Key
191          , std::size_t N
192          , class Compare  = std::less<Key>
193          , class SmallVectorAllocator = void
194          , class SmallVectorOptions   = void  >
195 using small_flat_set = flat_set<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions>>;
196 
197 template < class Key
198          , std::size_t N
199          , class Compare  = std::less<Key>
200          , class SmallVectorAllocator = void
201          , class SmallVectorOptions   = void  >
202 using small_flat_multiset = flat_multiset<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions>>;
203 
204 template < class Key
205          , class T
206          , std::size_t N
207          , class Compare  = std::less<Key>
208          , class SmallVectorAllocator = void
209          , class SmallVectorOptions   = void  >
210 using small_flat_map = flat_map<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions>>;
211 
212 template < class Key
213          , class T
214          , std::size_t N
215          , class Compare  = std::less<Key>
216          , class SmallVectorAllocator = void
217          , class SmallVectorOptions   = void  >
218 using small_flat_multimap = flat_multimap<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions>>;
219 
220 #endif // #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
221 
222 
223 //! A portable metafunction to obtain a small_flat_set
224 template < class Key
225          , std::size_t N
226          , class Compare  = std::less<Key>
227          , class SmallVectorAllocator = void
228          , class SmallVectorOptions   = void  >
229 struct small_flat_set_of
230 {
231    typedef flat_set<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions> > type;
232 };
233 
234 //! A portable metafunction to obtain a small_flat_multiset
235 template < class Key
236          , std::size_t N
237          , class Compare  = std::less<Key>
238          , class SmallVectorAllocator = void
239          , class SmallVectorOptions   = void  >
240 struct small_flat_multiset_of
241 {
242    typedef flat_multiset<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions> > type;
243 };
244 
245 //! A portable metafunction to obtain a small_flat_map
246 template < class Key
247          , class T
248          , std::size_t N
249          , class Compare  = std::less<Key>
250          , class SmallVectorAllocator = void
251          , class SmallVectorOptions   = void  >
252 struct small_flat_map_of
253 {
254    typedef flat_map<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions> > type;
255 };
256 
257 //! A portable metafunction to obtain a small_flat_multimap
258 template < class Key
259          , class T
260          , std::size_t N
261          , class Compare  = std::less<Key>
262          , class SmallVectorAllocator = void
263          , class SmallVectorOptions   = void  >
264 struct small_flat_multimap_of
265 {
266    typedef flat_multimap<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions> > type;
267 };
268 
269 template <class CharT
270          ,class Traits = std::char_traits<CharT>
271          ,class Allocator  = void >
272 class basic_string;
273 
274 typedef basic_string <char>   string;
275 typedef basic_string<wchar_t> wstring;
276 
277 static const std::size_t ADP_nodes_per_block    = 256u;
278 static const std::size_t ADP_max_free_blocks    = 2u;
279 static const std::size_t ADP_overhead_percent   = 1u;
280 static const std::size_t ADP_only_alignment     = 0u;
281 
282 template < class T
283          , std::size_t NodesPerBlock   = ADP_nodes_per_block
284          , std::size_t MaxFreeBlocks   = ADP_max_free_blocks
285          , std::size_t OverheadPercent = ADP_overhead_percent
286          , unsigned Version = 2
287          >
288 class adaptive_pool;
289 
290 template < class T
291          , unsigned Version = 2
292          , unsigned int AllocationDisableMask = 0>
293 class allocator;
294 
295 static const std::size_t NodeAlloc_nodes_per_block = 256u;
296 
297 template
298    < class T
299    , std::size_t NodesPerBlock = NodeAlloc_nodes_per_block
300    , std::size_t Version = 2>
301 class node_allocator;
302 
303 namespace pmr {
304 
305 class memory_resource;
306 
307 template<class T>
308 class polymorphic_allocator;
309 
310 class monotonic_buffer_resource;
311 
312 struct pool_options;
313 
314 template <class Allocator>
315 class resource_adaptor_imp;
316 
317 class unsynchronized_pool_resource;
318 
319 class synchronized_pool_resource;
320 
321 }  //namespace pmr {
322 
323 #endif   //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
324 
325 //! Type used to tag that the input range is
326 //! guaranteed to be ordered
327 struct ordered_range_t
328 {};
329 
330 //! Value used to tag that the input range is
331 //! guaranteed to be ordered
332 static const ordered_range_t ordered_range = ordered_range_t();
333 
334 //! Type used to tag that the input range is
335 //! guaranteed to be ordered and unique
336 struct ordered_unique_range_t
337    : public ordered_range_t
338 {};
339 
340 //! Value used to tag that the input range is
341 //! guaranteed to be ordered and unique
342 static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t();
343 
344 //! Type used to tag that the inserted values
345 //! should be default initialized
346 struct default_init_t
347 {};
348 
349 //! Value used to tag that the inserted values
350 //! should be default initialized
351 static const default_init_t default_init = default_init_t();
352 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
353 
354 //! Type used to tag that the inserted values
355 //! should be value initialized
356 struct value_init_t
357 {};
358 
359 //! Value used to tag that the inserted values
360 //! should be value initialized
361 static const value_init_t value_init = value_init_t();
362 
363 namespace container_detail_really_deep_namespace {
364 
365 //Otherwise, gcc issues a warning of previously defined
366 //anonymous_instance and unique_instance
367 struct dummy
368 {
dummyboost::container::container_detail_really_deep_namespace::dummy369    dummy()
370    {
371       (void)ordered_range;
372       (void)ordered_unique_range;
373       (void)default_init;
374    }
375 };
376 
377 }  //detail_really_deep_namespace {
378 
379 
380 #endif   //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
381 
382 }}  //namespace boost { namespace container {
383 
384 #endif //#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP
385