diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2023-08-17 12:32:50 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2023-08-17 12:32:50 +0200 |
| commit | 375799fa79d1af76f33299acc20a11a167a021f8 (patch) | |
| tree | 8f91b982ec96225c33a2f4871730ababffe5cab0 /source/lib/include/wanda/commander.hpp | |
| parent | af471b9b780869915d3217b228e24d025892de47 (diff) | |
| download | wanda-375799fa79d1af76f33299acc20a11a167a021f8.tar.xz wanda-375799fa79d1af76f33299acc20a11a167a021f8.zip | |
project: restructure libraries and build env
Diffstat (limited to 'source/lib/include/wanda/commander.hpp')
| -rw-r--r-- | source/lib/include/wanda/commander.hpp | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/source/lib/include/wanda/commander.hpp b/source/lib/include/wanda/commander.hpp deleted file mode 100644 index 52fbbb8..0000000 --- a/source/lib/include/wanda/commander.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef WANDA_COMMANDER_HPP -#define WANDA_COMMANDER_HPP - -#include "wanda/command.hpp" -#include "wanda/control_connection.hpp" -#include "wanda/message.hpp" - -#include <asio.hpp> - -#include <filesystem> -#include <memory> -#include <optional> -#include <string> -#include <vector> - -namespace wanda -{ - /** - * @brief The remote control client - * - */ - struct commander : wanda::control_connection::listener - { - /** - * @brief The interface to be implemented by remote control listeners - */ - struct listener - { - virtual void on_connected(commander & commander){}; - virtual void on_response(commander & commander, std::string response){}; - virtual void on_error(commander & commander, std::string error){}; - }; - - /** - * @brief Construct a new commander - */ - commander(asio::io_service & service, std::filesystem::path socket, listener & listener); - - /** - * @brief Start communication with the remote daemon endpoint - */ - void start(); - - /** - * @brief Stop communication with the remote daemon endpoint - */ - void stop(); - - /** - * @brief Send a command to the remote daemon endpoint - */ - void send(command command); - - void on_error(control_connection::pointer connection, std::error_code error) override; - void on_received(control_connection::pointer connection, message message) override; - - private: - asio::io_service & m_service; - wanda::control_connection::protocol::endpoint m_endpoint; - wanda::control_connection::protocol::socket m_socket; - wanda::control_connection::pointer m_connection; - listener & m_listener; - }; - -} // namespace wanda -#endif
\ No newline at end of file |
