Files
SimControl/include/SimControl/SimControl.hpp

72 lines
1.2 KiB
C++

#ifndef __SIMCONTROL__
#define __SIMCONTROL__
#include "DirectCommunicationClient.hpp"
#include "DirectCommunicationServer.hpp"
#include "SimCore/Identifier.hpp"
#include "crossguid/guid.hpp"
#include "kubecontrol/PodController.hpp"
#include <iostream>
#include <atomic>
#include <cstdint>
#include <memory>
#include <string>
#include <sys/types.h>
#include <thread>
#include <mutex>
#include <queue>
namespace SimControl {
class SimControl{
public:
SimControl(std::string CommandPort);
~SimControl();
void stop();
private:
const SimCore::Identifier ID_;
std::string CommandPort_;
void MainFunction_();
void HandleMessage(std::string msg);
void HandleExternalMessage(std::string msg);
void startShip(std::string name);
std::unique_ptr<kubecontrol::PodController> PodController_;
std::thread MainThread_;
std::atomic<bool> stopMainThread_ = false;
std::shared_ptr<DirectCommunication::DirectCommunicationClient> TCPClient_ = nullptr;
std::shared_ptr<DirectCommunication::DirectCommunicationServer> ExternalTCPServer_ = nullptr;
};
}
#endif