00001 // 00002 // is_read_buffered.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_IS_READ_BUFFERED_HPP 00012 #define ASIO_IS_READ_BUFFERED_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 #include "asio/buffered_read_stream_fwd.hpp" 00025 #include "asio/buffered_stream_fwd.hpp" 00026 00027 namespace asio { 00028 00029 namespace detail { 00030 00031 template <typename Stream> 00032 char is_read_buffered_helper(buffered_stream<Stream>* s); 00033 00034 template <typename Stream> 00035 char is_read_buffered_helper(buffered_read_stream<Stream>* s); 00036 00037 struct is_read_buffered_big_type { char data[10]; }; 00038 is_read_buffered_big_type is_read_buffered_helper(...); 00039 00040 } // namespace detail 00041 00044 template <typename Stream> 00045 class is_read_buffered 00046 { 00047 public: 00048 #if defined(GENERATING_DOCUMENTATION) 00049 00050 00051 static const bool value; 00052 #else 00053 BOOST_STATIC_CONSTANT(bool, 00054 value = sizeof(detail::is_read_buffered_helper((Stream*)0)) == 1); 00055 #endif 00056 }; 00057 00058 } // namespace asio 00059 00060 #include "asio/detail/pop_options.hpp" 00061 00062 #endif // ASIO_IS_READ_BUFFERED_HPP