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