blob: 67602b0650c20c8905652830b81f40fe6ca84784 [file] [log] [blame]
Eddie James21b177e2018-12-11 13:14:46 -06001#pragma once
2
3#include "ikvm_args.hpp"
4#include "ikvm_input.hpp"
5#include "ikvm_video.hpp"
6
7namespace ikvm
8{
9
10/*
11 * @class Server
12 * @brief Manages the RFB server connection and updates
13 */
14class Server
15{
16 public:
17 /*
18 * @struct ClientData
19 * @brief Store necessary data for each connected RFB client
20 */
21 struct ClientData
22 {
23 /*
24 * @brief Constructs ClientData object
25 *
26 * @param[in] s - Number of frames to skip when client connects
27 * @param[in] i - Pointer to Input object
28 */
29 ClientData(int s, Input* i) : skipFrame(s), input(i)
30 {
31 }
32 ~ClientData() = default;
33 ClientData(const ClientData&) = default;
34 ClientData& operator=(const ClientData&) = default;
35 ClientData(ClientData&&) = default;
36 ClientData& operator=(ClientData&&) = default;
37
38 int skipFrame;
39 Input* input;
40 };
41
42 /*
43 * @brief Constructs Server object
44 *
45 * @param[in] args - Reference to Args object
46 * @param[in] i - Reference to Input object
47 * @param[in] v - Reference to Video object
48 */
49 Server(const Args& args, Input& i, Video& v);
50 ~Server();
51 Server(const Server&) = default;
52 Server& operator=(const Server&) = default;
53 Server(Server&&) = default;
54 Server& operator=(Server&&) = default;
55
56 /*
57 * @brief Get the Video object
58 *
59 * @return Reference to the Video object
60 */
61 inline const Video& getVideo() const
62 {
63 return video;
64 }
65
66 private:
67 /* @brief Reference to the Input object */
68 Input& input;
69 /* @brief Reference to the Video object */
70 Video& video;
71};
72
73} // namespace ikvm