diff options
author | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
commit | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch) | |
tree | 7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/asio/detail/buffer_sequence_adapter.hpp | |
parent | bb4dd8289b351fae6b55e303f189127a394a1edd (diff) | |
download | boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2 boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip |
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/asio/detail/buffer_sequence_adapter.hpp')
-rw-r--r-- | boost/asio/detail/buffer_sequence_adapter.hpp | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/boost/asio/detail/buffer_sequence_adapter.hpp b/boost/asio/detail/buffer_sequence_adapter.hpp index 562aa55a41..da81cbee7b 100644 --- a/boost/asio/detail/buffer_sequence_adapter.hpp +++ b/boost/asio/detail/buffer_sequence_adapter.hpp @@ -2,7 +2,7 @@ // detail/buffer_sequence_adapter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -29,7 +29,23 @@ namespace detail { class buffer_sequence_adapter_base { protected: -#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#if defined(BOOST_ASIO_WINDOWS_RUNTIME) + // The maximum number of buffers to support in a single operation. + enum { max_buffers = 1 }; + + typedef Windows::Storage::Streams::IBuffer^ native_buffer_type; + + BOOST_ASIO_DECL static void init_native_buffer( + native_buffer_type& buf, + const boost::asio::mutable_buffer& buffer); + + BOOST_ASIO_DECL static void init_native_buffer( + native_buffer_type& buf, + const boost::asio::const_buffer& buffer); +#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) + // The maximum number of buffers to support in a single operation. + enum { max_buffers = 64 < max_iov_len ? 64 : max_iov_len }; + typedef WSABUF native_buffer_type; static void init_native_buffer(WSABUF& buf, @@ -45,7 +61,10 @@ protected: buf.buf = const_cast<char*>(boost::asio::buffer_cast<const char*>(buffer)); buf.len = static_cast<ULONG>(boost::asio::buffer_size(buffer)); } -#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) + // The maximum number of buffers to support in a single operation. + enum { max_buffers = 64 < max_iov_len ? 64 : max_iov_len }; + typedef iovec native_buffer_type; static void init_iov_base(void*& base, void* addr) @@ -73,7 +92,7 @@ protected: boost::asio::buffer_cast<const void*>(buffer))); iov.iov_len = boost::asio::buffer_size(buffer); } -#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) }; // Helper class to translate buffers into the native buffer representation. @@ -146,9 +165,6 @@ public: } private: - // The maximum number of buffers to support in a single operation. - enum { max_buffers = 64 < max_iov_len ? 64 : max_iov_len }; - native_buffer_type buffers_[max_buffers]; std::size_t count_; std::size_t total_buffer_size_; @@ -362,4 +378,8 @@ private: #include <boost/asio/detail/pop_options.hpp> +#if defined(BOOST_ASIO_HEADER_ONLY) +# include <boost/asio/detail/impl/buffer_sequence_adapter.ipp> +#endif // defined(BOOST_ASIO_HEADER_ONLY) + #endif // BOOST_ASIO_DETAIL_BUFFER_SEQUENCE_ADAPTER_HPP |