mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-07-29 20:17:37 +02:00
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:
@ -47,10 +47,8 @@ private:
|
||||
tracked_op(tracked_op&&) = default;
|
||||
tracked_op(const tracked_op&) = delete;
|
||||
|
||||
using executor_type = tracking_type<Handler, Executor>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
tracked_op& operator=(tracked_op&&) = default;
|
||||
tracked_op& operator=(const tracked_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<Handler>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
@ -63,6 +61,11 @@ private:
|
||||
return asio::get_associated_cancellation_slot(_handler);
|
||||
}
|
||||
|
||||
using executor_type = tracking_type<Handler, Executor>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
|
||||
void operator()(error_code ec) {
|
||||
std::move(_handler)(ec);
|
||||
}
|
||||
@ -104,7 +107,7 @@ private:
|
||||
|
||||
public:
|
||||
template <typename Executor>
|
||||
async_mutex(Executor&& ex) : _ex(std::forward<Executor>(ex)) {}
|
||||
explicit async_mutex(Executor&& ex) : _ex(std::forward<Executor>(ex)) {}
|
||||
|
||||
async_mutex(const async_mutex&) = delete;
|
||||
async_mutex& operator=(const async_mutex&) = delete;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/asio/associated_executor.hpp>
|
||||
#include <boost/asio/execution.hpp>
|
||||
#include <boost/asio/prefer.hpp>
|
||||
#include <boost/asio/write.hpp>
|
||||
|
||||
|
@ -42,6 +42,9 @@ public:
|
||||
cancellable_handler(cancellable_handler&&) = default;
|
||||
cancellable_handler(const cancellable_handler&) = delete;
|
||||
|
||||
cancellable_handler& operator=(cancellable_handler&&) = default;
|
||||
cancellable_handler& operator=(const cancellable_handler&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<Handler>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return asio::get_associated_allocator(_handler);
|
||||
|
@ -61,7 +61,10 @@ class control_packet {
|
||||
|
||||
public:
|
||||
control_packet(control_packet&&) noexcept = default;
|
||||
control_packet(const control_packet&) noexcept = delete;
|
||||
control_packet(const control_packet&) = delete;
|
||||
|
||||
control_packet& operator=(control_packet&&) noexcept = default;
|
||||
control_packet& operator=(const control_packet&) = delete;
|
||||
|
||||
template <
|
||||
typename EncodeFun,
|
||||
@ -136,6 +139,12 @@ public:
|
||||
_free_ids.emplace_back(MAX_PACKET_ID, uint16_t(0));
|
||||
}
|
||||
|
||||
packet_id_allocator(packet_id_allocator&&) noexcept = default;
|
||||
packet_id_allocator(const packet_id_allocator&) = delete;
|
||||
|
||||
packet_id_allocator& operator=(packet_id_allocator&&) noexcept = default;
|
||||
packet_id_allocator& operator=(const packet_id_allocator&) = delete;
|
||||
|
||||
uint16_t allocate() {
|
||||
if (_free_ids.empty()) return 0;
|
||||
auto& last = _free_ids.back();
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <boost/asio/append.hpp>
|
||||
#include <boost/asio/associated_allocator.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <boost/asio/completion_condition.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
@ -24,7 +25,6 @@
|
||||
|
||||
#include <async_mqtt5/impl/codecs/message_decoders.hpp>
|
||||
|
||||
|
||||
namespace async_mqtt5::detail {
|
||||
|
||||
namespace asio = boost::asio;
|
||||
@ -80,16 +80,19 @@ public:
|
||||
assemble_op(assemble_op&&) noexcept = default;
|
||||
assemble_op(const assemble_op&) = delete;
|
||||
|
||||
using executor_type = typename client_service::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _svc.get_executor();
|
||||
}
|
||||
assemble_op& operator=(assemble_op&&) noexcept = default;
|
||||
assemble_op& operator=(const assemble_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return asio::get_associated_allocator(_handler);
|
||||
}
|
||||
|
||||
using executor_type = typename client_service::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _svc.get_executor();
|
||||
}
|
||||
|
||||
template <typename CompletionCondition>
|
||||
void perform(CompletionCondition cc) {
|
||||
_read_buff.erase(
|
||||
|
@ -42,6 +42,12 @@ public:
|
||||
_handler(std::move(handler))
|
||||
{}
|
||||
|
||||
write_req(write_req&&) = default;
|
||||
write_req(const write_req&) = delete;
|
||||
|
||||
write_req& operator=(write_req&&) = default;
|
||||
write_req& operator=(const write_req&) = delete;
|
||||
|
||||
static serial_num_t next_serial_num(serial_num_t last) {
|
||||
return last + 1;
|
||||
}
|
||||
@ -123,6 +129,12 @@ class async_sender {
|
||||
public:
|
||||
explicit async_sender(ClientService& svc) : _svc(svc) {}
|
||||
|
||||
async_sender(async_sender&&) = default;
|
||||
async_sender(const async_sender&) = delete;
|
||||
|
||||
async_sender& operator=(async_sender&&) = default;
|
||||
async_sender& operator=(const async_sender&) = delete;
|
||||
|
||||
using allocator_type = queue_allocator_type;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return allocator_type {};
|
||||
|
@ -71,6 +71,9 @@ public:
|
||||
replace_next_layer(construct_next_layer());
|
||||
}
|
||||
|
||||
autoconnect_stream(const autoconnect_stream&) = delete;
|
||||
autoconnect_stream& operator=(const autoconnect_stream&) = delete;
|
||||
|
||||
using next_layer_type = stream_type;
|
||||
next_layer_type& next_layer() {
|
||||
return *_stream_ptr;
|
||||
|
@ -133,6 +133,7 @@ class stream_context<
|
||||
mqtt_ctx _mqtt_context;
|
||||
public:
|
||||
explicit stream_context(std::monostate) {}
|
||||
|
||||
stream_context(const stream_context& other) :
|
||||
_mqtt_context(other._mqtt_context)
|
||||
{}
|
||||
@ -271,7 +272,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
client_service(
|
||||
explicit client_service(
|
||||
const executor_type& ex,
|
||||
tls_context_type tls_context = {}
|
||||
) :
|
||||
|
@ -9,6 +9,9 @@
|
||||
#define ASYNC_MQTT5_CONNECT_OP_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/cancellation_state.hpp>
|
||||
#include <boost/asio/consign.hpp>
|
||||
#include <boost/asio/completion_condition.hpp>
|
||||
@ -76,13 +79,11 @@ public:
|
||||
)
|
||||
{}
|
||||
|
||||
connect_op(connect_op&&) noexcept = default;
|
||||
connect_op(connect_op&&) = default;
|
||||
connect_op(const connect_op&) = delete;
|
||||
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
connect_op& operator=(connect_op&&) = default;
|
||||
connect_op& operator=(const connect_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
@ -95,6 +96,11 @@ public:
|
||||
return _cancellation_state.slot();
|
||||
}
|
||||
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
|
||||
void perform(
|
||||
const epoints& eps, authority_path ap
|
||||
) {
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
disconnect_op(disconnect_op&&) = default;
|
||||
disconnect_op(const disconnect_op&) = delete;
|
||||
|
||||
disconnect_op& operator=(disconnect_op&&) noexcept = default;
|
||||
disconnect_op& operator=(disconnect_op&&) = default;
|
||||
disconnect_op& operator=(const disconnect_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
@ -200,7 +200,7 @@ public:
|
||||
terminal_disconnect_op(terminal_disconnect_op&&) = default;
|
||||
terminal_disconnect_op(const terminal_disconnect_op&) = delete;
|
||||
|
||||
terminal_disconnect_op& operator=(terminal_disconnect_op&&) noexcept = default;
|
||||
terminal_disconnect_op& operator=(terminal_disconnect_op&&) = default;
|
||||
terminal_disconnect_op& operator=(const terminal_disconnect_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -59,9 +59,8 @@ public:
|
||||
ping_op(ping_op&&) noexcept = default;
|
||||
ping_op(const ping_op&) = delete;
|
||||
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
ping_op& operator=(ping_op&&) noexcept = default;
|
||||
ping_op& operator=(const ping_op&) = delete;
|
||||
|
||||
using allocator_type = asio::recycling_allocator<void>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
@ -73,6 +72,10 @@ public:
|
||||
return _cancellation_state.slot();
|
||||
}
|
||||
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
|
||||
void perform() {
|
||||
_ping_timer->expires_after(compute_wait_time());
|
||||
_ping_timer->async_wait(
|
||||
|
@ -33,6 +33,7 @@ namespace asio = boost::asio;
|
||||
template <typename ClientService>
|
||||
class publish_rec_op {
|
||||
using client_service = ClientService;
|
||||
|
||||
struct on_puback {};
|
||||
struct on_pubrec {};
|
||||
struct on_pubrel {};
|
||||
@ -42,23 +43,26 @@ class publish_rec_op {
|
||||
decoders::publish_message _message;
|
||||
|
||||
public:
|
||||
publish_rec_op(const std::shared_ptr<client_service>& svc_ptr) :
|
||||
explicit publish_rec_op(const std::shared_ptr<client_service>& svc_ptr) :
|
||||
_svc_ptr(svc_ptr)
|
||||
{}
|
||||
|
||||
publish_rec_op(publish_rec_op&&) noexcept = default;
|
||||
publish_rec_op(const publish_rec_op&) = delete;
|
||||
|
||||
using executor_type = typename client_service::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _svc_ptr->get_executor();
|
||||
}
|
||||
publish_rec_op& operator=(publish_rec_op&&) noexcept = default;
|
||||
publish_rec_op& operator=(const publish_rec_op&) = delete;
|
||||
|
||||
using allocator_type = asio::recycling_allocator<void>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return allocator_type {};
|
||||
}
|
||||
|
||||
using executor_type = typename client_service::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _svc_ptr->get_executor();
|
||||
}
|
||||
|
||||
void perform(decoders::publish_message message) {
|
||||
auto flags = std::get<2>(message);
|
||||
auto qos_bits = (flags >> 1) & 0b11;
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
publish_send_op(publish_send_op&&) = default;
|
||||
publish_send_op(const publish_send_op&) = delete;
|
||||
|
||||
publish_send_op& operator=(publish_send_op&&) noexcept = default;
|
||||
publish_send_op& operator=(publish_send_op&&) = default;
|
||||
publish_send_op& operator=(const publish_send_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define ASYNC_MQTT5_RE_AUTH_OP_hpp
|
||||
|
||||
#include <boost/asio/detached.hpp>
|
||||
#include <boost/asio/recycling_allocator.hpp>
|
||||
|
||||
#include <async_mqtt5/error.hpp>
|
||||
#include <async_mqtt5/reason_codes.hpp>
|
||||
@ -34,24 +35,27 @@ class re_auth_op {
|
||||
any_authenticator& _auth;
|
||||
|
||||
public:
|
||||
re_auth_op(const std::shared_ptr<client_service>& svc_ptr) :
|
||||
explicit re_auth_op(const std::shared_ptr<client_service>& svc_ptr) :
|
||||
_svc_ptr(svc_ptr),
|
||||
_auth(_svc_ptr->_stream_context.mqtt_context().authenticator)
|
||||
{}
|
||||
|
||||
re_auth_op(re_auth_op&&) noexcept = default;
|
||||
re_auth_op(const re_auth_op&) noexcept = delete;
|
||||
re_auth_op(const re_auth_op&) = delete;
|
||||
|
||||
using executor_type = typename client_service::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _svc_ptr->get_executor();
|
||||
}
|
||||
re_auth_op& operator=(re_auth_op&&) noexcept = default;
|
||||
re_auth_op& operator=(const re_auth_op&) = delete;
|
||||
|
||||
using allocator_type = asio::recycling_allocator<void>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return allocator_type {};
|
||||
}
|
||||
|
||||
using executor_type = typename client_service::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _svc_ptr->get_executor();
|
||||
}
|
||||
|
||||
void perform() {
|
||||
if (_auth.method().empty())
|
||||
return;
|
||||
|
@ -50,15 +50,18 @@ public:
|
||||
read_message_op(read_message_op&&) noexcept = default;
|
||||
read_message_op(const read_message_op&) = delete;
|
||||
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
read_message_op& operator=(read_message_op&&) noexcept = default;
|
||||
read_message_op& operator=(const read_message_op&) = delete;
|
||||
|
||||
using allocator_type = asio::recycling_allocator<void>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return allocator_type {};
|
||||
}
|
||||
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
|
||||
void perform() {
|
||||
_svc_ptr->async_assemble(
|
||||
asio::prepend(std::move(*this), on_message {})
|
||||
|
@ -8,6 +8,8 @@
|
||||
#ifndef ASYNC_MQTT5_READ_OP_HPP
|
||||
#define ASYNC_MQTT5_READ_OP_HPP
|
||||
|
||||
#include <boost/asio/associated_allocator.hpp>
|
||||
#include <boost/asio/associated_executor.hpp>
|
||||
#include <boost/asio/deferred.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/prepend.hpp>
|
||||
@ -40,16 +42,19 @@ public:
|
||||
read_op(read_op&&) = default;
|
||||
read_op(const read_op&) = delete;
|
||||
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
read_op& operator=(read_op&&) = default;
|
||||
read_op& operator=(const read_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return asio::get_associated_allocator(_handler);
|
||||
}
|
||||
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
|
||||
template <typename BufferType>
|
||||
void perform(
|
||||
const BufferType& buffer, duration wait_for
|
||||
|
@ -8,6 +8,9 @@
|
||||
#ifndef ASYNC_MQTT5_RECONNECT_OP_HPP
|
||||
#define ASYNC_MQTT5_RECONNECT_OP_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/prepend.hpp>
|
||||
@ -76,10 +79,8 @@ public:
|
||||
reconnect_op(reconnect_op&&) = default;
|
||||
reconnect_op(const reconnect_op&) = delete;
|
||||
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
reconnect_op& operator=(reconnect_op&&) = default;
|
||||
reconnect_op& operator=(const reconnect_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
@ -92,6 +93,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(typename Owner::stream_ptr s) {
|
||||
_owner._conn_mtx.lock(
|
||||
asio::prepend(std::move(*this), on_locked {}, s)
|
||||
|
@ -43,6 +43,12 @@ private:
|
||||
_ts(std::chrono::system_clock::now())
|
||||
{}
|
||||
|
||||
reply_handler(reply_handler&&) = default;
|
||||
reply_handler(const reply_handler&) = delete;
|
||||
|
||||
reply_handler& operator=(reply_handler&&) = default;
|
||||
reply_handler& operator=(const reply_handler&) = delete;
|
||||
|
||||
void complete(
|
||||
error_code ec,
|
||||
byte_citer first = byte_citer {}, byte_citer last = byte_citer {}
|
||||
@ -87,7 +93,13 @@ private:
|
||||
|
||||
public:
|
||||
template <typename Executor>
|
||||
replies(const Executor& ex) : _ex(ex) {}
|
||||
explicit replies(const Executor& ex) : _ex(ex) {}
|
||||
|
||||
replies(replies&&) = default;
|
||||
replies(const replies&) = delete;
|
||||
|
||||
replies& operator=(replies&&) = default;
|
||||
replies& operator=(const replies&) = delete;
|
||||
|
||||
template <typename CompletionToken>
|
||||
decltype(auto) async_wait_reply(
|
||||
|
@ -8,6 +8,8 @@
|
||||
#ifndef ASYNC_MQTT5_SENTRY_OP_HPP
|
||||
#define ASYNC_MQTT5_SENTRY_OP_HPP
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include <boost/asio/cancellation_signal.hpp>
|
||||
#include <boost/asio/error.hpp>
|
||||
#include <boost/asio/prepend.hpp>
|
||||
@ -51,9 +53,8 @@ public:
|
||||
sentry_op(sentry_op&&) noexcept = default;
|
||||
sentry_op(const sentry_op&) = delete;
|
||||
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
sentry_op& operator=(sentry_op&&) noexcept = default;
|
||||
sentry_op& operator=(const sentry_op&) = delete;
|
||||
|
||||
using allocator_type = asio::recycling_allocator<void>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
@ -65,6 +66,10 @@ public:
|
||||
return _svc_ptr->_cancel_sentry.slot();
|
||||
}
|
||||
|
||||
executor_type get_executor() const noexcept {
|
||||
return _executor;
|
||||
}
|
||||
|
||||
void perform() {
|
||||
_sentry_timer->expires_after(check_interval);
|
||||
_sentry_timer->async_wait(
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
subscribe_op(subscribe_op&&) = default;
|
||||
subscribe_op(const subscribe_op&) = delete;
|
||||
|
||||
subscribe_op& operator=(subscribe_op&&) noexcept = default;
|
||||
subscribe_op& operator=(subscribe_op&&) = default;
|
||||
subscribe_op& operator=(const subscribe_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
unsubscribe_op(unsubscribe_op&&) = default;
|
||||
unsubscribe_op(const unsubscribe_op&) = delete;
|
||||
|
||||
unsubscribe_op& operator=(unsubscribe_op&&) noexcept = default;
|
||||
unsubscribe_op& operator=(unsubscribe_op&&) = default;
|
||||
unsubscribe_op& operator=(const unsubscribe_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
|
@ -8,6 +8,8 @@
|
||||
#ifndef ASYNC_MQTT5_WRITE_OP_HPP
|
||||
#define ASYNC_MQTT5_WRITE_OP_HPP
|
||||
|
||||
#include <boost/asio/associated_allocator.hpp>
|
||||
#include <boost/asio/associated_executor.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/prepend.hpp>
|
||||
@ -35,16 +37,19 @@ public:
|
||||
write_op(write_op&&) = default;
|
||||
write_op(const write_op&) = delete;
|
||||
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
write_op& operator=(write_op&&) = default;
|
||||
write_op& operator=(const write_op&) = delete;
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
return asio::get_associated_allocator(_handler);
|
||||
}
|
||||
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
|
||||
template <typename BufferType>
|
||||
void perform(BufferType& buffer) {
|
||||
auto stream_ptr = _owner._stream_ptr;
|
||||
|
@ -117,7 +117,7 @@ public:
|
||||
*
|
||||
* \details Moved-from client can only be destructed
|
||||
*/
|
||||
mqtt_client(mqtt_client&& other) noexcept = default;
|
||||
mqtt_client(mqtt_client&&) noexcept = default;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -55,18 +55,6 @@ public:
|
||||
constexpr explicit reason_code(uint8_t code) : _code(code) {}
|
||||
/// \endcond
|
||||
|
||||
/// Copy constructor.
|
||||
reason_code(const reason_code&) = default;
|
||||
|
||||
/// Move constructor.
|
||||
reason_code(reason_code&&) = default;
|
||||
|
||||
/// Copy assignment operator.
|
||||
reason_code& operator=(const reason_code&) = default;
|
||||
|
||||
/// Move assignment operator.
|
||||
reason_code& operator=(reason_code&&) = default;
|
||||
|
||||
/**
|
||||
* \brief Indication if the object holds a Reason Code indicating an error.
|
||||
*
|
||||
|
@ -334,18 +334,6 @@ public:
|
||||
_qos(qos), _retain(retain)
|
||||
{}
|
||||
|
||||
/// Copy constructor.
|
||||
will(const will&) = default;
|
||||
|
||||
/// Move constructor.
|
||||
will(will&&) noexcept = default;
|
||||
|
||||
/// Copy assignment operator.
|
||||
will& operator=(const will&) = delete;
|
||||
|
||||
/// Move assignment operator.
|
||||
will& operator=(will&&) noexcept = default;
|
||||
|
||||
/// Get the Topic Name.
|
||||
std::string_view topic() const {
|
||||
return _topic;
|
||||
|
@ -50,10 +50,8 @@ public:
|
||||
delayed_op(delayed_op&&) = default;
|
||||
delayed_op(const delayed_op&) = delete;
|
||||
|
||||
using executor_type = asio::steady_timer::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _timer->get_executor();
|
||||
}
|
||||
delayed_op& operator=(delayed_op&&) = default;
|
||||
delayed_op& operator=(const delayed_op&) = delete;
|
||||
|
||||
using allocator_type = asio::recycling_allocator<void>;
|
||||
allocator_type get_allocator() const noexcept {
|
||||
@ -65,6 +63,11 @@ public:
|
||||
return _cancel_slot;
|
||||
}
|
||||
|
||||
using executor_type = asio::steady_timer::executor_type;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _timer->get_executor();
|
||||
}
|
||||
|
||||
template <typename CompletionHandler>
|
||||
void perform(CompletionHandler&& handler) {
|
||||
_cancel_slot = asio::get_associated_cancellation_slot(handler);
|
||||
|
@ -50,6 +50,9 @@ public:
|
||||
stream_message(const stream_message&) = delete;
|
||||
stream_message(stream_message&&) = default;
|
||||
|
||||
stream_message& operator=(stream_message&&) = default;
|
||||
stream_message& operator=(const stream_message&) = delete;
|
||||
|
||||
template <typename Executor>
|
||||
auto to_operation(const Executor& ex) {
|
||||
return delayed_op<error_code, std::vector<uint8_t>> {
|
||||
@ -77,8 +80,11 @@ public:
|
||||
_expected_packets({ std::forward<Args>(args)... })
|
||||
{}
|
||||
|
||||
client_message(const client_message&) = delete;
|
||||
client_message(client_message&&) = default;
|
||||
client_message(const client_message&) = delete;
|
||||
|
||||
client_message& operator=(client_message&&) = default;
|
||||
client_message& operator=(const client_message&) = delete;
|
||||
|
||||
client_message& complete_with(error_code ec, duration af) {
|
||||
_write_ec = ec;
|
||||
@ -165,8 +171,11 @@ public:
|
||||
_owner(owner), _message(ec, af, std::forward<Args>(args) ...)
|
||||
{}
|
||||
|
||||
broker_message(const broker_message&) = delete;
|
||||
broker_message(broker_message&&) = default;
|
||||
broker_message(const broker_message&) = delete;
|
||||
|
||||
broker_message& operator=(broker_message&&) = default;
|
||||
broker_message& operator=(const broker_message&) = delete;
|
||||
|
||||
template <typename ...Args>
|
||||
client_message& expect(Args&& ...args);
|
||||
@ -186,6 +195,14 @@ class msg_exchange {
|
||||
std::vector<broker_message> _from_broker;
|
||||
|
||||
public:
|
||||
msg_exchange() = default;
|
||||
|
||||
msg_exchange(msg_exchange&&) = default;
|
||||
msg_exchange(const msg_exchange&) = delete;
|
||||
|
||||
msg_exchange& operator=(msg_exchange&&) = default;
|
||||
msg_exchange& operator=(const msg_exchange&) = delete;
|
||||
|
||||
template <
|
||||
typename ...Args,
|
||||
std::enable_if_t<
|
||||
|
@ -49,8 +49,12 @@ public:
|
||||
{}
|
||||
|
||||
pending_read() = default;
|
||||
|
||||
pending_read(pending_read&&) = default;
|
||||
pending_read(const pending_read&) = delete;
|
||||
|
||||
pending_read& operator=(pending_read&&) = default;
|
||||
pending_read& operator=(const pending_read&) = delete;
|
||||
|
||||
size_t consume(const std::vector<uint8_t>& data) {
|
||||
size_t num_bytes = std::min(_buffer_size, data.size());
|
||||
@ -98,7 +102,7 @@ private:
|
||||
std::vector<std::unique_ptr<asio::cancellation_signal>> _cancel_signals;
|
||||
|
||||
public:
|
||||
test_broker(
|
||||
explicit test_broker(
|
||||
asio::execution_context& context,
|
||||
asio::any_io_executor ex = {}, msg_exchange broker_side = {}
|
||||
) :
|
||||
@ -108,7 +112,7 @@ public:
|
||||
}
|
||||
|
||||
test_broker(const test_broker&) = delete;
|
||||
void operator=(const test_broker&) = delete;
|
||||
test_broker& operator=(const test_broker&) = delete;
|
||||
|
||||
executor_type get_executor() const noexcept {
|
||||
return _ex;
|
||||
|
@ -32,7 +32,7 @@ class test_service : public async_mqtt5::detail::client_service<StreamType, TlsC
|
||||
asio::any_io_executor _ex;
|
||||
connack_props _test_props;
|
||||
public:
|
||||
test_service(const asio::any_io_executor ex)
|
||||
explicit test_service(const asio::any_io_executor ex)
|
||||
: base(ex), _ex(ex)
|
||||
{}
|
||||
|
||||
@ -74,7 +74,7 @@ template <
|
||||
>
|
||||
class overrun_client : public async_mqtt5::detail::client_service<StreamType, TlsContext> {
|
||||
public:
|
||||
overrun_client(const asio::any_io_executor& ex) :
|
||||
explicit overrun_client(const asio::any_io_executor& ex) :
|
||||
async_mqtt5::detail::client_service<StreamType, TlsContext>(ex)
|
||||
{}
|
||||
|
||||
|
@ -251,11 +251,12 @@ private:
|
||||
std::shared_ptr<detail::test_stream_impl> _impl;
|
||||
|
||||
public:
|
||||
test_stream(executor_type ex) :
|
||||
explicit test_stream(executor_type ex) :
|
||||
_impl(std::make_shared<detail::test_stream_impl>(std::move(ex)))
|
||||
{}
|
||||
|
||||
test_stream(const test_stream&) = delete;
|
||||
test_stream& operator=(const test_stream&) = delete;
|
||||
|
||||
~test_stream() {
|
||||
error_code ec;
|
||||
|
@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(immediate_executor_async_subscribe) {
|
||||
}
|
||||
);
|
||||
c.async_subscribe(
|
||||
{ "+topic" }, subscribe_props {}, std::move(handler)
|
||||
{ "+topic", subscribe_options {} }, subscribe_props{}, std::move(handler)
|
||||
);
|
||||
|
||||
ioc.run();
|
||||
|
Reference in New Issue
Block a user