Skip to content

Commit bd35adb

Browse files
committed
Replaced boost::shared_ptr with std::shared_ptr.
1 parent 8a4c1a0 commit bd35adb

28 files changed

+119
-120
lines changed

boost/network/protocol/http/client/async_impl.hpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
// http://www.boost.org/LICENSE_1_0.txt)
1010

1111
#include <thread>
12+
#include <memory>
1213
#include <boost/asio/io_service.hpp>
1314
#include <boost/asio/strand.hpp>
1415
#include <boost/bind.hpp>
15-
#include <boost/make_shared.hpp>
1616
#include <boost/network/protocol/http/traits/connection_policy.hpp>
17-
#include <boost/shared_ptr.hpp>
1817

1918
namespace boost {
2019
namespace network {
@@ -39,7 +38,7 @@ struct async_client
3938

4039
async_client(bool cache_resolved, bool follow_redirect,
4140
bool always_verify_peer, int timeout,
42-
boost::shared_ptr<boost::asio::io_service> service,
41+
std::shared_ptr<boost::asio::io_service> service,
4342
optional<string_type> certificate_filename,
4443
optional<string_type> verify_path,
4544
optional<string_type> certificate_file,
@@ -48,7 +47,7 @@ struct async_client
4847
: connection_base(cache_resolved, follow_redirect, timeout),
4948
service_ptr(service.get()
5049
? service
51-
: boost::make_shared<boost::asio::io_service>()),
50+
: std::make_shared<boost::asio::io_service>()),
5251
service_(*service_ptr),
5352
resolver_(service_),
5453
sentinel_(new boost::asio::io_service::work(service_)),
@@ -88,11 +87,11 @@ struct async_client
8887
generator);
8988
}
9089

91-
boost::shared_ptr<boost::asio::io_service> service_ptr;
90+
std::shared_ptr<boost::asio::io_service> service_ptr;
9291
boost::asio::io_service& service_;
9392
resolver_type resolver_;
94-
boost::shared_ptr<boost::asio::io_service::work> sentinel_;
95-
boost::shared_ptr<std::thread> lifetime_thread_;
93+
std::shared_ptr<boost::asio::io_service::work> sentinel_;
94+
std::shared_ptr<std::thread> lifetime_thread_;
9695
optional<string_type> certificate_filename_;
9796
optional<string_type> verify_path_;
9897
optional<string_type> certificate_file_;

