NRP Core  1.4.1
NestEngineServerNRPClient Class Reference

NRP - Nest Communicator on the NRP side. Converts DataPackInterface classes from/to JSON objects. More...

#include <nest_engine_server_nrp_client.h>

Inheritance diagram for NestEngineServerNRPClient:
EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema > EngineClientInterface PtrTemplates< EngineClientInterface >

Public Types

using population_mapping_t = std::map< std::string, std::string >
 
using get_connection_population_mapping_t = std::map< std::string, std::pair< std::string, std::string > >
 
- Public Types inherited from EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >
using engine_t = NestEngineServerNRPClient
 
- Public Types inherited from PtrTemplates< EngineClientInterface >
using shared_ptr = std::shared_ptr< EngineClientInterface >
 
using const_shared_ptr = std::shared_ptr< const EngineClientInterface >
 
using unique_ptr = std::unique_ptr< EngineClientInterface >
 
using const_unique_ptr = std::unique_ptr< const EngineClientInterface >
 

Public Member Functions

 NestEngineServerNRPClient (nlohmann::json &config, ProcessLauncherInterface::unique_ptr &&launcher)
 
virtual ~NestEngineServerNRPClient () override
 
virtual void initialize () override
 Initialize engine. More...
 
virtual void reset () override
 Reset engine. More...
 
virtual void shutdown () override
 Shutdown engine. More...
 
SimulationTime runLoopStepCallback (SimulationTime timeStep) override
 Executes a single loop step. More...
 
virtual void sendDataPacksToEngine (const datapacks_set_t &datapacksArray) override
 Sends datapacks to engine. More...
 
virtual const std::vector< std::string > engineProcStartParams () const override
 Get all Engine Process Startup parameters. More...
 
virtual datapacks_vector_t getDataPacksFromEngine (const datapack_identifiers_set_t &datapackIdentifiers) override
 Gets requested datapacks from engine. More...
 
- Public Member Functions inherited from EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >
 EngineClient (nlohmann::json &engineConfig, ProcessLauncherInterface::unique_ptr &&launcher)
 Constructor. More...
 
 ~EngineClient () override=default
 
const std::string engineName () const override final
 Get Engine Name. More...
 
SimulationTime getEngineTimestep () const override final
 Get engine timestep. More...
 
const nlohmann::jsonengineConfig () const override final
 Get Engine Configuration. More...
 
nlohmann::jsonengineConfig () override final
 Get Engine Configuration. More...
 
const std::string engineSchema () const override final
 Get json schema for this engine type. More...
 
SimulationTime getEngineTime () const override
 Returns current engine (simulation) time. More...
 
void runLoopStepAsync (SimulationTime timeStep) override
 Concrete implementation of EngineClientInterface::runLoopStepAsync() More...
 
void runLoopStepAsyncGet (SimulationTime timeOut) override
 Concrete implementation of EngineClientInterface::runLoopStepAsyncGet() More...
 
- Public Member Functions inherited from EngineClientInterface
 EngineClientInterface (ProcessLauncherInterface::unique_ptr &&launcher)
 
virtual ~EngineClientInterface ()
 
virtual const std::string engineName () const =0
 Get Engine Name. More...
 
virtual const nlohmann::jsonengineConfig () const =0
 Get engine config data. More...
 
virtual pid_t launchEngine ()
 Launch the engine. More...
 
virtual SimulationTime getEngineTimestep () const =0
 Get engine timestep. More...
 
virtual SimulationTime getEngineTime () const =0
 Get current engine time. More...
 
virtual const std::string engineSchema () const =0
 Get json schema for this specific engine type. More...
 

Additional Inherited Members

- Protected Member Functions inherited from EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >
virtual void resetEngineTime ()
 
void setDefaultProperty (std::string key, T value)
 Attempts to set a default value for a property in the engine configuration. If the property has been already set either in the engine configuration file or from the engine schema, its value is not overwritten. More...
 
- Protected Attributes inherited from EngineClientInterface
ProcessLauncherInterface::unique_ptr _process
 Process Launcher. Will be used to stop process at end. More...
 

Detailed Description

NRP - Nest Communicator on the NRP side. Converts DataPackInterface classes from/to JSON objects.

Member Typedef Documentation

◆ get_connection_population_mapping_t

using NestEngineServerNRPClient::get_connection_population_mapping_t = std::map<std::string, std::pair<std::string,std::string> >

◆ population_mapping_t

using NestEngineServerNRPClient::population_mapping_t = std::map<std::string, std::string>

Constructor & Destructor Documentation

◆ NestEngineServerNRPClient()

NestEngineServerNRPClient::NestEngineServerNRPClient ( nlohmann::json config,
ProcessLauncherInterface::unique_ptr &&  launcher 
)

◆ ~NestEngineServerNRPClient()

NestEngineServerNRPClient::~NestEngineServerNRPClient ( )
overridevirtual

Member Function Documentation

◆ engineProcStartParams()

const std::vector< std::string > NestEngineServerNRPClient::engineProcStartParams ( ) const
overridevirtual

Get all Engine Process Startup parameters.

Implements EngineClientInterface.

◆ getDataPacksFromEngine()

datapacks_vector_t NestEngineServerNRPClient::getDataPacksFromEngine ( const datapack_identifiers_set_t datapackIdentifiers)
overridevirtual

Gets requested datapacks from engine.

Parameters
datapackNamesAll requested datapack ids
Returns
Returns all requested datapacks
Exceptions
Throwson error

Implements EngineClientInterface.

◆ initialize()

void NestEngineServerNRPClient::initialize ( )
overridevirtual

Initialize engine.

Returns
Returns SUCCESS if no error was encountered
Exceptions
Throwson error

Implements EngineClientInterface.

◆ reset()

void NestEngineServerNRPClient::reset ( )
overridevirtual

Reset engine.

Returns
Returns SUCCESS if no error was encountered
Exceptions
Throwson error

Implements EngineClientInterface.

◆ runLoopStepCallback()

SimulationTime NestEngineServerNRPClient::runLoopStepCallback ( SimulationTime  timeStep)
overridevirtual

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
[in]timeStepA time step by which the simulation should be advanced
Returns
Engine time after loop step execution

Implements EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >.

◆ sendDataPacksToEngine()

void NestEngineServerNRPClient::sendDataPacksToEngine ( const datapacks_set_t dataPacks)
overridevirtual

Sends datapacks to engine.

Parameters
datapacksArrayArray of datapacks that will be send to the engine
Returns
Returns SUCCESS if all datapacks could be handles, ERROR otherwise
Exceptions
Throwson error

Implements EngineClientInterface.

◆ shutdown()

void NestEngineServerNRPClient::shutdown ( )
overridevirtual

Shutdown engine.

Returns
Return SUCCESS if no error was encountered
Exceptions
Throwson error

Implements EngineClientInterface.


The documentation for this class was generated from the following files: