node_tools.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2007-2012. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/interprocess for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_INTERPROCESS_DETAIL_NODE_TOOLS_HPP
  11. #define BOOST_INTERPROCESS_DETAIL_NODE_TOOLS_HPP
  12. #if (defined _MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif
  15. #include <boost/interprocess/detail/config_begin.hpp>
  16. #include <boost/interprocess/detail/workaround.hpp>
  17. #include <boost/intrusive/slist.hpp>
  18. namespace boost {
  19. namespace interprocess {
  20. namespace ipcdetail {
  21. template<class VoidPointer>
  22. struct node_slist
  23. {
  24. //This hook will be used to chain the individual nodes
  25. typedef typename bi::make_slist_base_hook
  26. <bi::void_pointer<VoidPointer>, bi::link_mode<bi::normal_link> >::type slist_hook_t;
  27. //A node object will hold node_t when it's not allocated
  28. struct node_t
  29. : public slist_hook_t
  30. {};
  31. typedef typename bi::make_slist
  32. <node_t, bi::linear<true>, bi::base_hook<slist_hook_t> >::type node_slist_t;
  33. };
  34. } //namespace ipcdetail {
  35. } //namespace interprocess {
  36. } //namespace boost {
  37. #include <boost/interprocess/detail/config_end.hpp>
  38. #endif //#ifndef BOOST_INTERPROCESS_DETAIL_NODE_TOOLS_HPP