File indexing completed on 2025-01-18 09:38:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef BOOST_INTRUSIVE_TREE_NODE_HPP
0014 #define BOOST_INTRUSIVE_TREE_NODE_HPP
0015
0016 #ifndef BOOST_CONFIG_HPP
0017 # include <boost/config.hpp>
0018 #endif
0019
0020 #if defined(BOOST_HAS_PRAGMA_ONCE)
0021 # pragma once
0022 #endif
0023
0024 #include <boost/intrusive/detail/config_begin.hpp>
0025 #include <boost/intrusive/detail/workaround.hpp>
0026 #include <boost/intrusive/pointer_rebind.hpp>
0027
0028 namespace boost {
0029 namespace intrusive {
0030
0031 template<class VoidPointer>
0032 struct tree_node
0033 {
0034 typedef typename pointer_rebind<VoidPointer, tree_node>::type node_ptr;
0035
0036 node_ptr parent_, left_, right_;
0037 };
0038
0039 template<class VoidPointer>
0040 struct tree_node_traits
0041 {
0042 typedef tree_node<VoidPointer> node;
0043
0044 typedef typename node::node_ptr node_ptr;
0045 typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
0046
0047 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const_node_ptr n)
0048 { return n->parent_; }
0049
0050 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(node_ptr n)
0051 { return n->parent_; }
0052
0053 BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
0054 { n->parent_ = p; }
0055
0056 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const_node_ptr n)
0057 { return n->left_; }
0058
0059 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(node_ptr n)
0060 { return n->left_; }
0061
0062 BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
0063 { n->left_ = l; }
0064
0065 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const_node_ptr n)
0066 { return n->right_; }
0067
0068 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(node_ptr n)
0069 { return n->right_; }
0070
0071 BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
0072 { n->right_ = r; }
0073 };
0074
0075 }
0076 }
0077
0078 #include <boost/intrusive/detail/config_end.hpp>
0079
0080 #endif