#ifndef GERMANAIRLINESVA_GACONNECTOR_RECORDER_RECORDER_H #define GERMANAIRLINESVA_GACONNECTOR_RECORDER_RECORDER_H #include #include #include #include #include #include "constants.h" #include "websocket.h" #if defined(IBM) && not defined(XP) #include "_simconnect.h" #include #include #include #endif #include "config/config.hpp" #include "logbook/logbook.hpp" #include "recording/recording.hpp" #include "simdata/simDatabase.hpp" namespace germanairlinesva { namespace gaconnector { namespace recorder { class Recorder { private: std::function toLog; std::mutex mutex; std::thread serverThread; std::thread recordingThread; std::atomic wantsExit{false}; std::shared_ptr configuration; std::unique_ptr database; std::unique_ptr connector; websocket::data toSend; bool simSupported = false; std::queue> &messageQueue() { static std::queue> _messageQueue; return _messageQueue; } void serverWorker(); void recordingWorker(); // For Testing void test() const; public: Recorder(int simVersion, std::function toLog); ~Recorder(); void setData(websocket::data &data); void handleMessages(); std::shared_ptr getConfiguration() const; void loadDatabase(int simVersion); bool getSupportedState() const; }; } // namespace recorder } // namespace gaconnector } // namespace germanairlinesva #endif