RCFProto
 All Classes Functions Typedefs
CurrentSession.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_CURRENTSESSION_HPP
20 #define INCLUDE_RCF_CURRENTSESSION_HPP
21 
22 #include <boost/shared_ptr.hpp>
23 
24 #include <RCF/RcfSession.hpp>
25 #include <RCF/ThreadLibrary.hpp>
26 #include <RCF/ThreadLocalData.hpp>
27 
28 namespace RCF {
29 
30  class CurrentRcfSessionSentry
31  {
32  public:
33  CurrentRcfSessionSentry(RcfSession & session)
34  {
35  setTlsRcfSessionPtr(& session);
36  }
37 
38  ~CurrentRcfSessionSentry()
39  {
40  setTlsRcfSessionPtr();
41  }
42  };
43 
44 } // namespace RCF
45 
46 #endif // ! INCLUDE_RCF_CURRENTSESSION_HPP