Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit603c71a

Browse files
author
mikhail_beris
committed
Merging from http_integration r1-r71 .
1 parentf0fcc16 commit603c71a

File tree

73 files changed

+3939
-247
lines changed

Some content is hidden

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

73 files changed

+3939
-247
lines changed

‎Jamroot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# (See accompanying file LICENSE_1_0.txt or copy at
55
# http://www.boost.org/LICENSE_1_0.txt)
66

7-
importmodules ;
7+
importos ;
88

9-
local BOOST_ROOT = [modules.peek : BOOST_ROOT ] ;
9+
local BOOST_ROOT = [os.environ BOOST_ROOT ] ;
1010

1111
use-project /boost : $(BOOST_ROOT) ;
1212

‎boost/network/detail/directive_base.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ namespace boost { namespace network { namespace detail {
2424
// mutable basic_message<tag> & _message;
2525
};
2626

27-
};// namespace detail
27+
}// namespace detail
2828

29-
};// namespace network
29+
}// namespace network
3030

31-
};// namespace boost
31+
}// namespace boost
3232

3333
#endif// __NETWORK_DETAIL_DIRECTIVE_BASE_HPP__
3434

‎boost/network/detail/wrapper_base.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ namespace boost { namespace network { namespace detail {
2323
mutable basic_message<tag> & _message;
2424
};
2525

26-
};// namespace detail
26+
}// namespace detail
2727

28-
};// namespace network
28+
}// namespace network
2929

30-
};// namespace boost
30+
}// namespace boost
3131

3232
#endif// __NETWORK_DETAIL_WRAPPER_BASE_HPP__
3333

‎boost/network/message.hpp

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@
1010
#include<map>
1111
#include<string>
1212

13-
// forward declarations
14-
namespaceboost {namespacenetwork {
15-
template<classtag>
16-
classbasic_message;
17-
};// namespace network
1813

19-
};// namespace boost
14+
// include message declaration
15+
#include"boost/network/message_fwd.hpp"
16+
17+
// include traits implementation
18+
#include<boost/network/message/traits.hpp>
2019

20+
// include directives base
2121
#include<boost/network/detail/directive_base.hpp>
22+
23+
// include wrappers base
2224
#include<boost/network/detail/wrapper_base.hpp>
2325

2426
/** message.hpp
@@ -31,33 +33,50 @@ namespace boost { namespace network {
3133
*/
3234
namespaceboost {namespacenetwork {
3335

34-
structtags {
35-
structdefault_ {
36-
typedef std::string str_type;
37-
typedef std::ostringstream ostringstream_type;
38-
};
39-
};
40-
4136
/** The common message type.
4237
*/
43-
template<classtag=tags::default_>
38+
template<classTag>
4439
classbasic_message {
4540
public:
46-
typedef std::multimap<std::string, std::string> headers_container_type;
4741

48-
headers_container_type &headers()const {
42+
typedef Tag tag;
43+
44+
typedeftypename headers_container<tag>::type headers_container_type;
45+
typedeftypename string<tag>::type string_type;
46+
47+
basic_message()
48+
: _headers(), _body(), _source(), _destination()
49+
{ };
50+
51+
basic_message(const basic_message & other)
52+
: _headers(other._headers), _body(other._body), _source(other._source), _destination(other._destination)
53+
{ };
54+
55+
basic_message &operator=(basic_message<tag> rhs) {
56+
rhs.swap(*this);
57+
return *this;
58+
};
59+
60+
voidswap(basic_message<tag> & other) {
61+
other._headers.swap(_headers);
62+
other._body.swap(_body);
63+
other._source.swap(_source);
64+
other._destination.swap(_destination);
65+
};
66+
67+
headers_container_type &headers() {
4968
return _headers;
5069
};
5170

52-
std::string &body()const {
71+
string_type &body() {
5372
return _body;
5473
};
5574

56-
std::string &source()const {
75+
string_type &source() {
5776
return _source;
5877
};
5978

60-
std::string &destination()const {
79+
string_type &destination() {
6180
return _destination;
6281
};
6382

@@ -66,16 +85,21 @@ namespace boost { namespace network {
6685
friendstructdetail::directive_base<tag> ;
6786
friendstructdetail::wrapper_base<tag> ;
6887

69-
mutable headers_container_type _headers;
70-
mutable std::string _body;
71-
mutable std::string _source;
72-
mutable std::string _destination;
88+
headers_container_type _headers;
89+
string_type _body;
90+
string_type _source;
91+
string_type _destination;
92+
};
93+
94+
template<classTag>
95+
voidswap(basic_message<Tag> & left, basic_message<Tag> & right) {
96+
// swap for ADL
97+
left.swap(right);
7398
};
7499

75-
typedef basic_message<> message;//default message type
100+
}//namespace network
76101

77-
};// namespace network
78-
};// namespace boost
102+
}// namespace boost
79103

80104
#include<boost/network/message/directives.hpp>
81105
// pull in directives header file

‎boost/network/message/directives.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@
1414
#include<boost/network/message/directives/body.hpp>
1515
#include<boost/network/message/directives/source.hpp>
1616
#include<boost/network/message/directives/destination.hpp>
17+
#include<boost/network/message/directives/remove_header.hpp>
1718

1819
namespaceboost {namespacenetwork {
1920

20-
template<classTag,template<class>classDirective>
21+
template<classTag,classDirective>
2122
inline basic_message<Tag> &
22-
operator<< (basic_message<Tag> & message_, Directive<Tag>const & directive) {
23+
operator<< (basic_message<Tag> & message_, Directiveconst & directive) {
2324
directive(message_);
2425
return message_;
25-
};
26+
}
2627

27-
};// namespace network
28+
}// namespace network
2829

29-
};// namespace boost
30+
}// namespace boost
3031

3132
#endif// __NETWORK_MESSAGE_DIRECTIVES_HPP__
3233

‎boost/network/message/directives/body.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,25 @@ namespace boost { namespace network {
2929
_body(body)
3030
{ };
3131

32-
voidoperator() (basic_message<tag> & msg)const {
32+
template<classMessageTag>
33+
voidoperator() (basic_message<MessageTag> & msg)const {
3334
msg.body() = _body;
34-
};
35+
}
3536

3637
private:
3738

3839
std::string _body;
3940
};
40-
};// namespace impl
41+
}// namespace impl
4142

4243
inline impl::body_directive<tags::default_>
4344
body(std::stringconst & body_) {
4445
return impl::body_directive<tags::default_>(body_);
45-
};
46+
}
4647

47-
};// namespace network
48+
}// namespace network
4849

49-
};// namespace boost
50+
}// namespace boost
5051

5152
#endif// __NETWORK_MESSAGE_DIRECTIVES_BODY_HPP__
5253

‎boost/network/message/directives/destination.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ namespace boost { namespace network {
3535

3636
std::string _destination;
3737
};
38-
};// namespace impl
38+
}// namespace impl
3939

4040
inline impl::destination_directive<tags::default_>
4141
destination(std::stringconst & destination_) {
4242
return impl::destination_directive<tags::default_>(destination_);
43-
};
43+
}
4444

45-
};// namespace network
45+
}// namespace network
4646

47-
};// namespace boost
47+
}// namespace boost
4848

4949
#endif// __NETWORK_MESSAGE_DIRECTIVES_DESTINATION_HPP__

‎boost/network/message/directives/header.hpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,34 @@ namespace boost { namespace network {
3131
_header_value(header_value)
3232
{ };
3333

34-
voidoperator() (basic_message<tag> & msg)const {
34+
template<classMessageTag>
35+
voidoperator() (basic_message<MessageTag> & msg)const {
3536
msg.headers().insert(
36-
typename basic_message<tag>::headers_container_type::value_type(
37+
typename basic_message<MessageTag>::headers_container_type::value_type(
3738
_header_name,
3839
_header_value
3940
)
4041
);
41-
};
42+
}
4243

4344
private:
4445

4546
mutable std::string _header_name;
4647
mutable std::string _header_value;
4748
};
48-
};// namespace impl
49+
}// namespace impl
4950

51+
template<classT1,classT2>
5052
inline impl::header_directive<tags::default_>
51-
header(std::stringconst & header_name,
52-
std::stringconst & header_value) {
53+
header(T1 header_name,
54+
T2 header_value) {
5355
return impl::header_directive<tags::default_>(header_name,
5456
header_value);
55-
};
57+
}
5658

57-
};
59+
}
5860

59-
};
61+
}
6062

6163
#endif// __NETWORK_MESSAGE_DIRECTIVES_HEADER_HPP__
6264

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
// Copyright Dean Michael Berris 2008.
3+
// 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)
6+
7+
#ifndef NETWORK_MESSAGE_DIRECTIVES_REMOVE_HEADER_HPP
8+
#defineNETWORK_MESSAGE_DIRECTIVES_REMOVE_HEADER_HPP
9+
10+
namespaceboost {namespacenetwork {
11+
12+
namespaceimpl {
13+
template<classTag>
14+
structremove_header_directive :publicdetail::directive_base<Tag> {
15+
typedef Tag tag;
16+
explicitremove_header_directive(
17+
std::stringconst & header_name
18+
) :
19+
header_name_(header_name)
20+
{ };
21+
22+
template<classMessageTag>
23+
voidoperator() (basic_message<MessageTag> & msg)const {
24+
msg.headers().erase(header_name_);
25+
}
26+
27+
private:
28+
mutable std::string header_name_;
29+
};
30+
31+
}// namespace impl
32+
33+
template<classT1>
34+
inline impl::remove_header_directive<tags::default_>
35+
remove_header(T1 header_name) {
36+
return impl::remove_header_directive<tags::default_>(header_name);
37+
}
38+
39+
}// namespace network
40+
41+
}// namespace boost
42+
43+
#endif// NETWORK_MESSAGE_DIRECTIVES_REMOVE_HEADER_HPP
44+

‎boost/network/message/directives/source.hpp

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,31 @@
1919
namespaceboost {namespacenetwork {
2020

2121
namespaceimpl {
22-
template<classTag>
23-
structsource_directive :publicdetail::directive_base<Tag> {
24-
typedef Tag tag;
25-
26-
explicitsource_directive ( std::stringconst & source)
27-
: _source(source)
28-
{ };
29-
30-
voidoperator() (basic_message<tag> & msg)const {
31-
msg.source() = _source;
32-
};
33-
34-
private:
35-
36-
mutable std::string _source;
37-
};
22+
structsource_directive :publicdetail::directive_base<tags::default_> {
23+
24+
explicitsource_directive ( std::stringconst & source)
25+
: _source(source)
26+
{ };
27+
28+
template<classTag>
29+
voidoperator() (basic_message<Tag> & msg)const {
30+
msg.source() = _source;
31+
}
32+
33+
private:
34+
35+
mutable std::string _source;
36+
};
3837
}// namespace impl
3938

40-
inline impl::source_directive<tags::default_>
39+
inline impl::source_directive
4140
source(std::stringconst & source_) {
42-
return impl::source_directive<tags::default_>(source_);
43-
};
41+
returnimpl::source_directive(source_);
42+
}
4443

45-
};// namespace network
44+
}// namespace network
4645

47-
};// namespace boost
46+
}// namespace boost
4847

4948
#endif// __NETWORK_MESSAGE_DIRECTIVES_SOURCE_HPP__
5049

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp