1 //////////////////////////////////////////////////////////////////////////////
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)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP
12 #define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP
14 #ifndef BOOST_CONFIG_HPP
15 # include <boost/config.hpp>
18 #if defined(BOOST_HAS_PRAGMA_ONCE)
22 #include <boost/interprocess/detail/config_begin.hpp>
23 #include <boost/interprocess/detail/workaround.hpp>
25 #ifdef BOOST_INTERPROCESS_WINDOWS
26 #include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
28 #include <boost/interprocess/detail/portable_intermodule_singleton.hpp>
32 namespace interprocess{
35 //Now this class is a singleton, initializing the singleton in
36 //the first get() function call if LazyInit is false. If true
37 //then the singleton will be initialized when loading the module.
38 template<typename C, bool LazyInit = true, bool Phoenix = false>
39 class intermodule_singleton
40 #ifdef BOOST_INTERPROCESS_WINDOWS
41 : public windows_intermodule_singleton<C, LazyInit, Phoenix>
43 : public portable_intermodule_singleton<C, LazyInit, Phoenix>
47 } //namespace ipcdetail{
48 } //namespace interprocess{
51 #include <boost/interprocess/detail/config_end.hpp>