1 /////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Olaf Krzikalla 2004-2006.
4 // (C) Copyright Ion Gaztanaga 2006-2013
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
10 // See http://www.boost.org/libs/intrusive for documentation.
12 /////////////////////////////////////////////////////////////////////////////
14 #ifndef BOOST_INTRUSIVE_LIST_NODE_HPP
15 #define BOOST_INTRUSIVE_LIST_NODE_HPP
17 #ifndef BOOST_CONFIG_HPP
18 # include <boost/config.hpp>
21 #if defined(BOOST_HAS_PRAGMA_ONCE)
25 #include <boost/intrusive/detail/workaround.hpp>
26 #include <boost/intrusive/pointer_rebind.hpp>
31 // list_node_traits can be used with circular_list_algorithms and supplies
32 // a list_node holding the pointers needed for a double-linked list
33 // it is used by list_derived_node and list_member_node
35 template<class VoidPointer>
38 typedef typename pointer_rebind<VoidPointer, list_node>::type node_ptr;
43 template<class VoidPointer>
44 struct list_node_traits
46 typedef list_node<VoidPointer> node;
47 typedef typename node::node_ptr node_ptr;
48 typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
50 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const const_node_ptr & n)
53 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const node_ptr & n)
56 BOOST_INTRUSIVE_FORCEINLINE static void set_previous(const node_ptr & n, const node_ptr & prev)
59 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
62 BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n)
65 BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
69 } //namespace intrusive
72 #endif //BOOST_INTRUSIVE_LIST_NODE_HPP