container_fwd.hpp 8.2 KB

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