Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:37

0001 /////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Olaf Krzikalla 2004-2006.
0004 // (C) Copyright Ion Gaztanaga  2006-2013
0005 //
0006 // Distributed under the Boost Software License, Version 1.0.
0007 //    (See accompanying file LICENSE_1_0.txt or copy at
0008 //          http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 // See http://www.boost.org/libs/intrusive for documentation.
0011 //
0012 /////////////////////////////////////////////////////////////////////////////
0013 
0014 #ifndef BOOST_INTRUSIVE_LIST_NODE_HPP
0015 #define BOOST_INTRUSIVE_LIST_NODE_HPP
0016 
0017 #ifndef BOOST_CONFIG_HPP
0018 #  include <boost/config.hpp>
0019 #endif
0020 
0021 #if defined(BOOST_HAS_PRAGMA_ONCE)
0022 #  pragma once
0023 #endif
0024 
0025 #include <boost/intrusive/detail/workaround.hpp>
0026 #include <boost/intrusive/pointer_rebind.hpp>
0027 
0028 namespace boost {
0029 namespace intrusive {
0030 
0031 // list_node_traits can be used with circular_list_algorithms and supplies
0032 // a list_node holding the pointers needed for a double-linked list
0033 // it is used by list_derived_node and list_member_node
0034 
0035 template<class VoidPointer>
0036 struct list_node
0037 {
0038    typedef typename pointer_rebind<VoidPointer, list_node>::type  node_ptr;
0039    node_ptr next_;
0040    node_ptr prev_;
0041 };
0042 
0043 template<class VoidPointer>
0044 struct list_node_traits
0045 {
0046    typedef list_node<VoidPointer>      node;
0047    typedef typename node::node_ptr     node_ptr;
0048    typedef typename pointer_rebind<VoidPointer, const node>::type   const_node_ptr;
0049 
0050    BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const_node_ptr n)
0051    {  return n->prev_;  }
0052 
0053    BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(node_ptr n)
0054    {  return n->prev_;  }
0055 
0056    BOOST_INTRUSIVE_FORCEINLINE static void set_previous(node_ptr n, node_ptr prev)
0057    {  n->prev_ = prev;  }
0058 
0059    BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const_node_ptr n)
0060    {  return n->next_;  }
0061 
0062    BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(node_ptr n)
0063    {  return n->next_;  }
0064 
0065    BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
0066    {  n->next_ = next;  }
0067 };
0068 
0069 } //namespace intrusive
0070 } //namespace boost
0071 
0072 #endif //BOOST_INTRUSIVE_LIST_NODE_HPP