diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2023-09-06 18:36:44 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2023-09-06 18:36:44 +0200 |
| commit | 17a3bb9337fd7e4a57354ed5359e449d5ab1388c (patch) | |
| tree | def6985c1f0c40456304f22e3b30aa17ca01e82b /source/lib/control/include | |
| parent | 426d5ca456d03058b37afaf180b5a57c6da53adc (diff) | |
| download | wanda-17a3bb9337fd7e4a57354ed5359e449d5ab1388c.tar.xz wanda-17a3bb9337fd7e4a57354ed5359e449d5ab1388c.zip | |
deps: switch from non-boost to boost asio
Diffstat (limited to 'source/lib/control/include')
3 files changed, 18 insertions, 14 deletions
diff --git a/source/lib/control/include/wanda/control/commander.hpp b/source/lib/control/include/wanda/control/commander.hpp index c993fc0..d7ca73d 100644 --- a/source/lib/control/include/wanda/control/commander.hpp +++ b/source/lib/control/include/wanda/control/commander.hpp @@ -5,7 +5,8 @@ #include "wanda/proto/command.hpp" #include "wanda/proto/message.hpp" -#include <asio.hpp> +#include <boost/asio/io_context.hpp> +#include <boost/asio/io_service.hpp> #include <filesystem> #include <memory> @@ -34,7 +35,7 @@ namespace wanda::control /** * @brief Construct a new commander */ - commander(asio::io_service & service, std::filesystem::path socket, listener & listener); + commander(boost::asio::io_context & service, std::filesystem::path socket, listener & listener); /** * @brief Start communication with the remote daemon endpoint @@ -55,7 +56,7 @@ namespace wanda::control void on_received(connection::pointer connection, proto::message message) override; private: - asio::io_service & m_service; + boost::asio::io_context & m_service; wanda::control::connection::protocol::endpoint m_endpoint; wanda::control::connection::protocol::socket m_socket; wanda::control::connection::pointer m_connection; diff --git a/source/lib/control/include/wanda/control/connection.hpp b/source/lib/control/include/wanda/control/connection.hpp index 1ca451d..0284fd7 100644 --- a/source/lib/control/include/wanda/control/connection.hpp +++ b/source/lib/control/include/wanda/control/connection.hpp @@ -4,7 +4,8 @@ #include "wanda/meta/keyed.hpp" #include "wanda/proto/message.hpp" -#include <asio.hpp> +#include <boost/asio/local/stream_protocol.hpp> +#include <boost/asio/streambuf.hpp> #include <istream> #include <memory> @@ -20,7 +21,7 @@ namespace wanda::control */ struct connection : meta::keyed<connection>, std::enable_shared_from_this<connection> { - using protocol = asio::local::stream_protocol; + using protocol = boost::asio::local::stream_protocol; using pointer = std::shared_ptr<connection>; /** @@ -47,7 +48,8 @@ namespace wanda::control * @internal * @brief Construct a new control connection object * - * @note This constructor is keyed on a private key type so it can only be constructed using the #wanda::make_connection factory + * @note This constructor is keyed on a private key type so it can only be constructed using the + * #wanda::make_connection factory */ connection(key, protocol::socket socket); @@ -96,8 +98,8 @@ namespace wanda::control void perform_read(); protocol::socket m_socket; - asio::streambuf m_in{}; - asio::streambuf m_out{}; + boost::asio::streambuf m_in{}; + boost::asio::streambuf m_out{}; std::istream m_input{&m_in}; std::ostream m_output{&m_out}; std::set<listener *> m_listeners{}; diff --git a/source/lib/control/include/wanda/control/interface.hpp b/source/lib/control/include/wanda/control/interface.hpp index 3dca85f..e895b68 100644 --- a/source/lib/control/include/wanda/control/interface.hpp +++ b/source/lib/control/include/wanda/control/interface.hpp @@ -11,7 +11,8 @@ #include "wanda/meta/keyed.hpp" #include "wanda/proto/command.hpp" -#include <asio.hpp> +#include <boost/asio/local/stream_protocol.hpp> +#include <boost/asio/io_context.hpp> #include <spdlog/spdlog.h> #include <cstddef> @@ -40,7 +41,7 @@ namespace wanda::control */ struct interface : connection::listener, meta::keyed<interface>, std::enable_shared_from_this<interface> { - using protocol = asio::local::stream_protocol; + using protocol = boost::asio::local::stream_protocol; using pointer = std::shared_ptr<interface>; /** @@ -57,7 +58,7 @@ namespace wanda::control * * @note This constructor is keyed on a private key type so it can only be constructed using the #wanda::make_interface factory */ - interface(key, asio::io_service & service, protocol::endpoint endpoint, listener & listener); + interface(key, boost::asio::io_context & service, protocol::endpoint endpoint, listener & listener); /** * @brief Start handling of controller connections @@ -75,9 +76,9 @@ namespace wanda::control private: void perform_accept(); - friend pointer make_interface(asio::io_service & service, std::filesystem::path file, interface::listener & listener); + friend pointer make_interface(boost::asio::io_context & service, std::filesystem::path file, interface::listener & listener); - asio::io_service & m_service; + boost::asio::io_context & m_service; protocol::endpoint m_endpoint; protocol::socket m_socket; protocol::acceptor m_acceptor; @@ -89,7 +90,7 @@ namespace wanda::control /** * @brief A factory to create new #interface instances */ - interface::pointer make_interface(asio::io_service & service, std::filesystem::path socket, interface::listener & listener); + interface::pointer make_interface(boost::asio::io_context & service, std::filesystem::path socket, interface::listener & listener); } // namespace wanda::control |
