class NestEngineServerNRPClient¶
Overview¶
NRP - Nest Communicator on the NRP side. Converts DataPackInterface classes from/to JSON objects. More…
#include <nest_engine_server_nrp_client.h> class NestEngineServerNRPClient: public EngineClient { public: // typedefs typedef std::map<std::string, std::string> population_mapping_t; typedef std::map<std::string, std::pair<std::string, std::string>> get_connection_population_mapping_t; // construction NestEngineServerNRPClient( nlohmann::json& config, ProcessLauncherInterface::unique_ptr&& launcher ); // methods virtual void initialize(); virtual void reset(); virtual void shutdown(); virtual SimulationTime runLoopStepCallback(SimulationTime timeStep); virtual void sendDataPacksToEngine(const datapacks_set_t& dataPacks); virtual const std::vector<std::string> engineProcStartParams() const; virtual datapacks_vector_t getDataPacksFromEngine(const datapack_identifiers_set_t& datapackIdentifiers); };
Inherited Members¶
public: // typedefs typedef std::shared_ptr<T> shared_ptr; typedef std::shared_ptr<const T> const_shared_ptr; typedef std::unique_ptr<T> unique_ptr; typedef std::unique_ptr<const T> const_unique_ptr; typedef ENGINE engine_t; // classes template <const char* ENGINE_TYPE> class EngineLauncher; // methods virtual const std::string engineName() const = 0; virtual const nlohmann::json& engineConfig() const = 0; virtual nlohmann::json& engineConfig() = 0; virtual const std::vector<std::string> engineProcStartParams() const = 0; virtual pid_t launchEngine(); virtual void initialize() = 0; virtual void reset() = 0; virtual void shutdown() = 0; virtual SimulationTime getEngineTimestep() const = 0; virtual SimulationTime getEngineTime() const = 0; virtual const std::string engineSchema() const = 0; virtual void runLoopStepAsync(SimulationTime timeStep) = 0; virtual void runLoopStepAsyncGet(SimulationTime timeOut) = 0; virtual void sendDataPacksToEngine(const datapacks_set_t& dataPacks) = 0; virtual datapacks_vector_t getDataPacksFromEngine(const datapack_identifiers_set_t& datapackIdentifiers) = 0; virtual const std::string engineName() const; virtual SimulationTime getEngineTimestep() const; virtual const nlohmann::json& engineConfig() const; virtual nlohmann::json& engineConfig(); virtual const std::string engineSchema() const; virtual SimulationTime getEngineTime() const; virtual void runLoopStepAsync(SimulationTime timeStep); virtual void runLoopStepAsyncGet(SimulationTime timeOut);
Detailed Documentation¶
NRP - Nest Communicator on the NRP side. Converts DataPackInterface classes from/to JSON objects.
Methods¶
virtual void initialize()
Initialize engine.
Parameters:
Throws |
on error |
Returns:
Returns SUCCESS if no error was encountered
virtual void reset()
Reset engine.
Parameters:
Throws |
on error |
Returns:
Returns SUCCESS if no error was encountered
virtual void shutdown()
Shutdown engine.
Parameters:
Throws |
on error |
Returns:
Return SUCCESS if no error was encountered
virtual SimulationTime runLoopStepCallback(SimulationTime timeStep)
Executes a single loop step.
This function is going to be called by runLoopStep using std::async. It will be executed by a worker thread, which allows for runLoopStepFunction from multiple engines to run simultaneously.
Parameters:
timeStep |
A time step by which the simulation should be advanced |
Returns:
Engine time after loop step execution
virtual void sendDataPacksToEngine(const datapacks_set_t& dataPacks)
Sends datapacks to engine.
Parameters:
datapacksArray |
Array of datapacks that will be send to the engine |
Throws |
on error |
Returns:
Returns SUCCESS if all datapacks could be handles, ERROR otherwise
virtual const std::vector<std::string> engineProcStartParams() const
Get all Engine Process Startup parameters.
virtual datapacks_vector_t getDataPacksFromEngine(const datapack_identifiers_set_t& datapackIdentifiers)
Gets requested datapacks from engine.
Parameters:
datapackNames |
All requested datapack ids |
Throws |
on error |
Returns:
Returns all requested datapacks