Chris@16: ///////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // (C) Copyright Ion Gaztanaga 2007-2013 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/intrusive for documentation. Chris@16: // Chris@16: ///////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #ifndef BOOST_INTRUSIVE_TREE_NODE_HPP Chris@16: #define BOOST_INTRUSIVE_TREE_NODE_HPP Chris@16: Chris@101: #ifndef BOOST_CONFIG_HPP Chris@101: # include Chris@101: #endif Chris@101: Chris@101: #if defined(BOOST_HAS_PRAGMA_ONCE) Chris@101: # pragma once Chris@101: #endif Chris@101: Chris@16: #include Chris@101: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace intrusive { Chris@16: Chris@16: template Chris@16: struct tree_node Chris@16: { Chris@101: typedef typename pointer_rebind::type node_ptr; Chris@16: Chris@16: node_ptr parent_, left_, right_; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct tree_node_traits Chris@16: { Chris@16: typedef tree_node node; Chris@16: Chris@101: typedef typename node::node_ptr node_ptr; Chris@101: typedef typename pointer_rebind::type const_node_ptr; Chris@16: Chris@16: static node_ptr get_parent(const const_node_ptr & n) Chris@16: { return n->parent_; } Chris@16: Chris@16: static node_ptr get_parent(const node_ptr & n) Chris@16: { return n->parent_; } Chris@16: Chris@16: static void set_parent(const node_ptr & n, const node_ptr & p) Chris@16: { n->parent_ = p; } Chris@16: Chris@16: static node_ptr get_left(const const_node_ptr & n) Chris@16: { return n->left_; } Chris@16: Chris@16: static node_ptr get_left(const node_ptr & n) Chris@16: { return n->left_; } Chris@16: Chris@16: static void set_left(const node_ptr & n, const node_ptr & l) Chris@16: { n->left_ = l; } Chris@16: Chris@16: static node_ptr get_right(const const_node_ptr & n) Chris@16: { return n->right_; } Chris@16: Chris@16: static node_ptr get_right(const node_ptr & n) Chris@16: { return n->right_; } Chris@16: Chris@16: static void set_right(const node_ptr & n, const node_ptr & r) Chris@16: { n->right_ = r; } Chris@16: }; Chris@16: Chris@16: } //namespace intrusive Chris@16: } //namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif //BOOST_INTRUSIVE_TREE_NODE_HPP