RCFProto
 All Classes Functions Typedefs
tss_ptr.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 //
20 // detail/tss_ptr.hpp
21 // ~~~~~~~~~~~~~~~~~~
22 //
23 // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
24 //
25 // Distributed under the Boost Software License, Version 1.0. (See accompanying
26 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
27 //
28 
29 #ifndef RCF_DETAIL_TSS_PTR_HPP
30 #define RCF_DETAIL_TSS_PTR_HPP
31 
32 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
33 # pragma once
34 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
35 
36 #if 0
37 # include "null_tss_ptr.hpp"
38 #elif defined(BOOST_WINDOWS)
39 # include <RCF/thread/win_tss_ptr.hpp>
40 #elif defined(BOOST_HAS_PTHREADS)
41 # include <RCF/thread/posix_tss_ptr.hpp>
42 #else
43 # error Only Windows and POSIX are supported!
44 #endif
45 
46 #include <RCF/thread/push_options.hpp>
47 
48 namespace RCF {
49 namespace detail {
50 
51 template <typename T>
52 class tss_ptr
53 #if 0
54  : public null_tss_ptr<T>
55 #elif defined(BOOST_WINDOWS)
56  : public win_tss_ptr<T>
57 #elif defined(BOOST_HAS_PTHREADS)
58  : public posix_tss_ptr<T>
59 #endif
60 {
61 public:
62  void operator=(T* value)
63  {
64 #if 0
65  null_tss_ptr<T>::operator=(value);
66 #elif defined(BOOST_WINDOWS)
67  win_tss_ptr<T>::operator=(value);
68 #elif defined(BOOST_HAS_PTHREADS)
69  posix_tss_ptr<T>::operator=(value);
70 #endif
71  }
72 };
73 
74 } // namespace detail
75 } // namespace RCF
76 
77 #include <RCF/thread/pop_options.hpp>
78 
79 #endif // RCF_DETAIL_TSS_PTR_HPP