Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:45

0001 //
0002 // detail/tss_ptr.hpp
0003 // ~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_DETAIL_TSS_PTR_HPP
0012 #define BOOST_ASIO_DETAIL_TSS_PTR_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 
0020 #if !defined(BOOST_ASIO_HAS_THREADS)
0021 # include <boost/asio/detail/null_tss_ptr.hpp>
0022 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
0023 # include <boost/asio/detail/keyword_tss_ptr.hpp>
0024 #elif defined(BOOST_ASIO_WINDOWS)
0025 # include <boost/asio/detail/win_tss_ptr.hpp>
0026 #elif defined(BOOST_ASIO_HAS_PTHREADS)
0027 # include <boost/asio/detail/posix_tss_ptr.hpp>
0028 #else
0029 # error Only Windows and POSIX are supported!
0030 #endif
0031 
0032 #include <boost/asio/detail/push_options.hpp>
0033 
0034 namespace boost {
0035 namespace asio {
0036 namespace detail {
0037 
0038 template <typename T>
0039 class tss_ptr
0040 #if !defined(BOOST_ASIO_HAS_THREADS)
0041   : public null_tss_ptr<T>
0042 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
0043   : public keyword_tss_ptr<T>
0044 #elif defined(BOOST_ASIO_WINDOWS)
0045   : public win_tss_ptr<T>
0046 #elif defined(BOOST_ASIO_HAS_PTHREADS)
0047   : public posix_tss_ptr<T>
0048 #endif
0049 {
0050 public:
0051   void operator=(T* value)
0052   {
0053 #if !defined(BOOST_ASIO_HAS_THREADS)
0054     null_tss_ptr<T>::operator=(value);
0055 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
0056     keyword_tss_ptr<T>::operator=(value);
0057 #elif defined(BOOST_ASIO_WINDOWS)
0058     win_tss_ptr<T>::operator=(value);
0059 #elif defined(BOOST_ASIO_HAS_PTHREADS)
0060     posix_tss_ptr<T>::operator=(value);
0061 #endif
0062   }
0063 };
0064 
0065 } // namespace detail
0066 } // namespace asio
0067 } // namespace boost
0068 
0069 #include <boost/asio/detail/pop_options.hpp>
0070 
0071 #endif // BOOST_ASIO_DETAIL_TSS_PTR_HPP