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@16
|
14 #if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
Chris@16
|
15 #pragma once
|
Chris@16
|
16 #endif
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/interprocess/detail/config_begin.hpp>
|
Chris@16
|
19 #include <boost/interprocess/detail/workaround.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #ifdef BOOST_INTERPROCESS_WINDOWS
|
Chris@16
|
22 #include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
|
Chris@16
|
23 #endif
|
Chris@16
|
24 #include <boost/interprocess/detail/portable_intermodule_singleton.hpp>
|
Chris@16
|
25
|
Chris@16
|
26 namespace boost{
|
Chris@16
|
27 namespace interprocess{
|
Chris@16
|
28 namespace ipcdetail{
|
Chris@16
|
29
|
Chris@16
|
30 //Now this class is a singleton, initializing the singleton in
|
Chris@16
|
31 //the first get() function call if LazyInit is false. If true
|
Chris@16
|
32 //then the singleton will be initialized when loading the module.
|
Chris@16
|
33 template<typename C, bool LazyInit = true, bool Phoenix = true>
|
Chris@16
|
34 class intermodule_singleton
|
Chris@16
|
35 #ifdef BOOST_INTERPROCESS_WINDOWS
|
Chris@16
|
36 : public windows_intermodule_singleton<C, LazyInit, Phoenix>
|
Chris@16
|
37 #else
|
Chris@16
|
38 : public portable_intermodule_singleton<C, LazyInit, Phoenix>
|
Chris@16
|
39 #endif
|
Chris@16
|
40 {};
|
Chris@16
|
41
|
Chris@16
|
42 } //namespace ipcdetail{
|
Chris@16
|
43 } //namespace interprocess{
|
Chris@16
|
44 } //namespace boost{
|
Chris@16
|
45
|
Chris@16
|
46 #include <boost/interprocess/detail/config_end.hpp>
|
Chris@16
|
47
|
Chris@16
|
48 #endif
|