RCFProto
 All Classes Functions Typedefs
InitDeinit.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18 
19 #ifndef INCLUDE_RCF_INITDEINIT_HPP
20 #define INCLUDE_RCF_INITDEINIT_HPP
21 
22 #include <RCF/Export.hpp>
23 
24 #include <RCF/Config.hpp>
25 
26 #include <boost/mpl/int.hpp>
27 #include <boost/mpl/list.hpp>
28 
29 namespace RCF {
30 
31  // For debug use.
32  RCF_EXPORT std::size_t getInitRefCount();
33 
36  RCF_EXPORT bool init(RcfConfigT * = NULL);
37 
41  RCF_EXPORT bool deinit();
42 
43  // Initialization sentry. Ctor calls RCF::init(), dtor calls RCF::deinit().
44  class RCF_EXPORT RcfInitDeinit
45  {
46  public:
47  RcfInitDeinit(RcfConfigT * = NULL);
48  ~RcfInitDeinit();
49 
50  // Returns true if this instance initialized RCF.
51  bool isRootInstance();
52 
53  private:
54  bool mIsRootInstance;
55  };
56 
57 } // namespace RCF
58 
59 #endif // ! INCLUDE_RCF_INITDEINIT_HPP