blob: 15d764ae52a2d5ec395040a25b2eb0e10125a876 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#pragma once
#include <filesystem>
#include <memory>
#include <mutex>
#include <string>
#include <boost/asio/ip/tcp.hpp>
#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<Config> m_config;
std::unique_ptr<Storage> m_storage;
std::mutex m_storage_mutex;
std::mutex m_websocket_mutex;
ConnectionRegistry m_registry;
std::unique_ptr<boost::asio::io_context> m_ioc;
std::unique_ptr<boost::asio::ip::tcp::acceptor> m_acceptor;
void do_accept();
void on_accept(boost::system::error_code ec, boost::asio::ip::tcp::socket socket);
};
|