NRP Core  1.4.1
nest_engine_json_nrp_client.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 NEST_ENGINE_JSON_NRP_CLIENT_H
23 #define NEST_ENGINE_JSON_NRP_CLIENT_H
24 
28 
30 
31 #include "nrp_general_library/config/cmake_constants.h"
32 
33 #include <unistd.h>
34 
39 : public EngineJSONNRPClient<NestEngineJSONNRPClient, NestConfigConst::EngineSchema>
40 {
44  static constexpr size_t _killWait = 10;
45 
46  public:
48  virtual ~NestEngineJSONNRPClient() override;
49 
50  virtual void initialize() override;
51 
52  virtual void reset() override;
53 
54  virtual void shutdown() override;
55 
56  private:
60  std::string _initErrMsg = "";
61 };
62 
63 using NestEngineJSONLauncher = NestEngineJSONNRPClient::EngineLauncher<NestConfigConst::EngineType>;
64 
65 
67 
68 
69 #endif // NEST_ENGINE_JSON_NRP_CLIENT_H
PtrTemplates< ProcessLauncherInterface >::unique_ptr
std::unique_ptr< ProcessLauncherInterface > unique_ptr
Definition: ptr_templates.h:34
engine_json_nrp_client.h
EngineJSONNRPClient
NRP - Gazebo Communicator on the NRP side. Converts DataPackInterface classes from/to JSON objects.
Definition: engine_json_nrp_client.h:45
plugin.h
engine_client_interface.h
CREATE_NRP_ENGINE_LAUNCHER
CREATE_NRP_ENGINE_LAUNCHER(NestEngineJSONLauncher)
NestEngineJSONNRPClient::shutdown
virtual void shutdown() override
Shutdown engine.
Definition: nest_engine_json_nrp_client.cpp:81
nest_config.h
NestEngineJSONNRPClient
NRP - Nest Communicator on the NRP side. Converts DataPackInterface classes from/to JSON objects.
Definition: nest_engine_json_nrp_client.h:38
NestEngineJSONNRPClient::initialize
virtual void initialize() override
Initialize engine.
Definition: nest_engine_json_nrp_client.cpp:44
NestEngineJSONNRPClient::NestEngineJSONNRPClient
NestEngineJSONNRPClient(nlohmann::json &config, ProcessLauncherInterface::unique_ptr &&launcher)
Definition: nest_engine_json_nrp_client.cpp:33
NestEngineJSONNRPClient::~NestEngineJSONNRPClient
virtual ~NestEngineJSONNRPClient() override
Definition: nest_engine_json_nrp_client.cpp:41
NestEngineJSONLauncher
NestEngineJSONNRPClient::EngineLauncher< NestConfigConst::EngineType > NestEngineJSONLauncher
Definition: nest_engine_json_nrp_client.h:63
NestEngineJSONNRPClient::reset
virtual void reset() override
Reset engine.
Definition: nest_engine_json_nrp_client.cpp:61
json
nlohmann::json json
Definition: engine_json_server.cpp:31