intermodule_singleton.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2009-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_INTERMODULE_SINGLETON_HPP
  11. #define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_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. #ifdef BOOST_INTERPROCESS_WINDOWS
  18. #include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
  19. #endif
  20. #include <boost/interprocess/detail/portable_intermodule_singleton.hpp>
  21. namespace boost{
  22. namespace interprocess{
  23. namespace ipcdetail{
  24. //Now this class is a singleton, initializing the singleton in
  25. //the first get() function call if LazyInit is false. If true
  26. //then the singleton will be initialized when loading the module.
  27. template<typename C, bool LazyInit = true, bool Phoenix = true>
  28. class intermodule_singleton
  29. #ifdef BOOST_INTERPROCESS_WINDOWS
  30. : public windows_intermodule_singleton<C, LazyInit, Phoenix>
  31. #else
  32. : public portable_intermodule_singleton<C, LazyInit, Phoenix>
  33. #endif
  34. {};
  35. } //namespace ipcdetail{
  36. } //namespace interprocess{
  37. } //namespace boost{
  38. #include <boost/interprocess/detail/config_end.hpp>
  39. #endif