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)
389 template<class T, class ...Options>
393 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
404 template<class T, class ...Options>
408 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
419 template<class T, class ...Options>
421 class treap_multiset;
423 //sgtree/sg_set/sg_multiset
424 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
435 template<class T, class ...Options>
439 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
450 template<class T, class ...Options>
454 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
465 template<class T, class ...Options>
469 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
480 template<class T, class ...Options>
484 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
495 template<class T, class ...Options>
499 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
510 template<class T, class ...Options>
514 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
521 template<class ...Options>
523 class bs_set_base_hook;
525 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
532 template<class ...Options>
534 class bs_set_member_hook;
536 //hashtable/unordered_set/unordered_multiset
538 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
553 template<class T, class ...Options>
557 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
572 template<class T, class ...Options>
576 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
591 template<class T, class ...Options>
593 class unordered_multiset;
595 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
603 template<class ...Options>
605 class unordered_set_base_hook;
607 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
615 template<class ...Options>
617 class unordered_set_member_hook;
619 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
626 template<class ...Options>
630 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
637 template<class ...Options>
639 class any_member_hook;
643 template<bool Enabled>
644 struct constant_time_size;
646 template<typename SizeType>
649 template<typename Compare>
652 template<bool Enabled>
653 struct floating_point;
655 template<typename Equal>
658 template<typename Priority>
661 template<typename Hash>
664 template<typename ValueTraits> struct value_traits;
666 template< typename Parent
667 , typename MemberHook
668 , MemberHook Parent::* PtrToMember>
671 template<typename Functor>
672 struct function_hook;
674 template<typename BaseHook>
677 template<typename VoidPointer>
680 template<typename Tag>
683 template<link_mode_type LinkType>
686 template<bool Enabled> struct
689 template<bool Enabled>
692 template<bool Enabled>
695 template<typename BucketTraits>
696 struct bucket_traits;
698 template<bool Enabled>
701 template<bool Enabled>
702 struct optimize_multikey;
704 template<bool Enabled>
705 struct power_2_buckets;
707 template<bool Enabled>
710 template<bool Enabled>
713 template<bool Enabled>
718 template<typename ValueTraits>
721 template< typename Parent
722 , typename MemberHook
723 , MemberHook Parent::* PtrToMember>
726 template< typename Functor>
727 struct function_hook;
729 template<typename BaseHook>
732 template<class T, class NodeTraits, link_mode_type LinkMode = safe_link>
733 struct derivation_value_traits;
735 template<class NodeTraits, link_mode_type LinkMode = normal_link>
736 struct trivial_value_traits;
738 //Additional utilities
740 template<typename VoidPointer, std::size_t Alignment>
741 struct max_pointer_plus_bits;
743 template<std::size_t Alignment>
744 struct max_pointer_plus_bits<void *, Alignment>;
746 template<typename Pointer, std::size_t NumBits>
747 struct pointer_plus_bits;
749 template<typename T, std::size_t NumBits>
750 struct pointer_plus_bits<T *, NumBits>;
752 template<typename Ptr>
753 struct pointer_traits;
756 struct pointer_traits<T *>;
758 } //namespace intrusive {
759 } //namespace boost {
761 #endif //#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
763 #endif //#ifndef BOOST_INTRUSIVE_FWD_HPP