Chris@16: ///////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // (C) Copyright Olaf Krzikalla 2004-2006. Chris@16: // (C) Copyright Ion Gaztanaga 2006-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_LIST_NODE_HPP Chris@16: #define BOOST_INTRUSIVE_LIST_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@101: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace intrusive { Chris@16: Chris@16: // list_node_traits can be used with circular_list_algorithms and supplies Chris@16: // a list_node holding the pointers needed for a double-linked list Chris@16: // it is used by list_derived_node and list_member_node Chris@16: Chris@16: template Chris@16: struct list_node Chris@16: { Chris@101: typedef typename pointer_rebind::type node_ptr; Chris@16: node_ptr next_; Chris@16: node_ptr prev_; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct list_node_traits Chris@16: { Chris@101: typedef list_node node; 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_previous(const const_node_ptr & n) Chris@16: { return n->prev_; } Chris@16: Chris@16: static node_ptr get_previous(const node_ptr & n) Chris@16: { return n->prev_; } Chris@16: Chris@16: static void set_previous(const node_ptr & n, const node_ptr & prev) Chris@16: { n->prev_ = prev; } Chris@16: Chris@16: static node_ptr get_next(const const_node_ptr & n) Chris@16: { return n->next_; } Chris@16: Chris@16: static node_ptr get_next(const node_ptr & n) Chris@16: { return n->next_; } Chris@16: Chris@16: static void set_next(const node_ptr & n, const node_ptr & next) Chris@16: { n->next_ = next; } Chris@16: }; Chris@16: Chris@16: } //namespace intrusive Chris@16: } //namespace boost Chris@16: Chris@16: #endif //BOOST_INTRUSIVE_LIST_NODE_HPP