1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #ifndef CMAJOR_BUILD_LOCAL_EXECUTION_CONTEXT_INCLUDED
 7 #define CMAJOR_BUILD_LOCAL_EXECUTION_CONTEXT_INCLUDED
 8 #include <cmajor/build/ExecutionContext.hpp>
 9 #include <cmajor/build/SocketServer.hpp>
10 #include <cmajor/build/SocketClient.hpp>
11 #include <thread>
12 
13 namespace cmajor { namespace build {
14 
15 class LocalExecutionContext public ExecutionContext
16 {
17 public:
18     LocalExecutionContext();
19     ~LocalExecutionContext();
20     BuildClient* GetClient() override;
21     Connection* GetConnection() override;
22 private:
23     std::thread serverThread;
24     std::unique_ptr<SocketServer> socketServer;
25     std::unique_ptr<SocketClient> socketClient;
26 };
27 
28 } } // namespace cmajor::build
29 
30 #endif // CMAJOR_BUILD_LOCAL_EXECUTION_CONTEXT_INCLUDED