From c9fa963e71258c5adfb71cf1996cd1bcb33df0bb Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 26 Feb 2023 08:54:17 +0100 Subject: Start with copy of whiteboard --- whiteboard.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 whiteboard.h (limited to 'whiteboard.h') diff --git a/whiteboard.h b/whiteboard.h new file mode 100644 index 0000000..53036ac --- /dev/null +++ b/whiteboard.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include +#include + +#include + +#include "diff.h" +#include "config.h" +#include "connectionregistry.h" +#include "storage.h" + +class Whiteboard +{ +public: + Whiteboard(); + int run(int argc, char* argv[]); + +private: + std::unique_ptr m_config; + std::unique_ptr m_storage; + std::mutex m_storage_mutex; + + ConnectionRegistry m_registry; + + std::unique_ptr m_ioc; + std::unique_ptr m_acceptor; + + void do_accept(); + void on_accept(boost::system::error_code ec, boost::asio::ip::tcp::socket socket); + void touch_all_connections(); +}; + -- cgit v1.2.3