#ifndef SERVER_H
|
#define SERVER_H
|
|
#include <vector>
|
#include <thread>
|
#include <memory>
|
#include <dlfcn.h>
|
#include <atomic>
|
#include <glog/logging.h>
|
#include "IPC.h"
|
#include "PluginInterface.h"
|
#include "Config.h"
|
|
|
class Server {
|
public:
|
Server();
|
~Server();
|
void run();
|
void reloadConfig();
|
|
static Server& getInstance();
|
|
private:
|
void loadPlugins();
|
void mainLoop();
|
void handleIPC();
|
static void handleSignal(int signal);
|
|
std::vector<std::thread> threadPool; // Use std::thread directly
|
std::vector<void*> pluginHandles;
|
std::vector<std::shared_ptr<IPlugin>> plugins;
|
std::unique_ptr<IPC> ipc;
|
Config config;
|
std::atomic<bool> reloadConfigFlag;
|
|
static Server* instance;
|
};
|
|
#endif // SERVER_H
|