Skip to content

Commit 0eb17fc

Browse files
committed
Completed move out of Boost.
1 parent 3513c16 commit 0eb17fc

Some content is hidden

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

46 files changed

+365
-365
lines changed

include/network/message/message.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct message_pimpl;
2020
// The common message type.
2121
struct message : message_base {
2222
// Nested types
23-
typedef iterator_range<
23+
typedef boost::iterator_range<
2424
std::multimap<std::string, std::string>::const_iterator>
2525
headers_range;
2626

@@ -45,16 +45,16 @@ struct message : message_base {
4545
virtual void get_destination(std::string & destination) const;
4646
virtual void get_source(std::string & source) const;
4747
virtual void get_headers(
48-
function<void(std::string const &, std::string const &)> inserter) const;
48+
boost::function<void(std::string const &, std::string const &)> inserter) const;
4949
virtual void get_headers(
5050
std::string const & name,
51-
function<void(std::string const &, std::string const &)> inserter) const;
51+
boost::function<void(std::string const &, std::string const &)> inserter) const;
5252
virtual void get_headers(
53-
function<bool(std::string const &, std::string const &)> predicate,
54-
function<void(std::string const &, std::string const &)> inserter) const;
53+
boost::function<bool(std::string const &, std::string const &)> predicate,
54+
boost::function<void(std::string const &, std::string const &)> inserter) const;
5555
virtual void get_body(std::string & body) const;
5656
virtual void get_body(
57-
function<void(iterator_range<char const *>)> chunk_reader,
57+
boost::function<void(boost::iterator_range<char const *>)> chunk_reader,
5858
size_t size) const;
5959

6060
void swap(message & other);

include/network/message/message.ipp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ struct message_pimpl {
6161
source = source_;
6262
}
6363

64-
void get_headers(function<void(std::string const &, std::string const &)> inserter) const {
64+
void get_headers(boost::function<void(std::string const &, std::string const &)> inserter) const {
6565
std::multimap<std::string, std::string>::const_iterator it = headers_.begin(),
6666
end = headers_.end();
6767
for (; it != end; ++it) inserter(it->first, it->second);
6868
}
6969

7070
void get_headers(std::string const & name,
71-
function<void(std::string const &, std::string const &)> inserter) const {
71+
boost::function<void(std::string const &, std::string const &)> inserter) const {
7272
std::multimap<std::string, std::string>::const_iterator it = headers_.find(name),
7373
end= headers_.end();
7474
while (it != end) {
@@ -77,8 +77,8 @@ struct message_pimpl {
7777
}
7878
}
7979

80-
void get_headers(function<bool(std::string const &, std::string const &)> predicate,
81-
function<void(std::string const &, std::string const &)> inserter) const {
80+
void get_headers(boost::function<bool(std::string const &, std::string const &)> predicate,
81+
boost::function<void(std::string const &, std::string const &)> inserter) const {
8282
std::multimap<std::string, std::string>::const_iterator it = headers_.begin(),
8383
end = headers_.end();
8484
while (it != end) {
@@ -92,7 +92,7 @@ struct message_pimpl {
9292
body = body_;
9393
}
9494

95-
void get_body(function<void(iterator_range<char const *>)> chunk_reader, size_t size) const {
95+
void get_body(boost::function<void(boost::iterator_range<char const *>)> chunk_reader, size_t size) const {
9696
static char const * nullptr_ = 0;
9797
if (body_read_pos == body_.size())
9898
chunk_reader(boost::make_iterator_range(nullptr_, nullptr_));
@@ -179,25 +179,25 @@ void message::get_source(std::string & source) const {
179179
pimpl->get_source(source);
180180
}
181181

182-
void message::get_headers(function<void(std::string const &, std::string const &)> inserter) const {
182+
void message::get_headers(boost::function<void(std::string const &, std::string const &)> inserter) const {
183183
pimpl->get_headers(inserter);
184184
}
185185

186186
void message::get_headers(std::string const & name,
187-
function<void(std::string const &, std::string const &)> inserter) const {
187+
boost::function<void(std::string const &, std::string const &)> inserter) const {
188188
pimpl->get_headers(name, inserter);
189189
}
190190

191-
void message::get_headers(function<bool(std::string const &, std::string const &)> predicate,
192-
function<void(std::string const &, std::string const &)> inserter) const {
191+
void message::get_headers(boost::function<bool(std::string const &, std::string const &)> predicate,
192+
boost::function<void(std::string const &, std::string const &)> inserter) const {
193193
pimpl->get_headers(predicate, inserter);
194194
}
195195

196196
void message::get_body(std::string & body) const {
197197
pimpl->get_body(body);
198198
}
199199

200-
void message::get_body(function<void(iterator_range<char const *>)> chunk_reader, size_t size) const {
200+
void message::get_body(boost::function<void(boost::iterator_range<char const *>)> chunk_reader, size_t size) const {
201201
pimpl->get_body(chunk_reader, size);
202202
}
203203

include/network/message_fwd.hpp

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

7-
#ifndef 2008817MESSAGE_FWD_INC
8-
#define 2008817MESSAGE_FWD_INC
7+
#ifndef MESSAGE_FWS_INC_20120928
8+
#define MESSAGE_FWS_INC_20120928
99

1010
namespace network {
1111

@@ -14,4 +14,4 @@ struct basic_message;
1414

1515
} // namespace network
1616

17-
#endif // 2008817MESSAGE_FWD_INC
17+
#endif // MESSAGE_FWS_INC_20120928

include/network/protocol/http/client.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ struct client : basic_client_facade {
2424
typedef basic_client_facade
2525
base_facade_type;
2626
public:
27-
typedef ::boost::network::http::request request;
28-
typedef ::boost::network::http::response response;
27+
typedef network::http::request request;
28+
typedef network::http::response response;
2929

3030
// Constructor
3131
// =================================================================

include/network/protocol/http/client/base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class client_options;
2828

2929
struct client_base {
3030
typedef
31-
function<void(boost::iterator_range<char const *> const &, system::error_code const &)>
31+
boost::function<void(boost::iterator_range<char const *> const &, boost::system::error_code const &)>
3232
body_callback_function_type;
3333

3434
client_base();

include/network/protocol/http/client/base.ipp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace network { namespace http {
2222

2323
struct client_base_pimpl {
2424
typedef
25-
function<void(boost::iterator_range<char const *> const &, system::error_code const &)>
25+
boost::function<void(boost::iterator_range<char const *> const &, boost::system::error_code const &)>
2626
body_callback_function_type;
2727
client_base_pimpl(client_options const &options);
2828
response const request_skeleton(request const & request_,
@@ -37,7 +37,7 @@ struct client_base_pimpl {
3737
boost::asio::io_service * service_ptr;
3838
boost::shared_ptr<boost::asio::io_service::work> sentinel_;
3939
boost::shared_ptr<boost::thread> lifetime_thread_;
40-
shared_ptr<connection_manager> connection_manager_;
40+
boost::shared_ptr<connection_manager> connection_manager_;
4141
bool owned_service_;
4242
};
4343

@@ -78,7 +78,7 @@ client_base_pimpl::client_base_pimpl(client_options const &options)
7878
NETWORK_MESSAGE("client_base_pimpl::client_base_pimpl(client_options const &)");
7979
if (service_ptr == 0) {
8080
NETWORK_MESSAGE("creating owned io_service.");
81-
service_ptr = new(std::nothrow) asio::io_service;
81+
service_ptr = new(std::nothrow) boost::asio::io_service;
8282
owned_service_ = true;
8383
}
8484
if (!connection_manager_.get()) {
@@ -93,7 +93,7 @@ client_base_pimpl::client_base_pimpl(client_options const &options)
9393
service_ptr
9494
)));
9595
if (!lifetime_thread_.get())
96-
THROW_EXCEPTION(std::runtime_error("Cannot allocate client lifetime thread; not enough memory."));
96+
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot allocate client lifetime thread; not enough memory."));
9797
}
9898

9999
client_base_pimpl::~client_base_pimpl()
@@ -117,7 +117,7 @@ response const client_base_pimpl::request_skeleton(
117117
)
118118
{
119119
NETWORK_MESSAGE("client_base_pimpl::request_skeleton(...)");
120-
shared_ptr<client_connection> connection_;
120+
boost::shared_ptr<client_connection> connection_;
121121
connection_ = connection_manager_->get_connection(*service_ptr, request_, options_);
122122
return connection_->send_request(method, request_, get_body, callback, options);
123123
}

include/network/protocol/http/client/connection/async_normal.ipp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
165165
NETWORK_MESSAGE("http_async_connection_pimpl::handle_connected(...)");
166166
if (!ec) {
167167
NETWORK_MESSAGE("connected successfully");
168-
ASSERT(connection_delegate_.get() != 0);
168+
BOOST_ASSERT(connection_delegate_.get() != 0);
169169
NETWORK_MESSAGE("scheduling write...");
170170
connection_delegate_->write(command_streambuf,
171171
request_strand_.wrap(
@@ -339,7 +339,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
339339

340340
// The invocation of the callback is synchronous to allow us to
341341
// wait before scheduling another read.
342-
callback(make_iterator_range(begin, end), ec);
342+
callback(boost::make_iterator_range(begin, end), ec);
343343

344344
connection_delegate_->read_some(
345345
boost::asio::mutable_buffers_1(this->part.c_array(),
@@ -386,7 +386,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
386386
// We call the callback function synchronously passing the error
387387
// condition (in this case, end of file) so that it can handle
388388
// it appropriately.
389-
callback(make_iterator_range(begin, end), ec);
389+
callback(boost::make_iterator_range(begin, end), ec);
390390
} else {
391391
NETWORK_MESSAGE("no callback provided, appending to body...");
392392
std::string body_string;
@@ -414,7 +414,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
414414
buffer_type::const_iterator begin = this->part.begin();
415415
buffer_type::const_iterator end = begin;
416416
std::advance(end, bytes_transferred);
417-
callback(make_iterator_range(begin, end), ec);
417+
callback(boost::make_iterator_range(begin, end), ec);
418418
connection_delegate_->read_some(
419419
boost::asio::mutable_buffers_1(
420420
this->part.c_array(),
@@ -448,7 +448,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
448448
}
449449
return;
450450
default:
451-
ASSERT(false && "Bug, report this to the developers!");
451+
BOOST_ASSERT(false && "Bug, report this to the developers!");
452452
}
453453
} else {
454454
boost::system::system_error error(ec);
@@ -468,7 +468,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
468468
this->body_promise.set_exception(boost::copy_exception(error));
469469
break;
470470
default:
471-
ASSERT(false && "Bug, report this to the developers!");
471+
BOOST_ASSERT(false && "Bug, report this to the developers!");
472472
}
473473
}
474474
}
@@ -481,7 +481,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
481481
debug_escaper(debug_escaper const & other)
482482
: string(other.string) {}
483483
void operator()( std::string::value_type input) {
484-
if (!algorithm::is_print()(input)) {
484+
if (!boost::algorithm::is_print()(input)) {
485485
std::ostringstream escaped_stream;
486486
if (input == '\r') {
487487
string.append("\\r");
@@ -529,7 +529,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
529529
std::swap(version, partial_parsed);
530530
version.append(boost::begin(result_range),
531531
boost::end(result_range));
532-
algorithm::trim(version);
532+
boost::algorithm::trim(version);
533533
version_promise.set_value(version);
534534
part_begin = boost::end(result_range);
535535
} else if (parsed_ok == false) {
@@ -583,9 +583,9 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
583583
std::swap(status, partial_parsed);
584584
status.append(boost::begin(result_range),
585585
boost::end(result_range));
586-
trim(status);
586+
boost::trim(status);
587587
boost::uint16_t status_int =
588-
lexical_cast<boost::uint16_t>(status);
588+
boost::lexical_cast<boost::uint16_t>(status);
589589
status_promise.set_value(status_int);
590590
part_begin = boost::end(result_range);
591591
} else if (parsed_ok == false) {
@@ -638,7 +638,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
638638
std::swap(status_message, partial_parsed);
639639
status_message.append(boost::begin(result_range),
640640
boost::end(result_range));
641-
algorithm::trim(status_message);
641+
boost::algorithm::trim(status_message);
642642
status_message_promise.set_value(status_message);
643643
part_begin = boost::end(result_range);
644644
} else if (parsed_ok == false) {
@@ -700,13 +700,13 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
700700
boost::end(result_range));
701701
input_range.advance_begin(boost::distance(result_range));
702702

703-
trim(header_pair.first);
703+
boost::trim(header_pair.first);
704704
if (header_pair.first.size() > 1) {
705705
header_pair.first.erase(
706706
header_pair.first.size() - 1
707707
);
708708
}
709-
trim(header_pair.second);
709+
boost::trim(header_pair.second);
710710
headers.insert(header_pair);
711711
}
712712
headers_promise.set_value(headers);

include/network/protocol/http/client/facade.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ struct basic_client_facade {
2626
body_callback_function_type body_handler = body_callback_function_type(),
2727
request_options const &options=request_options());
2828
response const post(request request,
29-
optional<std::string> body = optional<std::string>(),
30-
optional<std::string> content_type = optional<std::string>(),
29+
boost::optional<std::string> body = boost::optional<std::string>(),
30+
boost::optional<std::string> content_type = boost::optional<std::string>(),
3131
body_callback_function_type body_handler = body_callback_function_type(),
3232
request_options const&options = request_options());
3333
response const put(request request,
34-
optional<std::string> body = optional<std::string>(),
35-
optional<std::string> content_type = optional<std::string>(),
34+
boost::optional<std::string> body = boost::optional<std::string>(),
35+
boost::optional<std::string> content_type = boost::optional<std::string>(),
3636
body_callback_function_type body_handler = body_callback_function_type(),
3737
request_options const & options = request_options());
3838
response const delete_(request const & request,

include/network/protocol/http/client/facade.ipp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ response const basic_client_facade::get(request const &request,
4141
}
4242

4343
response const basic_client_facade::post(request request,
44-
optional<std::string> body,
45-
optional<std::string> content_type,
44+
boost::optional<std::string> body,
45+
boost::optional<std::string> content_type,
4646
body_callback_function_type body_handler,
4747
request_options const &options) {
4848
NETWORK_MESSAGE("basic_client_facade::post(...)");
4949
if (body) {
5050
NETWORK_MESSAGE("using body provided.");
5151
request << remove_header("Content-Length")
5252
<< header("Content-Length", boost::lexical_cast<std::string>(body->size()))
53-
<< boost::network::body(*body);
53+
<< network::body(*body);
5454
}
5555

5656
headers_wrapper::container_type const & headers_ =
@@ -70,16 +70,16 @@ response const basic_client_facade::post(request request,
7070
}
7171

7272
response const basic_client_facade::put(request request,
73-
optional<std::string> body,
74-
optional<std::string> content_type,
73+
boost::optional<std::string> body,
74+
boost::optional<std::string> content_type,
7575
body_callback_function_type body_handler,
7676
request_options const & options) {
7777
NETWORK_MESSAGE("basic_client_facade::put(...)");
7878
if (body) {
7979
NETWORK_MESSAGE("using body provided.");
8080
request << remove_header("Content-Length")
8181
<< header("Content-Length", boost::lexical_cast<std::string>(body->size()))
82-
<< boost::network::body(*body);
82+
<< network::body(*body);
8383
}
8484

8585
headers_wrapper::container_type const & headers_ =

0 commit comments

Comments
 (0)