boost/network/protocol/http/client/connection/async_base.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct async_connection_base {
3232
typedef function<void(char_const_range const &, system::error_code const &)>
3333
body_callback_function_type;
3434
typedef function<bool(string_type &)> body_generator_function_type;
35-
typedef shared_ptr<this_type> connection_ptr;
35+
typedef std::shared_ptr<this_type> connection_ptr;
3636

3737
// This is the factory function which constructs the appropriate async
3838
// connection implementation with the correct delegate chosen based on the

boost/network/protocol/http/client/connection/async_normal.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ template <class Tag, unsigned version_major, unsigned version_minor>
4949
struct http_async_connection
5050
: async_connection_base<Tag, version_major, version_minor>,
5151
protected http_async_protocol_handler<Tag, version_major, version_minor>,
52-
boost::enable_shared_from_this<
52+
std::enable_shared_from_this<
5353
http_async_connection<Tag, version_major, version_minor> > {
5454
http_async_connection(http_async_connection const&) = delete;
5555

boost/network/protocol/http/client/connection/connection_delegate_factory.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct normal_delegate;
2828

2929
template <class Tag>
3030
struct connection_delegate_factory {
31-
typedef shared_ptr<connection_delegate> connection_delegate_ptr;
31+
typedef std::shared_ptr<connection_delegate> connection_delegate_ptr;
3232
typedef typename string<Tag>::type string_type;
3333

3434
// This is the factory method that actually returns the delegate

boost/network/protocol/http/client/connection/ssl_delegate.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include <boost/asio/io_service.hpp>
1111
#include <boost/asio/ssl.hpp>
12-
#include <boost/enable_shared_from_this.hpp>
1312
#include <boost/network/protocol/http/client/connection/connection_delegate.hpp>
1413
#include <boost/network/support/is_default_string.hpp>
1514
#include <boost/network/support/is_default_wstring.hpp>
@@ -22,7 +21,7 @@ namespace http {
2221
namespace impl {
2322

2423
struct ssl_delegate : connection_delegate,
25-
enable_shared_from_this<ssl_delegate> {
24+
std::enable_shared_from_this<ssl_delegate> {
2625
ssl_delegate(asio::io_service &service, bool always_verify_peer,
2726
optional<std::string> certificate_filename,
2827
optional<std::string> verify_path,

boost/network/protocol/http/client/connection/sync_normal.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ template <class Tag, unsigned version_major, unsigned version_minor>
3131
struct http_sync_connection
3232
: public virtual sync_connection_base<Tag, version_major, version_minor>,
3333
sync_connection_base_impl<Tag, version_major, version_minor>,
34-
boost::enable_shared_from_this<
34+
std::enable_shared_from_this<
3535
http_sync_connection<Tag, version_major, version_minor> > {
3636
typedef typename resolver_policy<Tag>::type resolver_base;
3737
typedef typename resolver_base::resolver_type resolver_type;

boost/network/protocol/http/client/connection/sync_ssl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ template <class Tag, unsigned version_major, unsigned version_minor>
3434
struct https_sync_connection
3535
: public virtual sync_connection_base<Tag, version_major, version_minor>,
3636
sync_connection_base_impl<Tag, version_major, version_minor>,
37-
boost::enable_shared_from_this<
37+
std::enable_shared_from_this<
3838
https_sync_connection<Tag, version_major, version_minor> > {
3939
typedef typename resolver_policy<Tag>::type resolver_base;
4040
typedef typename resolver_base::resolver_type resolver_type;

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// (See accompanying file LICENSE_1_0.txt or copy at
88
// http://www.boost.org/LICENSE_1_0.txt)
99

10+
#include <memory>
1011
#include <boost/network/protocol/http/client/pimpl.hpp>
1112
#include <boost/network/protocol/http/request.hpp>
1213
#include <boost/network/protocol/http/response.hpp>
@@ -299,7 +300,7 @@ class basic_client_facade {
299300
void clear_resolved_cache() { pimpl->clear_resolved_cache(); }
300301

301302
protected:
302-
boost::shared_ptr<pimpl_type> pimpl;
303+
std::shared_ptr<pimpl_type> pimpl;
303304

304305
void init_pimpl(client_options<Tag> const& options) {
305306
pimpl.reset(new pimpl_type(

boost/network/protocol/http/client/options.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
// (See accompanying file LICENSE_1_0.txt or copy at
88
// http://www.boost.org/LICENSE_1_0.txt)
99

10+
#include <memory>
1011
#include <boost/asio/io_service.hpp>
1112
#include <boost/network/traits/string.hpp>
1213
#include <boost/optional/optional.hpp>
13-
#include <boost/smart_ptr/shared_ptr.hpp>
1414

1515
namespace boost {
1616
namespace network {
@@ -107,7 +107,7 @@ class client_options {
107107
return *this;
108108
}
109109

110-
client_options& io_service(boost::shared_ptr<boost::asio::io_service> v) {
110+
client_options& io_service(std::shared_ptr<boost::asio::io_service> v) {
111111
io_service_ = v;
112112
return *this;
113113
}
@@ -148,7 +148,7 @@ class client_options {
148148

149149
long openssl_options() const { return openssl_options_; }
150150

151-
boost::shared_ptr<boost::asio::io_service> io_service() const {
151+
std::shared_ptr<boost::asio::io_service> io_service() const {
152152
return io_service_;
153153
}
154154

@@ -165,7 +165,7 @@ class client_options {
165165
boost::optional<string_type> openssl_private_key_file_;
166166
boost::optional<string_type> openssl_ciphers_;
167167
long openssl_options_;
168-
boost::shared_ptr<boost::asio::io_service> io_service_;
168+
std::shared_ptr<boost::asio::io_service> io_service_;
169169
bool always_verify_peer_;
170170
int timeout_;
171171
};

boost/network/protocol/http/client/pimpl.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// (See accompanying file LICENSE_1_0.txt or copy at
77
// http://www.boost.org/LICENSE_1_0.txt)
88

9+
#include <memory>
910
#include <boost/asio/io_service.hpp>
1011
#include <boost/mpl/and.hpp>
1112
#include <boost/mpl/if.hpp>
@@ -16,7 +17,6 @@
1617
#include <boost/network/support/is_async.hpp>
1718
#include <boost/network/support/is_sync.hpp>
1819
#include <boost/optional/optional.hpp>
19-
#include <boost/smart_ptr/shared_ptr.hpp>
2020
#include <boost/static_assert.hpp>
2121

2222
namespace boost {
@@ -74,7 +74,7 @@ struct basic_client_impl
7474
optional<string_type> const& certificate_file,
7575
optional<string_type> const& private_key_file,
7676
optional<string_type> const& ciphers, long ssl_options,
77-
boost::shared_ptr<boost::asio::io_service> service,
77+
std::shared_ptr<boost::asio::io_service> service,
7878
int timeout)
7979
: base_type(cache_resolved, follow_redirect, always_verify_peer, timeout,
8080
service, certificate_filename, verify_path, certificate_file,

boost/network/protocol/http/client/sync_impl.hpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// (See accompanying file LICENSE_1_0.txt or copy at
88
// http://www.boost.org/LICENSE_1_0.txt)
99

10+
#include <memory>
1011
#include <boost/bind/bind.hpp>
1112
#include <boost/function.hpp>
1213
#include <boost/network/protocol/http/client/options.hpp>
@@ -15,8 +16,6 @@
1516
#include <boost/network/protocol/http/traits/connection_policy.hpp>
1617
#include <boost/network/traits/string.hpp>
1718
#include <boost/optional/optional.hpp>
18-
#include <boost/smart_ptr/make_shared.hpp>
19-
#include <boost/smart_ptr/shared_ptr.hpp>
2019

2120
namespace boost {
2221
namespace network {
@@ -38,7 +37,7 @@ struct sync_client
3837
typedef function<bool(string_type&)> body_generator_function_type;
3938
friend struct basic_client_impl<Tag, version_major, version_minor>;
4039

41-
boost::shared_ptr<boost::asio::io_service> service_ptr;
40+
std::shared_ptr<boost::asio::io_service> service_ptr;
4241
boost::asio::io_service& service_;
4342
resolver_type resolver_;
4443
optional<string_type> certificate_filename_;
@@ -51,7 +50,7 @@ struct sync_client
5150

5251
sync_client(
5352
bool cache_resolved, bool follow_redirect, bool always_verify_peer,
54-
int timeout, boost::shared_ptr<boost::asio::io_service> service,
53+
int timeout, std::shared_ptr<boost::asio::io_service> service,
5554
optional<string_type> certificate_filename =
5655
optional<string_type>(),
5756
optional<string_type> verify_path = optional<string_type>(),
@@ -61,7 +60,7 @@ struct sync_client
6160
long ssl_options = 0)
6261
: connection_base(cache_resolved, follow_redirect, timeout),
6362
service_ptr(service.get() ? service
64-
: make_shared<boost::asio::io_service>()),
63+
: std::make_shared<boost::asio::io_service>()),
6564
service_(*service_ptr),
6665
resolver_(service_),
6766
certificate_filename_(std::move(certificate_filename)),

boost/network/protocol/http/policies/async_connection.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// (See accompanying file LICENSE_1_0.txt or copy at
1010
// http://www.boost.org/LICENSE_1_0.txt)
1111

12+
#include <memory>
1213
#include <boost/algorithm/string/predicate.hpp>
1314
#include <boost/bind.hpp>
1415
#include <boost/cstdint.hpp>
@@ -18,7 +19,6 @@
1819
#include <boost/network/protocol/http/message/wrappers/protocol.hpp>
1920
#include <boost/network/protocol/http/traits/resolver_policy.hpp>
2021
#include <boost/network/version.hpp>
21-
#include <boost/shared_ptr.hpp>
2222
#include <boost/tuple/tuple.hpp>
2323

2424
namespace boost {
@@ -63,11 +63,11 @@ struct async_connection_policy : resolver_policy<Tag>::type {
6363
}
6464

6565
private:
66-
shared_ptr<http::impl::async_connection_base<Tag, version_major,
66+
std::shared_ptr<http::impl::async_connection_base<Tag, version_major,
6767
version_minor> > pimpl;
6868
};
6969

70-
typedef boost::shared_ptr<connection_impl> connection_ptr;
70+
typedef std::shared_ptr<connection_impl> connection_ptr;
7171
connection_ptr get_connection(
7272
resolver_type& resolver, basic_request<Tag> const& request_,
7373
bool always_verify_peer,

boost/network/protocol/http/policies/async_resolver.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// (See accompanying file LICENSE_1_0.txt or copy at
77
// http://www.boost.org/LICENSE_1_0.txt)
88

9+
#include <memory>
910
#include <boost/asio/placeholders.hpp>
10-
#include <boost/enable_shared_from_this.hpp>
1111
#include <boost/asio/strand.hpp>
1212
#include <boost/network/protocol/http/traits/resolver.hpp>
1313
#include <boost/network/traits/string.hpp>
@@ -24,7 +24,7 @@ namespace http {
2424
namespace policies {
2525

2626
template <class Tag>
27-
struct async_resolver : boost::enable_shared_from_this<async_resolver<Tag> > {
27+
struct async_resolver : std::enable_shared_from_this<async_resolver<Tag> > {
2828
typedef typename resolver<Tag>::type resolver_type;
2929
typedef typename resolver_type::iterator resolver_iterator;
3030
typedef typename resolver_type::query resolver_query;
@@ -42,8 +42,8 @@ struct async_resolver : boost::enable_shared_from_this<async_resolver<Tag> > {
4242
protected:
4343
bool cache_resolved_;
4444
endpoint_cache endpoint_cache_;
45-
boost::shared_ptr<boost::asio::io_service> service_;
46-
boost::shared_ptr<boost::asio::io_service::strand> resolver_strand_;
45+
std::shared_ptr<boost::asio::io_service> service_;
46+
std::shared_ptr<boost::asio::io_service::strand> resolver_strand_;
4747

4848
explicit async_resolver(bool cache_resolved)
4949
: cache_resolved_(cache_resolved), endpoint_cache_() {}

boost/network/protocol/http/policies/pooled_connection.hpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <boost/network/protocol/http/client/connection/sync_base.hpp>
1212
#include <boost/network/protocol/http/response.hpp>
1313
#include <boost/network/protocol/http/traits/resolver_policy.hpp>
14-
#include <boost/shared_ptr.hpp>
1514
#include <boost/thread/mutex.hpp>
1615
#include <boost/unordered_map.hpp>
1716
#include <utility>
@@ -40,7 +39,7 @@ struct pooled_connection_policy : resolver_policy<Tag>::type {
4039
void cleanup() { host_connection_map().swap(host_connections_); }
4140

4241
struct connection_impl {
43-
typedef function<shared_ptr<connection_impl>(
42+
typedef function<std::shared_ptr<connection_impl>(
4443
resolver_type&, basic_request<Tag> const&, optional<string_type> const&,
4544
optional<string_type> const&, optional<string_type> const&,
4645
optional<string_type> const&, optional<string_type> const&)>
@@ -166,7 +165,7 @@ struct pooled_connection_policy : resolver_policy<Tag>::type {
166165
} while (true);
167166
}
168167

169-
shared_ptr<http::impl::sync_connection_base<Tag, version_major,
168+
std::shared_ptr<http::impl::sync_connection_base<Tag, version_major,
170169
version_minor> > pimpl;
171170
resolver_type& resolver_;
172171
bool connection_follow_redirect_;
@@ -179,9 +178,9 @@ struct pooled_connection_policy : resolver_policy<Tag>::type {
179178
long ssl_options_;
180179
};
181180

182-
typedef shared_ptr<connection_impl> connection_ptr;
181+
typedef std::shared_ptr<connection_impl> connection_ptr;
183182

184-
typedef unordered_map<string_type, weak_ptr<connection_impl>> host_connection_map;
183+
typedef unordered_map<string_type, std::weak_ptr<connection_impl>> host_connection_map;
185184
boost::mutex host_mutex_;
186185
host_connection_map host_connections_;
187186
bool follow_redirect_;

boost/network/protocol/http/policies/simple_connection.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// http://www.boost.org/LICENSE_1_0.txt)
99

1010
#include <iterator>
11+
#include <memory>
1112
#include <boost/function.hpp>
1213
#include <boost/cstdint.hpp>
1314
#include <boost/lexical_cast.hpp>
@@ -16,7 +17,6 @@
1617
#include <boost/network/protocol/http/traits/resolver_policy.hpp>
1718
#include <boost/network/traits/string.hpp>
1819
#include <boost/network/version.hpp>
19-
#include <boost/shared_ptr.hpp>
2020
#include <boost/network/protocol/http/client/connection/sync_base.hpp>
2121
#include <boost/network/traits/string.hpp>
2222
#include <boost/optional/optional.hpp>
@@ -110,12 +110,12 @@ struct simple_connection_policy : resolver_policy<Tag>::type {
110110
}
111111

112112
private:
113-
shared_ptr<http::impl::sync_connection_base<Tag, version_major,
113+
std::shared_ptr<http::impl::sync_connection_base<Tag, version_major,
114114
version_minor> > pimpl;
115115
bool follow_redirect_;
116116
};
117117

118-
typedef boost::shared_ptr<connection_impl> connection_ptr;
118+
typedef std::shared_ptr<connection_impl> connection_ptr;
119119
connection_ptr get_connection(
120120
resolver_type& resolver, basic_request<Tag> const& request_,
121121
bool always_verify_peer,

0 commit comments

Comments
 (0)