|
| 1 | +#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_STATUS_MESSAGE_HPP_20100608 |
| 2 | +#define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_STATUS_MESSAGE_HPP_20100608 |
| 3 | + |
| 4 | +// Copyright 2010 (c) Dean Michael Berris |
| 5 | +// Copyright 2010 (c) Sinefunc, Inc. |
| 6 | +// Distributed under the Boost Software License, Version 1.0. |
| 7 | +// (See accompanying file LICENSE_1_0.txt or copy at |
| 8 | +// http://www.boost.org/LICENSE_1_0.txt) |
| 9 | + |
| 10 | +#include <boost/network/support/is_async.hpp> |
| 11 | +#include <boost/thread/future.hpp> |
| 12 | + |
| 13 | +namespace boost { namespace network { namespace http { |
| 14 | + |
| 15 | + template <class Tag> |
| 16 | + struct basic_response; |
| 17 | + |
| 18 | + namespace impl { |
| 19 | + |
| 20 | + template <class Tag, class T> |
| 21 | + void status_message(basic_response<Tag> & response, T const & value, mpl::false_ const &) { |
| 22 | + response << boost::network::http::status_message(value); |
| 23 | + } |
| 24 | + |
| 25 | + template <class Tag, class T> |
| 26 | + void status_message(basic_response<Tag> & response, boost::shared_future<T> future, mpl::true_ const &) { |
| 27 | + response.status_message() = future; |
| 28 | + } |
| 29 | + |
| 30 | + } // namespace impl |
| 31 | + |
| 32 | + template <class Tag, class T> |
| 33 | + void status_message(basic_response<Tag> & response, T const & value) { |
| 34 | + impl::status_message(response, value, is_async<Tag>()); |
| 35 | + } |
| 36 | + |
| 37 | +} // namespace http |
| 38 | + |
| 39 | +} // namespace network |
| 40 | + |
| 41 | +} // namespace boost |
| 42 | + |
| 43 | +#endif // BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_STATUS_MESSAGE_HPP_20100608 |
0 commit comments