Chris@16
|
1 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@16
|
3 // (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
|
Chris@16
|
4 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 //
|
Chris@16
|
7 // See http://www.boost.org/libs/interprocess for documentation.
|
Chris@16
|
8 //
|
Chris@16
|
9 //////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP
|
Chris@16
|
12 #define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP
|
Chris@16
|
13
|
Chris@101
|
14 #ifndef BOOST_CONFIG_HPP
|
Chris@101
|
15 # include <boost/config.hpp>
|
Chris@101
|
16 #endif
|
Chris@101
|
17 #
|
Chris@101
|
18 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@16
|
19 #pragma once
|
Chris@16
|
20 #endif
|
Chris@16
|
21
|
Chris@16
|
22 #include <boost/interprocess/detail/config_begin.hpp>
|
Chris@16
|
23 #include <boost/interprocess/detail/workaround.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 #ifdef BOOST_INTERPROCESS_WINDOWS
|
Chris@16
|
26 #include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
|
Chris@101
|
27 #else
|
Chris@101
|
28 #include <boost/interprocess/detail/portable_intermodule_singleton.hpp>
|
Chris@16
|
29 #endif
|
Chris@16
|
30
|
Chris@16
|
31 namespace boost{
|
Chris@16
|
32 namespace interprocess{
|
Chris@16
|
33 namespace ipcdetail{
|
Chris@16
|
34
|
Chris@16
|
35 //Now this class is a singleton, initializing the singleton in
|
Chris@16
|
36 //the first get() function call if LazyInit is false. If true
|
Chris@16
|
37 //then the singleton will be initialized when loading the module.
|
Chris@101
|
38 template<typename C, bool LazyInit = true, bool Phoenix = false>
|
Chris@16
|
39 class intermodule_singleton
|
Chris@16
|
40 #ifdef BOOST_INTERPROCESS_WINDOWS
|
Chris@16
|
41 : public windows_intermodule_singleton<C, LazyInit, Phoenix>
|
Chris@16
|
42 #else
|
Chris@16
|
43 : public portable_intermodule_singleton<C, LazyInit, Phoenix>
|
Chris@16
|
44 #endif
|
Chris@16
|
45 {};
|
Chris@16
|
46
|
Chris@16
|
47 } //namespace ipcdetail{
|
Chris@16
|
48 } //namespace interprocess{
|
Chris@16
|
49 } //namespace boost{
|
Chris@16
|
50
|
Chris@16
|
51 #include <boost/interprocess/detail/config_end.hpp>
|
Chris@16
|
52
|
Chris@16
|
53 #endif
|