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_TREE_NODE_HPP
14 #define BOOST_INTRUSIVE_TREE_NODE_HPP
16 #ifndef BOOST_CONFIG_HPP
17 # include <boost/config.hpp>
20 #if defined(BOOST_HAS_PRAGMA_ONCE)
24 #include <boost/intrusive/detail/config_begin.hpp>
25 #include <boost/intrusive/detail/workaround.hpp>
26 #include <boost/intrusive/pointer_rebind.hpp>
31 template<class VoidPointer>
34 typedef typename pointer_rebind<VoidPointer, tree_node>::type node_ptr;
36 node_ptr parent_, left_, right_;
39 template<class VoidPointer>
40 struct tree_node_traits
42 typedef tree_node<VoidPointer> node;
44 typedef typename node::node_ptr node_ptr;
45 typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
47 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
48 { return n->parent_; }
50 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
51 { return n->parent_; }
53 BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
56 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
59 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
62 BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
65 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
68 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
71 BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
75 } //namespace intrusive
78 #include <boost/intrusive/detail/config_end.hpp>
80 #endif //BOOST_INTRUSIVE_TREE_NODE_HPP