Skip to content

Commit e31a643

Browse files
author
Dean Michael Berris
committed
Changes to make clang happy enough to build the hello world server test.
1 parent e032932 commit e31a643

33 files changed

+494
-379
lines changed

boost/network/message/directives/body.hpp

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,6 @@
1919

2020
namespace boost { namespace network {
2121

22-
namespace traits {
23-
template <class Tag>
24-
struct unsupported_tag;
25-
26-
template <class Message>
27-
struct body :
28-
mpl::if_<
29-
is_async<typename Message::tag>,
30-
boost::shared_future<typename string<typename Message::tag>::type>,
31-
typename mpl::if_<
32-
mpl::or_<
33-
is_sync<typename Message::tag>,
34-
is_same<typename Message::tag, tags::default_string>,
35-
is_same<typename Message::tag, tags::default_wstring>
36-
>,
37-
typename string<typename Message::tag>::type,
38-
unsupported_tag<typename Message::tag>
39-
>::type
40-
>
41-
{};
42-
} // namespace traits
43-
4422
namespace impl {
4523

4624
struct body_directive {
@@ -103,8 +81,16 @@ namespace boost { namespace network {
10381
} // namespace impl
10482

10583

106-
template <class Input>
107-
inline impl::body_directive const body(Input const & input) {
84+
inline impl::body_directive const body(string<tags::default_string>::type const & input) {
85+
return impl::body_directive(input);
86+
}
87+
88+
inline impl::body_directive const body(string<tags::default_wstring>::type const & input) {
89+
return impl::body_directive(input);
90+
}
91+
92+
template <class InputType>
93+
inline impl::body_directive const body(boost::shared_future<InputType> const & input) {
10894
return impl::body_directive(input);
10995
}
11096

boost/network/message/directives/destination.hpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,6 @@
1919

2020
namespace boost { namespace network {
2121

22-
namespace traits {
23-
24-
template <class Tag>
25-
struct unsupported_tag;
26-
27-
template <class Message>
28-
struct destination
29-
: mpl::if_<
30-
is_async<typename Message::tag>,
31-
boost::shared_future<typename string<typename Message::tag>::type>,
32-
typename mpl::if_<
33-
mpl::or_<
34-
is_sync<typename Message::tag>,
35-
is_same<typename Message::tag, tags::default_string>,
36-
is_same<typename Message::tag, tags::default_wstring>
37-
>,
38-
typename string<typename Message::tag>::type,
39-
unsupported_tag<typename Message::tag>
40-
>::type
41-
>
42-
{};
43-
44-
} // namespace traits
45-
4622
namespace impl {
4723

4824
struct destination_directive {

boost/network/message/directives/header.hpp

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,6 @@
1919

2020
namespace boost { namespace network {
2121

22-
namespace traits {
23-
24-
template <class Tag>
25-
struct unsupported_tag;
26-
27-
template <class Message>
28-
struct header_key :
29-
mpl::if_<
30-
is_async<typename Message::tag>,
31-
boost::shared_future<typename string<typename Message::tag>::type>,
32-
typename mpl::if_<
33-
mpl::or_<
34-
is_sync<typename Message::tag>,
35-
is_same<typename Message::tag, tags::default_string>,
36-
is_same<typename Message::tag, tags::default_wstring>
37-
>,
38-
typename string<typename Message::tag>::type,
39-
unsupported_tag<typename Message::tag>
40-
>::type
41-
>
42-
{};
43-
44-
template <class Message>
45-
struct header_value :
46-
mpl::if_<
47-
is_async<typename Message::tag>,
48-
boost::shared_future<typename string<typename Message::tag>::type>,
49-
typename mpl::if_<
50-
mpl::or_<
51-
is_sync<typename Message::tag>,
52-
is_same<typename Message::tag, tags::default_string>,
53-
is_same<typename Message::tag, tags::default_wstring>
54-
>,
55-
typename string<typename Message::tag>::type,
56-
unsupported_tag<typename Message::tag>
57-
>::type
58-
>
59-
{};
60-
61-
} // namespace traits
62-
6322
namespace impl {
6423

6524
template <class KeyType, class ValueType>
@@ -71,7 +30,7 @@ struct header_directive {
7130
_header_value(header_value)
7231
{ };
7332

74-
template <template <class> class Message>
33+
template <class Message>
7534
void operator() (Message const & msg) const {
7635
typedef typename Message::headers_container_type::value_type value_type;
7736
msg.add_header(value_type(_header_name, _header_value));

boost/network/message/directives/source.hpp

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,15 @@
1818
#include <boost/mpl/if.hpp>
1919
#include <boost/mpl/or.hpp>
2020

21-
/** source.hpp
22-
*
23-
* Defines the types involved and the semantics of adding
24-
* source information into message objects.
25-
*
26-
* WARNING: DO NOT INCLUDE THIS HEADER DIRECTLY. THIS REQUIRES
27-
* TYPES TO BE DEFINED FROM EARLIER FILES THAT INCLUDE THIS
28-
* HEADER.
29-
*/
3021
namespace boost { namespace network {
3122

32-
namespace traits {
33-
34-
template <class Tag>
35-
struct unsupported_tag;
36-
37-
template <class Message>
38-
struct source :
39-
mpl::if_<
40-
is_async<typename Message::tag>,
41-
boost::shared_future<typename string<typename Message::tag>::type>,
42-
typename mpl::if_<
43-
mpl::or_<
44-
is_same<typename Message::tag, tags::default_string>,
45-
is_same<typename Message::tag, tags::default_wstring>,
46-
is_sync<typename Message::tag>
47-
>,
48-
typename string<typename Message::tag>::type,
49-
unsupported_tag<typename Message::tag>
50-
>::type
51-
>
52-
{};
53-
54-
} // namespace traits
55-
5623
namespace impl {
5724

5825
struct source_directive {
5926

6027
boost::variant<
61-
typename string<tags::default_string>::type,
62-
typename string<tags::default_wstring>::type,
28+
string<tags::default_string>::type,
29+
string<tags::default_wstring>::type,
6330
boost::shared_future<string<tags::default_string>::type>,
6431
boost::shared_future<string<tags::default_wstring>::type>
6532
> source_;
@@ -70,10 +37,10 @@ namespace boost { namespace network {
7037
explicit source_directive (string<tags::default_wstring>::type const & source)
7138
: source_(source)
7239
{ };
73-
explicit source_directive (boost::shared_future<typename string<tags::default_string>::type> const & source)
40+
explicit source_directive (boost::shared_future<string<tags::default_string>::type> const & source)
7441
: source_(source)
7542
{ };
76-
explicit source_directive (boost::shared_future<typename string<tags::default_wstring>::type> const & source)
43+
explicit source_directive (boost::shared_future<string<tags::default_wstring>::type> const & source)
7744
: source_(source)
7845
{ };
7946

boost/network/message/message_concept.hpp

Lines changed: 66 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,73 @@
1-
// Copyright (c) Glyn Matthews 2010.
2-
// Copyright 2010 (c) Dean Michael Berris.
3-
// Copyright 2010 (c) Sinefunc, Inc.
4-
// Distributed under the Boost Software License, Version 1.0.
5-
// (See accompanying file LICENSE_1_0.txt or copy at
6-
// http://www.boost.org/LICENSE_1_0.txt)
7-
8-
9-
#ifndef __BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_INC__
10-
# define __BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_INC__
11-
12-
13-
# include <boost/concept_check.hpp>
14-
15-
16-
namespace boost {
17-
namespace network {
18-
template <
19-
class M
20-
>
21-
struct Message
22-
: DefaultConstructible<M>,
23-
CopyConstructible<M>,
24-
Assignable<M> {
25-
typedef typename M::string_type string_type;
26-
typedef typename M::headers_container_type headers_container_type;
27-
28-
BOOST_CONCEPT_USAGE(Message) {
29-
M message_;
30-
swap(message, message_);
311

32-
typedef typename traits::body<M>::type body_type;
33-
typedef typename traits::source<M>::type source_type;
34-
typedef typename traits::destination<M>::type destination_type;
2+
#ifndef BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_HPP_20100903
3+
#define BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_HPP_20100903
354

36-
typedef typename traits::header_key<M>::type header_key_type;
37-
typedef typename traits::header_value<M>::type header_value_type;
38-
39-
headers_container_type headers_ = headers(message);
40-
string_type body_ = body(message);
41-
string_type source_ = source(message);
42-
string_type destination_ = destination(message);
43-
44-
message << source(source_type())
45-
<< destination(destination_type())
46-
<< header(string_type(), string_type())
47-
<< body(body_type());
48-
49-
add_header(message, string_type(), string_type());
50-
remove_header(message, string_type());
51-
clear_headers(message);
52-
source(message, source_type());
53-
destination(message, destination_type());
54-
body(message, body_type());
55-
56-
(void)headers_;
57-
(void)body_;
58-
(void)source_;
59-
(void)destination_;
60-
}
61-
62-
private:
5+
// Copyright (c) Glyn Matthews 2010.
6+
// Copyright 2010 (c) Dean Michael Berris.
7+
// Copyright 2010 (c) Sinefunc, Inc.
8+
// Distributed under the Boost Software License, Version 1.0.
9+
// (See accompanying file LICENSE_1_0.txt or copy at
10+
// http://www.boost.org/LICENSE_1_0.txt)
11+
12+
#include <boost/concept_check.hpp>
13+
#include <boost/network/message/traits/body.hpp>
14+
#include <boost/network/message/traits/source.hpp>
15+
#include <boost/network/message/traits/destination.hpp>
16+
#include <boost/network/message/traits/headers.hpp>
17+
#include <boost/network/message/wrappers.hpp>
18+
#include <boost/network/message/transformers.hpp>
19+
#include <boost/network/message/directives.hpp>
20+
21+
namespace boost { namespace network {
22+
23+
template <class M>
24+
struct Message
25+
: DefaultConstructible<M>, CopyConstructible<M>, Assignable<M> {
26+
typedef typename M::string_type string_type;
27+
typedef typename M::headers_container_type headers_container_type;
28+
29+
BOOST_CONCEPT_USAGE(Message) {
30+
M message_;
31+
swap(message, message_);
32+
33+
typedef typename traits::body<M>::type body_type;
34+
typedef typename traits::source<M>::type source_type;
35+
typedef typename traits::destination<M>::type destination_type;
36+
37+
typedef typename traits::header_key<M>::type header_key_type;
38+
typedef typename traits::header_value<M>::type header_value_type;
39+
40+
headers_container_type headers_ = headers(message);
41+
string_type body_ = body(message);
42+
string_type source_ = source(message);
43+
string_type destination_ = destination(message);
44+
45+
message << source(source_type())
46+
<< destination(destination_type())
47+
<< header(string_type(), string_type())
48+
<< body(body_type());
49+
50+
add_header(message, string_type(), string_type());
51+
remove_header(message, string_type());
52+
clear_headers(message);
53+
source(message, source_type());
54+
destination(message, destination_type());
55+
body(message, body_type());
56+
57+
(void)headers_;
58+
(void)body_;
59+
(void)source_;
60+
(void)destination_;
61+
}
62+
63+
private:
64+
65+
M message;
66+
};
6367

64-
M message;
65-
};
6668
} // namespace network
69+
6770
} // namespace boost
6871

72+
#endif // BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_HPP_20100903
6973

70-
#endif // __BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_INC__

boost/network/message/traits/body.hpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
#ifndef BOOST_NETWORK_MESSAGE_TRAITS_BODY_HPP_20100903
3+
#define BOOST_NETWORK_MESSAGE_TRAITS_BODY_HPP_20100903
4+
5+
// Copyright Dean Michael Berris 2010.
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/network/support/is_sync.hpp>
12+
#include <boost/type_traits/is_same.hpp>
13+
#include <boost/thread/future.hpp>
14+
#include <boost/mpl/if.hpp>
15+
16+
namespace boost { namespace network {
17+
18+
namespace traits {
19+
20+
template <class Tag>
21+
struct unsupported_tag;
22+
23+
template <class Message>
24+
struct body :
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_<
30+
is_sync<typename Message::tag>,
31+
is_same<typename Message::tag, tags::default_string>,
32+
is_same<typename Message::tag, tags::default_wstring>
33+
>,
34+
typename string<typename Message::tag>::type,
35+
unsupported_tag<typename Message::tag>
36+
>::type
37+
>
38+
{};
39+
40+
} // namespace traits
41+
42+
} /* network */
43+
44+
} /* boost */
45+
46+
#endif // BOOST_NETWORK_MESSAGE_TRAITS_BODY_HPP_20100903
47+

0 commit comments

Comments
 (0)