mainapp.h
716 Bytes
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
36
37
#ifndef MAINAPP_H
#define MAINAPP_H
#include <iostream>
#include <sys/socket.h>
#include <stdexcept>
#include <netinet/in.h>
#include <fcntl.h>
#include <thread>
#include <vector>
#include "forward_declarations.h"
#include "utils.h"
#include "threaddata.h"
#include "client.h"
#include "mqttpacket.h"
#include "subscriptionstore.h"
class MainApp
{
static MainApp *instance;
bool running = true;
std::vector<std::shared_ptr<ThreadData>> threads;
std::shared_ptr<SubscriptionStore> subscriptionStore;
MainApp();
public:
MainApp(const MainApp &rhs) = delete;
MainApp(MainApp &&rhs) = delete;
static MainApp *getMainApp();
void start();
void quit();
};
#endif // MAINAPP_H