1 /////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2007-2013
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/libs/intrusive for documentation.
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef BOOST_INTRUSIVE_FWD_HPP
14 #define BOOST_INTRUSIVE_FWD_HPP
16 #ifndef BOOST_CONFIG_HPP
17 # include <boost/config.hpp>
20 #ifndef BOOST_CSTDINT_HPP
21 # include <boost/cstdint.hpp>
24 #if defined(BOOST_HAS_PRAGMA_ONCE)
29 //! This header file forward declares most Intrusive classes.
31 //! It forward declares the following containers and hooks:
32 //! - boost::intrusive::slist / boost::intrusive::slist_base_hook / boost::intrusive::slist_member_hook
33 //! - boost::intrusive::list / boost::intrusive::list_base_hook / boost::intrusive::list_member_hook
34 //! - boost::intrusive::bstree / boost::intrusive::bs_set / boost::intrusive::bs_multiset /
35 //! boost::intrusive::bs_set_base_hook / boost::intrusive::bs_set_member_hook
36 //! - boost::intrusive::rbtree / boost::intrusive::set / boost::intrusive::multiset /
37 //! boost::intrusive::set_base_hook / boost::intrusive::set_member_hook
38 //! - boost::intrusive::avltree / boost::intrusive::avl_set / boost::intrusive::avl_multiset /
39 //! boost::intrusive::avl_set_base_hook / boost::intrusive::avl_set_member_hook
40 //! - boost::intrusive::splaytree / boost::intrusive::splay_set / boost::intrusive::splay_multiset
41 //! - boost::intrusive::sgtree / boost::intrusive::sg_set / boost::intrusive::sg_multiset
42 //! - boost::intrusive::treap / boost::intrusive::treap_set / boost::intrusive::treap_multiset
43 //! - boost::intrusive::hashtable / boost::intrusive::unordered_set / boost::intrusive::unordered_multiset /
44 //! boost::intrusive::unordered_set_base_hook / boost::intrusive::unordered_set_member_hook /
45 //! - boost::intrusive::any_base_hook / boost::intrusive::any_member_hook
47 //! It forward declares the following container or hook options:
48 //! - boost::intrusive::constant_time_size / boost::intrusive::size_type / boost::intrusive::compare / boost::intrusive::equal
49 //! - boost::intrusive::floating_point / boost::intrusive::priority / boost::intrusive::hash
50 //! - boost::intrusive::value_traits / boost::intrusive::member_hook / boost::intrusive::function_hook / boost::intrusive::base_hook
51 //! - boost::intrusive::void_pointer / boost::intrusive::tag / boost::intrusive::link_mode
52 //! - boost::intrusive::optimize_size / boost::intrusive::linear / boost::intrusive::cache_last
53 //! - boost::intrusive::bucket_traits / boost::intrusive::store_hash / boost::intrusive::optimize_multikey
54 //! - boost::intrusive::power_2_buckets / boost::intrusive::cache_begin / boost::intrusive::compare_hash / boost::intrusive::incremental
56 //! It forward declares the following value traits utilities:
57 //! - boost::intrusive::value_traits / boost::intrusive::derivation_value_traits /
58 //! boost::intrusive::trivial_value_traits
60 //! Finally it forward declares the following general purpose utilities:
61 //! - boost::intrusive::pointer_plus_bits / boost::intrusive::priority_compare.
63 #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
66 #include <boost/intrusive/link_mode.hpp>
67 #include <boost/intrusive/detail/workaround.hpp>
72 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
73 # ifdef BOOST_HAS_INTPTR_T
74 using ::boost::uintptr_t;
76 typedef std::size_t uintptr_t;
80 ////////////////////////////
82 ////////////////////////////
84 //Algorithms predeclarations
85 template<class NodeTraits>
86 class circular_list_algorithms;
88 template<class NodeTraits>
89 class circular_slist_algorithms;
91 template<class NodeTraits>
92 class linear_slist_algorithms;
94 template<class NodeTraits>
95 class bstree_algorithms;
97 template<class NodeTraits>
98 class rbtree_algorithms;
100 template<class NodeTraits>
101 class avltree_algorithms;
103 template<class NodeTraits>
104 class sgtree_algorithms;
106 template<class NodeTraits>
107 class splaytree_algorithms;
109 template<class NodeTraits>
110 class treap_algorithms;
112 ////////////////////////////
114 ////////////////////////////
117 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
128 template<class T, class ...Options>
132 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
139 template<class ...Options>
141 class slist_base_hook;
143 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
150 template<class ...Options>
152 class slist_member_hook;
155 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
164 template<class T, class ...Options>
168 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
175 template<class ...Options>
177 class list_base_hook;
179 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
186 template<class ...Options>
188 class list_member_hook;
190 //rbtree/set/multiset
191 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
202 template<class T, class ...Options>
206 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
217 template<class T, class ...Options>
221 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
232 template<class T, class ...Options>
236 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
244 template<class ...Options>
248 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
256 template<class ...Options>
258 class set_member_hook;
260 //splaytree/splay_set/splay_multiset
261 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
272 template<class T, class ...Options>
276 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
287 template<class T, class ...Options>
291 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
302 template<class T, class ...Options>
304 class splay_multiset;
306 //avltree/avl_set/avl_multiset
307 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
318 template<class T, class ...Options>
322 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
333 template<class T, class ...Options>
337 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
348 template<class T, class ...Options>
352 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
360 template<class ...Options>
362 class avl_set_base_hook;
364 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
372 template<class ...Options>
374 class avl_set_member_hook;
377 //treap/treap_set/treap_multiset
378 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
390 template<class T, class ...Options>
394 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
406 template<class T, class ...Options>
410 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
422 template<class T, class ...Options>
424 class treap_multiset;
426 //sgtree/sg_set/sg_multiset
427 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
438 template<class T, class ...Options>
442 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
453 template<class T, class ...Options>
457 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
468 template<class T, class ...Options>
472 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
483 template<class T, class ...Options>
487 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
498 template<class T, class ...Options>
502 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
513 template<class T, class ...Options>
517 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
524 template<class ...Options>
526 class bs_set_base_hook;
528 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
535 template<class ...Options>
537 class bs_set_member_hook;
539 //hashtable/unordered_set/unordered_multiset
541 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
556 template<class T, class ...Options>
560 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
575 template<class T, class ...Options>
579 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
594 template<class T, class ...Options>
596 class unordered_multiset;
598 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
606 template<class ...Options>
608 class unordered_set_base_hook;
610 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
618 template<class ...Options>
620 class unordered_set_member_hook;
622 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
629 template<class ...Options>
633 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
640 template<class ...Options>
642 class any_member_hook;
646 template<bool Enabled>
647 struct constant_time_size;
649 template<typename SizeType>
652 template<typename Compare>
655 template<bool Enabled>
656 struct floating_point;
658 template<typename Equal>
661 template<typename Priority>
664 template<typename Hash>
667 template<typename ValueTraits> struct value_traits;
669 template< typename Parent
670 , typename MemberHook
671 , MemberHook Parent::* PtrToMember>
674 template<typename Functor>
675 struct function_hook;
677 template<typename BaseHook>
680 template<typename VoidPointer>
683 template<typename Tag>
686 template<link_mode_type LinkType>
689 template<bool Enabled> struct
692 template<bool Enabled>
695 template<bool Enabled>
698 template<typename BucketTraits>
699 struct bucket_traits;
701 template<bool Enabled>
704 template<bool Enabled>
705 struct optimize_multikey;
707 template<bool Enabled>
708 struct power_2_buckets;
710 template<bool Enabled>
713 template<bool Enabled>
716 template<bool Enabled>
721 template<typename ValueTraits>
724 template< typename Parent
725 , typename MemberHook
726 , MemberHook Parent::* PtrToMember>
729 template< typename Functor>
730 struct function_hook;
732 template<typename BaseHook>
735 template<class T, class NodeTraits, link_mode_type LinkMode = safe_link>
736 struct derivation_value_traits;
738 template<class NodeTraits, link_mode_type LinkMode = normal_link>
739 struct trivial_value_traits;
741 //Additional utilities
743 template<typename VoidPointer, std::size_t Alignment>
744 struct max_pointer_plus_bits;
746 template<std::size_t Alignment>
747 struct max_pointer_plus_bits<void *, Alignment>;
749 template<typename Pointer, std::size_t NumBits>
750 struct pointer_plus_bits;
752 template<typename T, std::size_t NumBits>
753 struct pointer_plus_bits<T *, NumBits>;
755 template<typename Ptr>
756 struct pointer_traits;
759 struct pointer_traits<T *>;
761 } //namespace intrusive {
762 } //namespace boost {
764 #endif //#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
766 #endif //#ifndef BOOST_INTRUSIVE_FWD_HPP