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

Commit5645bfc

Browse files
committed
Making wrapper_base more generic, preparing for async-related wrappers.
1 parent1014405 commit5645bfc

File tree

8 files changed

+33
-27
lines changed

8 files changed

+33
-27
lines changed

‎boost/network/detail/directive_base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace boost { namespace network { namespace detail {
1818
//explicit directive_base(basic_message<tag> & message_)
1919
// : _message(message_)
2020
protected:
21-
virtual~directive_base()
21+
~directive_base()
2222
{ };// can only be extended
2323

2424
// mutable basic_message<tag> & _message;

‎boost/network/detail/wrapper_base.hpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,30 @@
99

1010
namespaceboost {namespacenetwork {
1111

12-
template<classTag>
13-
structbasic_message;
14-
1512
namespacedetail {
1613

17-
template<classTag>
14+
template<classTag,classMessage>
1815
structwrapper_base {
19-
explicitwrapper_base(basic_message<Tag> & message_)
16+
explicitwrapper_base(Message & message_)
2017
: _message(message_)
2118
{};
2219

2320
protected:
2421
~wrapper_base() {};// for extending only
2522

26-
basic_message<Tag> & _message;
23+
Message & _message;
2724
};
2825

29-
template<classTag>
26+
template<classTag,classMessage>
3027
structwrapper_base_const {
31-
explicitwrapper_base_const(basic_message<Tag>const & message_)
28+
explicitwrapper_base_const(Messageconst & message_)
3229
: _message(message_)
3330
{}
3431

3532
protected:
3633
~wrapper_base_const() {};// for extending only
3734

38-
basic_message<Tag>const & _message;
35+
Messageconst & _message;
3936
};
4037

4138
}// namespace detail

‎boost/network/message.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ namespace boost { namespace network {
125125
private:
126126

127127
friendstructdetail::directive_base<Tag> ;
128-
friendstructdetail::wrapper_base<Tag> ;
128+
friendstructdetail::wrapper_base<Tag, basic_message<Tag>> ;
129129

130130
mutable headers_container_type _headers;
131131
mutable string_type _body;

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,46 @@
88
#define__NETWORK_MESSAGE_WRAPPERS_BODY_HPP__
99

1010
#include<boost/network/traits/string.hpp>
11+
#include<boost/network/detail/wrapper_base.hpp>
1112

1213
namespaceboost {namespacenetwork {
1314

1415
namespaceimpl {
1516
template<classTag>
16-
structbody_wrapper :publicdetail::wrapper_base<Tag> {
17+
structbody_wrapper :publicdetail::wrapper_base<Tag, basic_message<Tag>> {
1718
typedef basic_message<Tag> message_type;
1819
typedeftypename string<Tag>::type string_type;
20+
typedef detail::wrapper_base<Tag, basic_message<Tag> > wrapper_base;
1921

2022
explicitbody_wrapper(basic_message<Tag> & message_)
21-
:detail::wrapper_base<Tag>(message_)
23+
: wrapper_base(message_)
2224
{ };
2325

2426
operatorstring_type ()const {
25-
returnstring_type(detail::wrapper_base<Tag>::_message.body());
27+
returnstring_type(wrapper_base::_message.body());
2628
};
2729

2830
std::size_tsize()const {
29-
returndetail::wrapper_base<Tag>::_message.body().size();
31+
return wrapper_base::_message.body().size();
3032
}
3133
};
3234

3335
template<classTag>
34-
structbody_wrapper_const :publicdetail::wrapper_base_const<Tag> {
36+
structbody_wrapper_const :publicdetail::wrapper_base_const<Tag, basic_message<Tag>> {
3537
typedef basic_message<Tag> message_type;
3638
typedeftypename string<Tag>::type string_type;
39+
typedef detail::wrapper_base_const<Tag, basic_message<Tag> > wrapper_base;
3740

3841
explicitbody_wrapper_const(basic_message<Tag>const & message_)
39-
:detail::wrapper_base_const<Tag>(message_)
42+
:wrapper_base(message_)
4043
{};
4144

4245
operatorstring_type ()const {
43-
returnstring_type(detail::wrapper_base_const<Tag>::_message.body());
46+
returnstring_type(wrapper_base::_message.body());
4447
}
4548

4649
std::size_tsize()const {
47-
returndetail::wrapper_base<Tag>::_message.body().size();
50+
return wrapper_base::_message.body().size();
4851
}
4952
};
5053

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ namespace boost { namespace network {
1515

1616
namespaceimpl {
1717
template<classTag>
18-
structdestination_wrapper :publicdetail::wrapper_base<Tag> {
18+
structdestination_wrapper :publicdetail::wrapper_base<Tag, basic_message<Tag>> {
1919
typedef Tag tag;
2020
typedef basic_message<tag> message_type;
2121
typedeftypename string<Tag>::type string_type;
22+
typedef detail::wrapper_base<Tag, basic_message<Tag> > wrapper_base;
2223

2324
explicitdestination_wrapper(message_type & message_)
24-
:detail::wrapper_base<tag>(message_)
25+
: wrapper_base(message_)
2526
{ };
2627

2728
operatorstring_type ()const {
28-
returnstring_type(detail::wrapper_base<tag>::_message.destination());
29+
returnstring_type(wrapper_base::_message.destination());
2930
};
3031
};
3132
}// namespace impl

‎boost/network/message/wrappers/headers.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,18 @@ namespace boost { namespace network {
4545
*/
4646
namespaceimpl {
4747
template<classTag>
48-
structheaders_wrapper :publicdetail::wrapper_base_const<Tag> {
48+
structheaders_wrapper :publicdetail::wrapper_base_const<Tag, basic_message<Tag>> {
4949
typedef Tag tag;
5050
typedef basic_message<Tag> message_type;
5151
typedeftypename string<Tag>::type string_type;
5252
typedeftypename headers_range<message_type>::type range_type;
5353
typedeftypename headers_container<Tag>::type headers_container_type;
5454
typedeftypename headers_container_type::const_iterator const_iterator;
5555
typedeftypename headers_container_type::iterator iterator;
56+
typedef detail::wrapper_base_const<Tag, basic_message<Tag> > wrapper_base;
5657

5758
explicitheaders_wrapper(basic_message<Tag>const & message_)
58-
:detail::wrapper_base_const<Tag>(message_)
59+
:wrapper_base(message_)
5960
{ };
6061

6162
range_typeoperator[] (string_typeconst & key)const {

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ namespace boost { namespace network {
1515

1616
namespaceimpl {
1717
template<classTag>
18-
structsource_wrapper :publicdetail::wrapper_base<Tag> {
18+
structsource_wrapper :publicdetail::wrapper_base<Tag, basic_message<Tag>> {
1919
typedef Tag tag;
2020
typedef basic_message<tag> message_type;
2121
typedeftypename string<tag>::type string_type;
22+
typedef detail::wrapper_base<Tag, basic_message<Tag> > wrapper_base;
2223

2324
explicitsource_wrapper(basic_message<tag> & message_)
24-
:detail::wrapper_base<tag>(message_)
25+
: wrapper_base(message_)
2526
{ };
2627

2728
operatorstring_type ()const {
28-
returnstring_type(detail::wrapper_base<tag>::_message.source());
29+
returnstring_type(wrapper_base::_message.source());
2930
};
3031
};
3132
}// namespace impl

‎boost/network/protocol/http/message/async_message.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//FIXME move this out to a trait
1414
#include<set>
1515
#include<boost/foreach.hpp>
16+
#include<boost/network/detail/wrapper_base.hpp>
1617

1718
namespaceboost {namespacenetwork {namespacehttp {
1819

@@ -135,6 +136,8 @@ namespace boost { namespace network { namespace http {
135136
mutable headers_container_type added_headers;
136137
mutable std::set<string_type> removed_headers;
137138
mutable boost::shared_future<string_type> body_;
139+
140+
friendstructboost::network::detail::wrapper_base<Tag, async_message<Tag> >;
138141
};
139142

140143
template<classTag>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp