19 #ifndef INCLUDE_RCF_CURRENTSESSION_HPP
20 #define INCLUDE_RCF_CURRENTSESSION_HPP
22 #include <boost/shared_ptr.hpp>
24 #include <RCF/RcfSession.hpp>
25 #include <RCF/ThreadLibrary.hpp>
26 #include <RCF/ThreadLocalData.hpp>
32 class CurrentRcfSessionSentry
35 CurrentRcfSessionSentry(RcfSession & session)
37 RcfSession * pPrev = getTlsRcfSessionPtr();
38 getRcfSessionSentryStack().push_back(pPrev);
40 setTlsRcfSessionPtr(& session);
43 CurrentRcfSessionSentry(RcfSessionPtr sessionPtr)
45 RcfSession * pPrev = getTlsRcfSessionPtr();
46 getRcfSessionSentryStack().push_back(pPrev);
48 RcfSession * pSession = sessionPtr.get();
49 setTlsRcfSessionPtr(pSession);
52 ~CurrentRcfSessionSentry()
54 RcfSession * pPrev = getRcfSessionSentryStack().back();
55 getRcfSessionSentryStack().pop_back();
56 setTlsRcfSessionPtr(pPrev);
64 #endif // ! INCLUDE_RCF_CURRENTSESSION_HPP