1 #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_READY_HPP_20100618
2 #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_READY_HPP_20100618
3 
4 // Copyright 2010 Dean Michael Berris.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 
9 #include <boost/network/detail/wrapper_base.hpp>
10 
11 namespace boost {
12 namespace network {
13 namespace http {
14 
15 template <class Tag>
16 struct async_message;
17 
18 namespace impl {
19 template <class Tag>
20 struct ready_wrapper
21     : boost::network::detail::wrapper_base_const<Tag, async_message<Tag> > {
22   typedef boost::network::detail::wrapper_base_const<Tag, async_message<Tag> >
23       wrapper_base;
ready_wrapperboost::network::http::impl::ready_wrapper24   explicit ready_wrapper(async_message<Tag> const& message)
25       : wrapper_base(message) {}
operator boolboost::network::http::impl::ready_wrapper26   operator bool() {
27     return wrapper_base::_message.version_.is_ready() &&
28            wrapper_base::_message.status_.is_ready() &&
29            wrapper_base::_message.status_message_.is_ready() &&
30            wrapper_base::_message.headers_.is_ready() &&
31            wrapper_base::_message.body_.is_ready();
32   }
33 };
34 }  // namespace impl
35 
36 template <class Tag>
ready(async_message<Tag> const & message)37 inline bool ready(async_message<Tag> const& message) {
38   return impl::ready_wrapper<Tag>(message);
39 }
40 
41 }  // namespace http
42  /* http */
43 
44 } // namespace network
45  /* network */
46 
47 } // namespace boost
48  /* boost */
49 
50 #endif /* BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_READY_HPP_20100618 */
51