$search
00001 // 00002 // tss_ptr.hpp 00003 // ~~~~~~~~~~~ 00004 // 00005 // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) 00006 // 00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00009 // 00010 00011 #ifndef ASIO_DETAIL_TSS_PTR_HPP 00012 #define ASIO_DETAIL_TSS_PTR_HPP 00013 00014 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 00015 # pragma once 00016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 00017 00018 #include "asio/detail/push_options.hpp" 00019 00020 #include "asio/detail/push_options.hpp" 00021 #include <boost/config.hpp> 00022 #include "asio/detail/pop_options.hpp" 00023 00024 #if !defined(BOOST_HAS_THREADS) 00025 # include "asio/detail/null_tss_ptr.hpp" 00026 #elif defined(BOOST_WINDOWS) 00027 # include "asio/detail/win_tss_ptr.hpp" 00028 #elif defined(BOOST_HAS_PTHREADS) 00029 # include "asio/detail/posix_tss_ptr.hpp" 00030 #else 00031 # error Only Windows and POSIX are supported! 00032 #endif 00033 00034 namespace asio { 00035 namespace detail { 00036 00037 template <typename T> 00038 class tss_ptr 00039 #if !defined(BOOST_HAS_THREADS) 00040 : public null_tss_ptr<T> 00041 #elif defined(BOOST_WINDOWS) 00042 : public win_tss_ptr<T> 00043 #elif defined(BOOST_HAS_PTHREADS) 00044 : public posix_tss_ptr<T> 00045 #endif 00046 { 00047 public: 00048 void operator=(T* value) 00049 { 00050 #if !defined(BOOST_HAS_THREADS) 00051 null_tss_ptr<T>::operator=(value); 00052 #elif defined(BOOST_WINDOWS) 00053 win_tss_ptr<T>::operator=(value); 00054 #elif defined(BOOST_HAS_PTHREADS) 00055 posix_tss_ptr<T>::operator=(value); 00056 #endif 00057 } 00058 }; 00059 00060 } // namespace detail 00061 } // namespace asio 00062 00063 #include "asio/detail/pop_options.hpp" 00064 00065 #endif // ASIO_DETAIL_TSS_PTR_HPP