NRP Core  1.4.1
empty_launch_command.h
Go to the documentation of this file.
1 /* * NRP Core - Backend infrastructure to synchronize simulations
2  *
3  * Copyright 2020-2023 NRP Team
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * This project has received funding from the European Union’s Horizon 2020
18  * Framework Programme for Research and Innovation under the Specific Grant
19  * Agreement No. 945539 (Human Brain Project SGA3).
20  */
21 
22 #ifndef EMPTY_LAUNCH_H
23 #define EMPTY_LAUNCH_H
24 
25 #include "nrp_general_library/config/cmake_constants.h"
27 
32 inline const char EmptyLaunchC[] = "EmptyLaunchCommand";
33 
35  : public LaunchCommand<EmptyLaunchC>
36 {
37 
38  public:
39  ~EmptyLaunchCommand() = default;
40 
45  pid_t launchProcess(const nlohmann::json &, const std::string &, const std::vector<std::string> &, const std::vector<std::string> &, bool, int)
46  {
47  return -1;
48  }
49 
54  pid_t stopProcess(unsigned int) override
55  {
56  return 0;
57  }
58 
64  {
65  return ENGINE_RUNNING_STATUS::UNKNOWN;
66  }
67 
68 };
69 
70 #endif // EMPTY_LAUNCH_H
EmptyLaunchCommand::stopProcess
pid_t stopProcess(unsigned int) override
stopProcess always returns 0
Definition: empty_launch_command.h:54
EmptyLaunchCommand::getProcessStatus
ENGINE_RUNNING_STATUS getProcessStatus() override
getProcessStatus always returns ENGINE_RUNNING_STATUS::UNKNOWN
Definition: empty_launch_command.h:63
launch_command.h
EmptyLaunchCommand::~EmptyLaunchCommand
~EmptyLaunchCommand()=default
EmptyLaunchCommand::launchProcess
pid_t launchProcess(const nlohmann::json &, const std::string &, const std::vector< std::string > &, const std::vector< std::string > &, bool, int)
launchProcess always returns -1
Definition: empty_launch_command.h:45
LaunchCommand
Class for launch commands. Must be specialized further.
Definition: launch_command.h:93
EmptyLaunchC
const char EmptyLaunchC[]
Empty Launch Command. A "dummy" launcher that doesn't launch a process. Useful in the cases when the ...
Definition: empty_launch_command.h:32
EmptyLaunchCommand
Definition: empty_launch_command.h:34
LaunchCommandInterface::ENGINE_RUNNING_STATUS
ENGINE_RUNNING_STATUS
Engine Process status.
Definition: launch_command.h:39
json
nlohmann::json json
Definition: engine_json_server.cpp:31