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

Commit6d77f4d

Browse files
committed
Adding missing files.
1 parenta35361a commit6d77f4d

File tree

4 files changed

+265
-0
lines changed

4 files changed

+265
-0
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_ASYNC_MESSAGE_HPP_20100622
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_ASYNC_MESSAGE_HPP_20100622
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/thread/future.hpp>
11+
#include<boost/cstdint.hpp>
12+
13+
namespaceboost {namespacenetwork {namespacehttp {
14+
15+
template<classTag>
16+
structasync_message {
17+
18+
typedeftypename string<Tag>::type string_type;
19+
typedeftypename headers_container<Tag>::type headers_container_type;
20+
21+
async_message()
22+
: status_message_(),
23+
status_(),
24+
version_(),
25+
source_(),
26+
destination_(),
27+
headers_(),
28+
body_()
29+
{}
30+
31+
async_message(async_messageconst & other)
32+
: status_message_(other.status_message_),
33+
status_(other.status_),
34+
version_(other.version_),
35+
source_(other.source_),
36+
destination_(other.destination_),
37+
headers_(other.destination_),
38+
body_(other.body_)
39+
{}
40+
41+
string_typeconststatus_message()const {
42+
return status_message_.get();
43+
}
44+
45+
voidstatus_message(boost::shared_future<string_type>const & future)const {
46+
status_message_ = future;
47+
}
48+
49+
string_typeconstversion()const {
50+
return version_.get();
51+
}
52+
53+
voidversion(boost::shared_future<string_type>const & future)const {
54+
version_ = future;
55+
}
56+
57+
boost::uint16_tconststatus()const {
58+
return status_.get();
59+
}
60+
61+
voidstatus(boost::shared_future<string_type>const & future)const {
62+
status_ = future;
63+
}
64+
65+
string_typeconstsource()const {
66+
return source_.get();
67+
}
68+
69+
voidsource(boost::shared_future<string_type>const & future)const {
70+
source_ = future;
71+
}
72+
73+
string_typeconstdestination()const {
74+
return destination_.get();
75+
}
76+
77+
voiddestination(boost::shared_future<string_type>const & future)const {
78+
destination_ = future;
79+
}
80+
81+
headers_container_typeconstheaders()const {
82+
return headers_.get();
83+
}
84+
85+
voidheaders(boost::shared_future<headers_container_type>const & future)const {
86+
headers_ = future;
87+
}
88+
89+
string_typeconstbody()const {
90+
return body_.get();
91+
}
92+
93+
voidbody(boost::shared_future<string_type>const & future)const {
94+
body_ = future;
95+
}
96+
97+
voidswap(async_message & other) {
98+
std::swap(status_message_, other.status_message_);
99+
std::swap(status_, other.status_);
100+
std::swap(version_, other.version_);
101+
std::swap(source_, other.source_);
102+
std::swap(destination_, other.destination_);
103+
std::swap(headers_, other.headers_);
104+
std::swap(body_, other.body_);
105+
}
106+
107+
async_message &operator=(async_message other) {
108+
other.swap(*this);
109+
return *this;
110+
}
111+
112+
private:
113+
114+
mutable boost::shared_future<string_type> status_message_,
115+
version_, source_, destination_, body_;
116+
mutable boost::shared_future<boost::uint16_t> status_;
117+
mutable boost::shared_future<headers_container_type> headers_;
118+
119+
};
120+
121+
template<classTag>
122+
inlinevoidswap(async_message<Tag> & lhs, async_message<Tag> & rhs) {
123+
lhs.swap(rhs);
124+
}
125+
126+
}// namespace http
127+
128+
}// namespace network
129+
130+
}// namespace boost
131+
132+
#include<boost/network/protocol/http/message/wrappers/source.hpp>
133+
#include<boost/network/protocol/http/message/wrappers/body.hpp>
134+
135+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_ASYNC_MESSAGE_HPP_20100622
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_BODY_HPP_20100622
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_BODY_HPP_20100622
3+
4+
// Copyright 2010 (c) Dean Michael Berris
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
#include<boost/network/protocol/http/response_concept.hpp>
10+
#include<boost/concept/requires.hpp>
11+
12+
namespaceboost {namespacenetwork {namespacehttp {
13+
14+
template<classTag>
15+
structbasic_response;
16+
17+
namespaceimpl {
18+
19+
template<classTag>
20+
structbody_wrapper {
21+
typedeftypename string<Tag>::type string_type;
22+
basic_response<Tag>const & message_;
23+
body_wrapper(basic_response<Tag>const & message)
24+
: message_(message) {}
25+
body_wrapper(body_wrapperconst & other)
26+
: message_(other.message_) {}
27+
operator string_typeconst () {
28+
return message_.body();
29+
}
30+
};
31+
32+
}// namespace impl
33+
34+
template<classTag>
35+
inline
36+
BOOST_CONCEPT_REQUIRES(((Response<basic_response<Tag> >)),
37+
(typename impl::body_wrapper<Tag>::string_typeconst))
38+
body(basic_response<Tag>const & message) {
39+
return impl::body_wrapper<Tag>(message);
40+
}
41+
42+
}// namespace http
43+
44+
}// namespace network
45+
46+
}// namespace boost
47+
48+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_BODY_HPP_20100622
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_SOURCE_HPP_20100622
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_SOURCE_HPP_20100622
3+
4+
// Copyright 2010 (c) Dean Michael Berris
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
#include<boost/network/protocol/http/response_concept.hpp>
10+
#include<boost/concept/requires.hpp>
11+
12+
namespaceboost {namespacenetwork {namespacehttp {
13+
14+
template<classTag>
15+
structbasic_response;
16+
17+
namespaceimpl {
18+
19+
template<classTag>
20+
structsource_wrapper {
21+
typedeftypename string<Tag>::type string_type;
22+
basic_response<Tag>const & message_;
23+
source_wrapper(basic_response<Tag>const & message)
24+
: message_(message) {}
25+
source_wrapper(source_wrapperconst & other)
26+
: message_(other.message_) {}
27+
operator string_typeconst () {
28+
return message_.source();
29+
}
30+
};
31+
32+
}// namespace impl
33+
34+
template<classTag>
35+
inline
36+
BOOST_CONCEPT_REQUIRES(((Response<basic_response<Tag> >)),
37+
(impl::source_wrapper<Tag>const))
38+
source(basic_response<Tag>const & message) {
39+
return impl::source_wrapper<Tag>(message);
40+
}
41+
42+
}// namespace http
43+
44+
}// namespace network
45+
46+
}// namespace boost
47+
48+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_SOURCE_HPP_20100622
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_POLICIES_ASYNC_RESOLVER_20100622
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_POLICIES_ASYNC_RESOLVER_20100622
3+
4+
// Copyright Dean Michael Berris 2010.
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
namespaceboost {namespacenetwork {namespacehttp {namespacepolicies {
10+
11+
template<classTag>
12+
structasync_resolver {
13+
typedeftypename resolver<Tag>::type resolver_type;
14+
typedeftypename resolver_type::iterator resolver_iterator;
15+
typedeftypename resolver_type::query resolver_query;
16+
typedef std::pair<resolver_iterator, resolver_iterator> resolver_iterator_pair;
17+
18+
protected:
19+
bool cache_resolved_;
20+
21+
explicitasync_resolver(bool cache_resolved)
22+
: cache_resolver_(cache_resolved)
23+
{}
24+
};
25+
26+
}// namespace policies
27+
28+
}// namespace http
29+
30+
}// namespace network
31+
32+
}// namespace boost
33+
34+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_POLICIES_ASYNC_RESOLVER_20100622

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp