Skip to content

Commit 1f387db

Browse files
committed
Merged deanberris:0.12-devel-deprecations-and-refactorings and fixed conflicts in message_test.cpp
2 parents a5030f6 + 7a78eae commit 1f387db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+299
-821
lines changed

boost/network/constants.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ struct constants_wide {
126126
};
127127
} // namespace impl
128128

129+
template <class Tag>
130+
struct unsupported_tag;
131+
129132
template <class Tag>
130133
struct constants
131134
: mpl::if_<

boost/network/include/message.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
//
99
// This is the modular include file for using the basic message type
1010

11-
#include <boost/network/tags.hpp>
1211
#include <boost/network/message.hpp>
12+
#include <boost/network/message/directives.hpp>
13+
#include <boost/network/message/transformers.hpp>
14+
#include <boost/network/message/wrappers.hpp>
15+
#include <boost/network/tags.hpp>
1316

1417
#endif // BOOST_NETWORK_INCLUDE_MESSAGE_HPP_

boost/network/message.hpp

+5-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1-
// Copyright Dean Michael Berris 2007.
1+
// Copyright Dean Michael Berris 2007.
2+
// Copyright Google, Inc. 2015
23
// Distributed under the Boost Software License, Version 1.0.
3-
// (See accompanying file LICENSE_1_0.txt or copy at
4-
// http://www.boost.org/LICENSE_1_0.txt)
4+
// (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
56

67
#ifndef BOOST_NETWORK_MESSAGE_HPP__
78
#define BOOST_NETWORK_MESSAGE_HPP__
89

910
#include <boost/network/detail/directive_base.hpp>
1011
#include <boost/network/detail/wrapper_base.hpp>
11-
#include <boost/network/message/directives.hpp>
12-
#include <boost/network/message/message_concept.hpp>
13-
#include <boost/network/message/modifiers/add_header.hpp>
14-
#include <boost/network/message/modifiers/body.hpp>
15-
#include <boost/network/message/modifiers/clear_headers.hpp>
16-
#include <boost/network/message/modifiers/destination.hpp>
17-
#include <boost/network/message/modifiers/remove_header.hpp>
18-
#include <boost/network/message/modifiers/source.hpp>
19-
#include <boost/network/message/transformers.hpp>
20-
#include <boost/network/message/wrappers.hpp>
21-
#include <boost/network/message_fwd.hpp>
12+
#include <boost/network/traits/headers_container.hpp>
2213
#include <boost/network/traits/string.hpp>
2314
#include <boost/utility/enable_if.hpp>
2415

@@ -125,11 +116,6 @@ inline void swap(basic_message<Tag>& left, basic_message<Tag>& right) {
125116
left.swap(right);
126117
}
127118

128-
// Commenting this out as we don't need to do this anymore.
129-
// BOOST_CONCEPT_ASSERT((Message<basic_message<boost::network::tags::default_string>
130-
// >));
131-
// BOOST_CONCEPT_ASSERT((Message<basic_message<boost::network::tags::default_wstring>
132-
// >));
133119
typedef basic_message<tags::default_string> message;
134120
typedef basic_message<tags::default_wstring> wmessage;
135121

boost/network/message/directives.hpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

2-
// Copyright Dean Michael Berris 2007.
2+
// Copyright Dean Michael Berris 2007.
3+
// Copyright Google, Inc. 2015
34
// Distributed under the Boost Software License, Version 1.0.
4-
// (See accompanying file LICENSE_1_0.txt or copy at
5-
// http://www.boost.org/LICENSE_1_0.txt)
5+
// (See accompanying file LICENSE_1_0.txt or copy at
6+
// http://www.boost.org/LICENSE_1_0.txt)
67

7-
#ifndef __NETWORK_MESSAGE_DIRECTIVES_HPP__
8-
#define __NETWORK_MESSAGE_DIRECTIVES_HPP__
8+
#ifndef BOOST_NETWORK_MESSAGE_DIRECTIVES_HPP__
9+
#define BOOST_NETWORK_MESSAGE_DIRECTIVES_HPP__
910

11+
#include <boost/network/message_fwd.hpp>
1012
#include <boost/network/message/directives/detail/string_directive.hpp>
1113
#include <boost/network/message/directives/header.hpp>
1214
#include <boost/network/message/directives/remove_header.hpp>
@@ -33,4 +35,4 @@ BOOST_NETWORK_STRING_DIRECTIVE(body, body_, message.body(body_),
3335

3436
} // namespace boost
3537

36-
#endif // __NETWORK_MESSAGE_DIRECTIVES_HPP__
38+
#endif // BOOST_NETWORK_MESSAGE_DIRECTIVES_HPP__

boost/network/message/message_concept.hpp

-66
This file was deleted.

boost/network/message/traits/body.hpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
#define BOOST_NETWORK_MESSAGE_TRAITS_BODY_HPP_20100903
44

55
// Copyright Dean Michael Berris 2010.
6+
// Copyright Google, Inc. 2015
67
// Distributed under the Boost Software License, Version 1.0.
78
// (See accompanying file LICENSE_1_0.txt or copy at
89
// http://www.boost.org/LICENSE_1_0.txt)
910

1011
#include <boost/mpl/if.hpp>
11-
#include <boost/network/traits/string.hpp>
1212
#include <boost/network/support/is_async.hpp>
1313
#include <boost/network/support/is_sync.hpp>
14+
#include <boost/network/tags.hpp>
15+
#include <boost/network/traits/string.hpp>
1416
#include <boost/thread/future.hpp>
1517
#include <boost/type_traits/is_same.hpp>
1618

1719
namespace boost {
1820
namespace network {
19-
2021
namespace traits {
2122

2223
template <class Tag>
@@ -26,11 +27,13 @@ template <class Message>
2627
struct body
2728
: mpl::if_<
2829
is_async<typename Message::tag>,
29-
boost::shared_future<typename string<typename Message::tag>::type>,
30+
shared_future<typename string<typename Message::tag>::type>,
3031
typename mpl::if_<
3132
mpl::or_<is_sync<typename Message::tag>,
32-
is_same<typename Message::tag, tags::default_string>,
33-
is_same<typename Message::tag, tags::default_wstring> >,
33+
is_same<typename Message::tag,
34+
::boost::network::tags::default_string>,
35+
is_same<typename Message::tag,
36+
::boost::network::tags::default_wstring> >,
3437
typename string<typename Message::tag>::type,
3538
unsupported_tag<typename Message::tag> >::type> {};
3639

boost/network/message/traits/destination.hpp

+11-9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <boost/mpl/if.hpp>
1111
#include <boost/network/support/is_async.hpp>
1212
#include <boost/network/support/is_sync.hpp>
13+
#include <boost/network/tags.hpp>
1314
#include <boost/network/traits/string.hpp>
1415
#include <boost/thread/future.hpp>
1516
#include <boost/type_traits/is_same.hpp>
@@ -24,15 +25,16 @@ struct unsupported_tag;
2425

2526
template <class Message>
2627
struct destination
27-
: mpl::if_<
28-
is_async<typename Message::tag>,
29-
boost::shared_future<typename string<typename Message::tag>::type>,
30-
typename mpl::if_<
31-
mpl::or_<is_sync<typename Message::tag>,
32-
is_same<typename Message::tag, tags::default_string>,
33-
is_same<typename Message::tag, tags::default_wstring> >,
34-
typename string<typename Message::tag>::type,
35-
unsupported_tag<typename Message::tag> >::type> {};
28+
: mpl::if_<is_async<typename Message::tag>,
29+
shared_future<typename string<typename Message::tag>::type>,
30+
typename mpl::if_<
31+
mpl::or_<is_sync<typename Message::tag>,
32+
is_same<typename Message::tag,
33+
::boost::network::tags::default_string>,
34+
is_same<typename Message::tag,
35+
::boost::network::tags::default_wstring> >,
36+
typename string<typename Message::tag>::type,
37+
unsupported_tag<typename Message::tag> >::type> {};
3638

3739
} // namespace traits
3840
} // namespace network

boost/network/message/traits/source.hpp

+11-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <boost/mpl/if.hpp>
1010
#include <boost/network/support/is_async.hpp>
1111
#include <boost/network/support/is_sync.hpp>
12+
#include <boost/network/tags.hpp>
1213
#include <boost/network/traits/string.hpp>
1314
#include <boost/thread/future.hpp>
1415
#include <boost/type_traits/is_same.hpp>
@@ -22,15 +23,16 @@ struct unsupported_tag;
2223

2324
template <class Message>
2425
struct source
25-
: mpl::if_<
26-
is_async<typename Message::tag>,
27-
boost::shared_future<typename string<typename Message::tag>::type>,
28-
typename mpl::if_<
29-
mpl::or_<is_sync<typename Message::tag>,
30-
is_same<typename Message::tag, tags::default_string>,
31-
is_same<typename Message::tag, tags::default_wstring> >,
32-
typename string<typename Message::tag>::type,
33-
unsupported_tag<typename Message::tag> >::type> {};
26+
: mpl::if_<is_async<typename Message::tag>,
27+
shared_future<typename string<typename Message::tag>::type>,
28+
typename mpl::if_<
29+
mpl::or_<is_sync<typename Message::tag>,
30+
is_same<typename Message::tag,
31+
::boost::network::tags::default_string>,
32+
is_same<typename Message::tag,
33+
::boost::network::tags::default_wstring> >,
34+
typename string<typename Message::tag>::type,
35+
unsupported_tag<typename Message::tag> >::type> {};
3436

3537
} // namespace traits
3638
} // namespace network

boost/network/message/transformers/to_lower.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ template <>
3232
struct to_lower_transformer<selectors::source_selector> {
3333
template <class Tag>
3434
void operator()(basic_message<Tag> &message_) const {
35-
boost::to_lower(message_.source());
35+
::boost::to_lower(message_.source());
3636
}
3737

3838
protected:
@@ -43,7 +43,7 @@ template <>
4343
struct to_lower_transformer<selectors::destination_selector> {
4444
template <class Tag>
4545
void operator()(basic_message<Tag> &message_) const {
46-
boost::to_lower(message_.destination());
46+
::boost::to_lower(message_.destination());
4747
}
4848

4949
protected:

boost/network/message/transformers/to_upper.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ template <>
3232
struct to_upper_transformer<selectors::source_selector> {
3333
template <class Tag>
3434
void operator()(basic_message<Tag> &message_) const {
35-
boost::to_upper(message_.source());
35+
::boost::to_upper(message_.source());
3636
}
3737

3838
protected:
@@ -43,7 +43,7 @@ template <>
4343
struct to_upper_transformer<selectors::destination_selector> {
4444
template <class Tag>
4545
void operator()(basic_message<Tag> &message_) const {
46-
boost::to_upper(message_.destination());
46+
::boost::to_upper(message_.destination());
4747
}
4848

4949
protected:

boost/network/protocol/http/algorithms/linearize.hpp

+16-21
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// Copyright 2010 Dean Michael Berris.
55
// Copyright 2014 Jussi Lyytinen
6+
// Copyright 2015 Google, Inc.
67
// Distributed under the Boost Software License, Version 1.0.
78
// (See accompanying file LICENSE_1_0.txt or copy at
89
// http://www.boost.org/LICENSE_1_0.txt)
@@ -11,17 +12,20 @@
1112
#include <bitset>
1213
#include <boost/algorithm/string/compare.hpp>
1314
#include <boost/concept/requires.hpp>
15+
#include <boost/lexical_cast.hpp>
1416
#include <boost/network/constants.hpp>
17+
#include <boost/network/message/wrappers/body.hpp>
1518
#include <boost/network/protocol/http/message/header/name.hpp>
1619
#include <boost/network/protocol/http/message/header/value.hpp>
17-
#include <boost/network/protocol/http/message/header_concept.hpp>
18-
#include <boost/network/protocol/http/request_concept.hpp>
19-
#include <boost/network/traits/string.hpp>
20+
#include <boost/network/protocol/http/message/wrappers/headers.hpp>
21+
#include <boost/network/protocol/http/message/wrappers/port.hpp>
22+
#include <boost/network/protocol/http/traits/connection_keepalive.hpp>
23+
#include <boost/network/traits/headers_container.hpp>
2024
#include <boost/network/traits/ostringstream.hpp>
25+
#include <boost/network/traits/string.hpp>
2126
#include <boost/optional.hpp>
2227
#include <boost/range/algorithm/copy.hpp>
2328
#include <boost/version.hpp>
24-
#include <boost/lexical_cast.hpp>
2529

2630
namespace boost {
2731
namespace network {
@@ -40,9 +44,7 @@ struct linearize_header {
4044
};
4145

4246
template <class ValueType>
43-
BOOST_CONCEPT_REQUIRES(((Header<typename boost::remove_cv<ValueType>::type>)),
44-
(string_type))
45-
operator()(ValueType& header) {
47+
string_type operator()(ValueType& header) {
4648
typedef typename ostringstream<Tag>::type output_stream;
4749
typedef constants<Tag> consts;
4850
output_stream header_line;
@@ -53,11 +55,10 @@ struct linearize_header {
5355
};
5456

5557
template <class Request, class OutputIterator>
56-
BOOST_CONCEPT_REQUIRES(((ClientRequest<Request>)), (OutputIterator))
57-
linearize(Request const& request,
58-
typename Request::string_type const& method,
59-
unsigned version_major, unsigned version_minor,
60-
OutputIterator oi) {
58+
OutputIterator linearize(Request const& request,
59+
typename Request::string_type const& method,
60+
unsigned version_major, unsigned version_minor,
61+
OutputIterator oi) {
6162
typedef typename Request::tag Tag;
6263
typedef constants<Tag> consts;
6364
typedef typename string<Tag>::type string_type;
@@ -97,13 +98,7 @@ BOOST_CONCEPT_REQUIRES(((ClientRequest<Request>)), (OutputIterator))
9798
// We need to determine whether we've seen any of the following headers
9899
// before setting the defaults. We use a bitset to keep track of the
99100
// defaulted headers.
100-
enum {
101-
ACCEPT,
102-
ACCEPT_ENCODING,
103-
HOST,
104-
CONNECTION,
105-
MAX
106-
};
101+
enum { ACCEPT, ACCEPT_ENCODING, HOST, CONNECTION, MAX };
107102
std::bitset<MAX> found_headers;
108103
static char const* defaulted_headers[][2] = {
109104
{consts::accept(), consts::accept() + std::strlen(consts::accept())},
@@ -182,12 +177,12 @@ BOOST_CONCEPT_REQUIRES(((ClientRequest<Request>)), (OutputIterator))
182177
}
183178

184179
boost::copy(crlf, oi);
185-
typename body_range<Request>::type body_data = body(request).range();
180+
auto body_data = body(request).range();
186181
return boost::copy(body_data, oi);
187182
}
188183

189184
} // namespace http
190185
} // namespace network
191186
} // namespace boost
192187

193-
#endif /* BOOST_NETWORK_PROTOCOL_HTTP_ALGORITHMS_LINEARIZE_HPP_20101028 */
188+
#endif // BOOST_NETWORK_PROTOCOL_HTTP_ALGORITHMS_LINEARIZE_HPP_20101028

0 commit comments

Comments
 (0)