From a4392d4a7f80a29729b3be434e749e2254bd0d8d Mon Sep 17 00:00:00 2001 From: Andreas Pohl Date: Wed, 9 Dec 2015 23:11:40 +0100 Subject: [PATCH] libnghttp2_asio: Make io_service accessors const --- src/asio_io_service_pool.cc | 2 +- src/asio_io_service_pool.h | 2 +- src/asio_server.cc | 2 +- src/asio_server.h | 2 +- src/asio_server_http2.cc | 2 +- src/asio_server_http2_impl.cc | 2 +- src/asio_server_http2_impl.h | 2 +- src/includes/nghttp2/asio_http2_server.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/asio_io_service_pool.cc b/src/asio_io_service_pool.cc index cbf36ad7..916f6d1e 100644 --- a/src/asio_io_service_pool.cc +++ b/src/asio_io_service_pool.cc @@ -92,7 +92,7 @@ boost::asio::io_service &io_service_pool::get_io_service() { return io_service; } -std::vector> &io_service_pool::get_io_services() { +const std::vector> &io_service_pool::get_io_services() const { return io_services_; } diff --git a/src/asio_io_service_pool.h b/src/asio_io_service_pool.h index 03a60fe0..9c29619d 100644 --- a/src/asio_io_service_pool.h +++ b/src/asio_io_service_pool.h @@ -71,7 +71,7 @@ public: boost::asio::io_service &get_io_service(); /// Get access to all io_service objects. - std::vector> &get_io_services(); + const std::vector> &get_io_services() const; private: /// The pool of io_services. diff --git a/src/asio_server.cc b/src/asio_server.cc index f9352879..ff9bb3b5 100644 --- a/src/asio_server.cc +++ b/src/asio_server.cc @@ -169,7 +169,7 @@ void server::stop() { io_service_pool_.stop(); } void server::join() { io_service_pool_.join(); } -std::vector> &server::get_io_services() { +const std::vector> &server::get_io_services() const { return io_service_pool_.get_io_services(); } diff --git a/src/asio_server.h b/src/asio_server.h index ed89b9a5..433f6530 100644 --- a/src/asio_server.h +++ b/src/asio_server.h @@ -74,7 +74,7 @@ public: void stop(); /// Get access to all io_service objects. - std::vector> &get_io_services(); + const std::vector> &get_io_services() const; private: /// Initiate an asynchronous accept operation. diff --git a/src/asio_server_http2.cc b/src/asio_server_http2.cc index 17808f8d..ca270a25 100644 --- a/src/asio_server_http2.cc +++ b/src/asio_server_http2.cc @@ -77,7 +77,7 @@ void http2::stop() { impl_->stop(); } void http2::join() { return impl_->join(); } -std::vector> &http2::get_io_services() { +const std::vector> &http2::get_io_services() const { return impl_->get_io_services(); } diff --git a/src/asio_server_http2_impl.cc b/src/asio_server_http2_impl.cc index 187af44e..62c0df29 100644 --- a/src/asio_server_http2_impl.cc +++ b/src/asio_server_http2_impl.cc @@ -59,7 +59,7 @@ void http2_impl::stop() { return server_->stop(); } void http2_impl::join() { return server_->join(); } -std::vector> &http2_impl::get_io_services() { +const std::vector> &http2_impl::get_io_services() const { return server_->get_io_services(); } diff --git a/src/asio_server_http2_impl.h b/src/asio_server_http2_impl.h index d38b4307..395310bd 100644 --- a/src/asio_server_http2_impl.h +++ b/src/asio_server_http2_impl.h @@ -50,7 +50,7 @@ public: bool handle(std::string pattern, request_cb cb); void stop(); void join(); - std::vector> &get_io_services(); + const std::vector> &get_io_services() const; private: std::unique_ptr server_; diff --git a/src/includes/nghttp2/asio_http2_server.h b/src/includes/nghttp2/asio_http2_server.h index 0a892576..8756022e 100644 --- a/src/includes/nghttp2/asio_http2_server.h +++ b/src/includes/nghttp2/asio_http2_server.h @@ -202,7 +202,7 @@ public: void join(); // Get access to the io_service objects. - std::vector> &get_io_services(); + const std::vector> &get_io_services() const; private: std::unique_ptr impl_;