• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // detail/tss_ptr.hpp
3 // ~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_DETAIL_TSS_PTR_HPP
12 #define ASIO_DETAIL_TSS_PTR_HPP
13 
14 
15 #include "asio/detail/config.hpp"
16 
17 #if   defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
18 # include "asio/detail/keyword_tss_ptr.hpp"
19 #elif defined(ASIO_HAS_PTHREADS)
20 # include "asio/detail/posix_tss_ptr.hpp"
21 #else
22 # error Only Windows and POSIX are supported!
23 #endif
24 
25 #include "asio/detail/push_options.hpp"
26 
27 namespace asio {
28 namespace detail {
29 
30 template <typename T>
31 class tss_ptr
32 #if   defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
33   : public keyword_tss_ptr<T>
34 #elif defined(ASIO_HAS_PTHREADS)
35   : public posix_tss_ptr<T>
36 #endif
37 {
38 public:
operator =(T * value)39   void operator=(T* value)
40   {
41 #if   defined(ASIO_HAS_THREAD_KEYWORD_EXTENSION)
42     keyword_tss_ptr<T>::operator=(value);
43 #elif defined(ASIO_HAS_PTHREADS)
44     posix_tss_ptr<T>::operator=(value);
45 #endif
46   }
47 };
48 
49 } // namespace detail
50 } // namespace asio
51 
52 #include "asio/detail/pop_options.hpp"
53 
54 #endif // ASIO_DETAIL_TSS_PTR_HPP
55