From 0fb11ac274d7b29b22b90d624aa22cb7d024dcf0 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:40:24 +0200 Subject: [PATCH] Add copy / move to MessageDispatcher --- lib/utils/message-dispatcher.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/utils/message-dispatcher.hpp b/lib/utils/message-dispatcher.hpp index 2f78aa45..1bc766c3 100644 --- a/lib/utils/message-dispatcher.hpp +++ b/lib/utils/message-dispatcher.hpp @@ -9,6 +9,27 @@ namespace advss { template class MessageDispatcher { public: + MessageDispatcher() = default; + ~MessageDispatcher() = default; + MessageDispatcher(const MessageDispatcher &other) + : _clients(other._clients) + { + } + MessageDispatcher(MessageDispatcher &&other) noexcept + : _clients(other._clients) + { + } + MessageDispatcher &operator=(const MessageDispatcher &other) + { + _clients = other._clients; + return *this; + } + MessageDispatcher &operator=(MessageDispatcher &&other) noexcept + { + std::swap(_clients, other._clients); + return *this; + } + [[nodiscard]] std::shared_ptr> RegisterClient(); void DispatchMessage(const T &message);