Add missing assignment operators

Summary:
related to T13767
- add missing assignment operators
- marked single argument constructors as explicit where needed
- add even more missing includes

Reviewers: ivica

Reviewed By: ivica

Subscribers: iljazovic, miljen

Differential Revision: https://repo.mireo.local/D30813
This commit is contained in:
Korina Šimičević
2024-08-08 09:55:45 +02:00
parent b55ec679bf
commit 0330df77a3
32 changed files with 195 additions and 97 deletions

View File

@@ -9,6 +9,9 @@
#define ASYNC_MQTT5_ENDPOINTS_HPP
#include <boost/asio/append.hpp>
#include <boost/asio/associated_allocator.hpp>
#include <boost/asio/associated_executor.hpp>
#include <boost/asio/associated_cancellation_slot.hpp>
#include <boost/asio/deferred.hpp>
#include <boost/asio/dispatch.hpp>
#include <boost/asio/post.hpp>
@@ -43,10 +46,8 @@ public:
resolve_op(resolve_op&&) = default;
resolve_op(const resolve_op&) = delete;
using executor_type = asio::associated_executor_t<handler_type>;
executor_type get_executor() const noexcept {
return asio::get_associated_executor(_handler);
}
resolve_op& operator=(resolve_op&&) = default;
resolve_op& operator=(const resolve_op&) = delete;
using allocator_type = asio::associated_allocator_t<handler_type>;
allocator_type get_allocator() const noexcept {
@@ -59,6 +60,11 @@ public:
return asio::get_associated_cancellation_slot(_handler);
}
using executor_type = asio::associated_executor_t<handler_type>;
executor_type get_executor() const noexcept {
return asio::get_associated_executor(_handler);
}
void perform() {
namespace asioex = boost::asio::experimental;
@@ -152,13 +158,16 @@ public:
_resolver(ex), _connect_timer(timer)
{}
endpoints(const endpoints&) = delete;
endpoints& operator=(const endpoints&) = delete;
void clone_servers(const endpoints& other) {
_servers = other._servers;
}
using executor_type = asio::ip::tcp::resolver::executor_type;
// NOTE: asio::ip::basic_resolver returns executor by value
executor_type get_executor() {
executor_type get_executor() noexcept {
return _resolver.get_executor();
}