PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/asio/is_write_buffered.hpp

http://hadesmem.googlecode.com/
C++ Header | 61 lines | 34 code | 14 blank | 13 comment | 2 complexity | 66764f9f5e1cb2d4c4d007c39e09d599 MD5 | raw file
 1//
 2// is_write_buffered.hpp
 3// ~~~~~~~~~~~~~~~~~~~~~
 4//
 5// Copyright (c) 2003-2011 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 BOOST_ASIO_IS_WRITE_BUFFERED_HPP
12#define BOOST_ASIO_IS_WRITE_BUFFERED_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/config.hpp>
19#include <boost/asio/buffered_stream_fwd.hpp>
20#include <boost/asio/buffered_write_stream_fwd.hpp>
21
22#include <boost/asio/detail/push_options.hpp>
23
24namespace boost {
25namespace asio {
26
27namespace detail {
28
29template <typename Stream>
30char is_write_buffered_helper(buffered_stream<Stream>* s);
31
32template <typename Stream>
33char is_write_buffered_helper(buffered_write_stream<Stream>* s);
34
35struct is_write_buffered_big_type { char data[10]; };
36is_write_buffered_big_type is_write_buffered_helper(...);
37
38} // namespace detail
39
40/// The is_write_buffered class is a traits class that may be used to determine
41/// whether a stream type supports buffering of written data.
42template <typename Stream>
43class is_write_buffered
44{
45public:
46#if defined(GENERATING_DOCUMENTATION)
47  /// The value member is true only if the Stream type supports buffering of
48  /// written data.
49  static const bool value;
50#else
51  BOOST_STATIC_CONSTANT(bool,
52      value = sizeof(detail::is_write_buffered_helper((Stream*)0)) == 1);
53#endif
54};
55
56} // namespace asio
57} // namespace boost
58
59#include <boost/asio/detail/pop_options.hpp>
60
61#endif // BOOST_ASIO_IS_WRITE_BUFFERED_HPP