node_tools.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #
  16. #if defined(BOOST_HAS_PRAGMA_ONCE)
  17. # pragma once
  18. #endif
  19. #include <boost/interprocess/detail/config_begin.hpp>
  20. #include <boost/interprocess/detail/workaround.hpp>
  21. #include <boost/intrusive/slist.hpp>
  22. namespace boost {
  23. namespace interprocess {
  24. namespace ipcdetail {
  25. template<class VoidPointer>
  26. struct node_slist
  27. {
  28. //This hook will be used to chain the individual nodes
  29. typedef typename bi::make_slist_base_hook
  30. <bi::void_pointer<VoidPointer>, bi::link_mode<bi::normal_link> >::type slist_hook_t;
  31. //A node object will hold node_t when it's not allocated
  32. struct node_t
  33. : public slist_hook_t
  34. {};
  35. typedef typename bi::make_slist
  36. <node_t, bi::linear<true>, bi::base_hook<slist_hook_t> >::type node_slist_t;
  37. };
  38. } //namespace ipcdetail {
  39. } //namespace interprocess {
  40. } //namespace boost {
  41. #include <boost/interprocess/detail/config_end.hpp>
  42. #endif //#ifndef BOOST_INTERPROCESS_DETAIL_NODE_TOOLS_HPP