Commit 690a1622 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

asio: Add const qualifier to client::session member functions

parent aaef7985
...@@ -49,24 +49,28 @@ session::session(boost::asio::io_service &io_service, ...@@ -49,24 +49,28 @@ session::session(boost::asio::io_service &io_service,
session::~session() {} session::~session() {}
void session::on_connect(connect_cb cb) { impl_->on_connect(std::move(cb)); } void session::on_connect(connect_cb cb) const {
impl_->on_connect(std::move(cb));
}
void session::on_error(error_cb cb) { impl_->on_error(std::move(cb)); } void session::on_error(error_cb cb) const { impl_->on_error(std::move(cb)); }
void session::shutdown() { impl_->shutdown(); } void session::shutdown() const { impl_->shutdown(); }
boost::asio::io_service &session::io_service() { return impl_->io_service(); } boost::asio::io_service &session::io_service() const {
return impl_->io_service();
}
const request *session::submit(boost::system::error_code &ec, const request *session::submit(boost::system::error_code &ec,
const std::string &method, const std::string &method,
const std::string &uri, header_map h) { const std::string &uri, header_map h) const {
return impl_->submit(ec, method, uri, read_cb(), std::move(h)); return impl_->submit(ec, method, uri, read_cb(), std::move(h));
} }
const request *session::submit(boost::system::error_code &ec, const request *session::submit(boost::system::error_code &ec,
const std::string &method, const std::string &method,
const std::string &uri, std::string data, const std::string &uri, std::string data,
header_map h) { header_map h) const {
return impl_->submit(ec, method, uri, string_reader(std::move(data)), return impl_->submit(ec, method, uri, string_reader(std::move(data)),
std::move(h)); std::move(h));
} }
...@@ -74,7 +78,7 @@ const request *session::submit(boost::system::error_code &ec, ...@@ -74,7 +78,7 @@ const request *session::submit(boost::system::error_code &ec,
const request *session::submit(boost::system::error_code &ec, const request *session::submit(boost::system::error_code &ec,
const std::string &method, const std::string &method,
const std::string &uri, read_cb cb, const std::string &uri, read_cb cb,
header_map h) { header_map h) const {
return impl_->submit(ec, method, uri, std::move(cb), std::move(h)); return impl_->submit(ec, method, uri, std::move(cb), std::move(h));
} }
......
...@@ -97,22 +97,22 @@ public: ...@@ -97,22 +97,22 @@ public:
const std::string &service); const std::string &service);
~session(); ~session();
void on_connect(connect_cb cb); void on_connect(connect_cb cb) const;
void on_error(error_cb cb); void on_error(error_cb cb) const;
void shutdown(); void shutdown() const;
boost::asio::io_service &io_service(); boost::asio::io_service &io_service() const;
const request *submit(boost::system::error_code &ec, const request *submit(boost::system::error_code &ec,
const std::string &method, const std::string &uri, const std::string &method, const std::string &uri,
header_map h = {}); header_map h = {}) const;
const request *submit(boost::system::error_code &ec, const request *submit(boost::system::error_code &ec,
const std::string &method, const std::string &uri, const std::string &method, const std::string &uri,
std::string data, header_map h = {}); std::string data, header_map h = {}) const;
const request *submit(boost::system::error_code &ec, const request *submit(boost::system::error_code &ec,
const std::string &method, const std::string &uri, const std::string &method, const std::string &uri,
read_cb cb, header_map h = {}); read_cb cb, header_map h = {}) const;
private: private:
std::unique_ptr<session_impl> impl_; std::unique_ptr<session_impl> impl_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment