1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #ifndef CMAJOR_BUILD_SERVER_COMMAND_INCLUDED
 7 #define CMAJOR_BUILD_SERVER_COMMAND_INCLUDED
 8 #include <cmajor/build/BuildApi.hpp>
 9 #include <memory>
10 #include <string>
11 
12 namespace cmajor { namespace build {
13 
14 class ServerCommand 
15 {
16 public:
17     ServerCommand();
18     virtual ~ServerCommand();
19     virtual void Execute() = 0;
20 };
21 
22 class AddServerServerCommand public ServerCommand
23 {
24 public:
25     AddServerServerCommand(const std::string& serverName_int port_);
26     void Execute() override;
27 private:
28     std::string serverName;
29     int port;
30 };
31 
32 class RemoveServerServerCommand public ServerCommand
33 {
34 public:
35     RemoveServerServerCommand(const std::string& serverName_);
36     void Execute() override;
37 private:
38     std::string serverName;
39 };
40 
41 class RunServerServerCommand public ServerCommand
42 {
43 public:
44     RunServerServerCommand(const std::string& serverName_);
45     void Execute() override;
46 private:
47     std::string serverName;
48 };
49 
50 class ShowConfigurationServerCommand public ServerCommand
51 {
52 public:
53     ShowConfigurationServerCommand();
54     void Execute() override;
55 };
56 
57 std::unique_ptr<ServerCommand> ParseServerCommand(const std::string& command);
58 
59 } } // namespace cmajor::build;
60 
61 #endif // CMAJOR_BUILD_SERVER_COMMAND_INCLUDED