replace left-overs from boost::shared_ptr usage

This commit is contained in:
Dennis Luxen 2014-05-09 17:04:55 +02:00
parent b3ec9c9323
commit 00e27e4b5c
3 changed files with 7 additions and 8 deletions

View File

@ -31,7 +31,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/iostreams/filtering_stream.hpp> #include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp> #include <boost/iostreams/filter/gzip.hpp>

View File

@ -35,8 +35,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
@ -48,7 +48,7 @@ namespace http
class RequestParser; class RequestParser;
/// Represents a single connection from a client. /// Represents a single connection from a client.
class Connection : public boost::enable_shared_from_this<Connection> class Connection : public std::enable_shared_from_this<Connection>
{ {
public: public:
explicit Connection(boost::asio::io_service &io_service, RequestHandler &handler); explicit Connection(boost::asio::io_service &io_service, RequestHandler &handler);

View File

@ -33,10 +33,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <functional>
#include <memory>
#include <vector> #include <vector>
class Server class Server
@ -63,10 +63,10 @@ class Server
void Run() void Run()
{ {
std::vector<boost::shared_ptr<boost::thread>> threads; std::vector<std::shared_ptr<boost::thread>> threads;
for (unsigned i = 0; i < thread_pool_size; ++i) for (unsigned i = 0; i < thread_pool_size; ++i)
{ {
boost::shared_ptr<boost::thread> thread = boost::make_shared<boost::thread>( std::shared_ptr<boost::thread> thread = std::make_shared<boost::thread>(
boost::bind(&boost::asio::io_service::run, &io_service)); boost::bind(&boost::asio::io_service::run, &io_service));
threads.push_back(thread); threads.push_back(thread);
} }
@ -94,7 +94,7 @@ class Server
unsigned thread_pool_size; unsigned thread_pool_size;
boost::asio::io_service io_service; boost::asio::io_service io_service;
boost::asio::ip::tcp::acceptor acceptor; boost::asio::ip::tcp::acceptor acceptor;
boost::shared_ptr<http::Connection> new_connection; std::shared_ptr<http::Connection> new_connection;
RequestHandler request_handler; RequestHandler request_handler;
}; };