1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #ifndef CMAJOR_BUILD_SERVER_EXECUTION_CONTEXT_INCLUDED
 7 #define CMAJOR_BUILD_SERVER_EXECUTION_CONTEXT_INCLUDED
 8 #include <cmajor/build/ExecutionContext.hpp>
 9 #include <cmajor/build/SocketServer.hpp>
10 #include <thread>
11 
12 namespace cmajor { namespace build {
13 
14 class ServerExecutionContext public ExecutionContext
15 {
16 public:
17     ServerExecutionContext(const std::string& serverName);
18     ~ServerExecutionContext();
19     void ExitServer() override;
20 private:
21     std::thread serverThread;
22     std::unique_ptr<SocketServer> socketServer;
23 };
24 
25 } } // namespace cmajor::build
26 
27 #endif // CMAJOR_BUILD_SERVER_EXECUTION_CONTEXT_INCLUDED