NRP Core  1.4.1
PythonEngineGRPCNRPClient Class Reference

PythonGRPCEngine client. More...

#include <python_engine_grpc_nrp_client.h>

Inheritance diagram for PythonEngineGRPCNRPClient:
EngineGrpcClient< PythonEngineGRPCNRPClient, PythonGrpcConfigConst::EngineSchema > EngineClient< PythonEngineGRPCNRPClient, SCHEMA > EngineClientInterface PtrTemplates< EngineClientInterface >

Public Member Functions

 PythonEngineGRPCNRPClient (nlohmann::json &config, ProcessLauncherInterface::unique_ptr &&launcher)
 
virtual ~PythonEngineGRPCNRPClient () override
 
virtual void initialize () override
 Initialize engine. More...
 
virtual void reset () override
 Reset engine. More...
 
virtual void shutdown () override
 Shutdown engine. More...
 
virtual const std::vector< std::string > engineProcStartParams () const override
 Get all Engine Process Startup parameters. More...
 
- Public Member Functions inherited from EngineGrpcClient< PythonEngineGRPCNRPClient, PythonGrpcConfigConst::EngineSchema >
 EngineGrpcClient (nlohmann::json &config, ProcessLauncherInterface::unique_ptr &&launcher)
 
virtual pid_t launchEngine () override
 Launch the engine. More...
 
void connectToServer ()
 
void sendInitializeCommand (const nlohmann::json &data)
 
void sendResetCommand ()
 
void sendShutdownCommand (const nlohmann::json &data)
 
SimulationTime runLoopStepCallback (const SimulationTime timeStep) override
 Executes a single loop step. More...
 
virtual datapacks_vector_t getDataPacksFromEngine (const datapack_identifiers_set_t &requestedDataPackIds) override
 Gets requested datapacks from engine. More...
 
virtual void sendDataPacksToEngine (const datapacks_set_t &dataPacks) override
 Sends datapacks to engine. More...
 
virtual const std::vector< std::string > engineProcStartParams () const override
 Get all Engine Process Startup parameters. More...
 
std::string tryBind (const std::string &address)
 
void validateServerAddress ()
 Validates if server address is already in use. More...
 
const std::string serverAddress () const
 Returns the address used by the gRPC server. More...
 
- Public Member Functions inherited from EngineClient< PythonEngineGRPCNRPClient, SCHEMA >
 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 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

- Public Types inherited from EngineClient< PythonEngineGRPCNRPClient, SCHEMA >
using engine_t = PythonEngineGRPCNRPClient
 
- 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 >
 
- Protected Member Functions inherited from EngineGrpcClient< PythonEngineGRPCNRPClient, PythonGrpcConfigConst::EngineSchema >
void resetEngineTime () override
 
- Protected Member Functions inherited from EngineClient< PythonEngineGRPCNRPClient, SCHEMA >
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

PythonGRPCEngine client.

Constructor & Destructor Documentation

◆ PythonEngineGRPCNRPClient()

PythonEngineGRPCNRPClient::PythonEngineGRPCNRPClient ( nlohmann::json config,
ProcessLauncherInterface::unique_ptr &&  launcher 
)
inline

◆ ~PythonEngineGRPCNRPClient()

virtual PythonEngineGRPCNRPClient::~PythonEngineGRPCNRPClient ( )
inlineoverridevirtual

Member Function Documentation

◆ engineProcStartParams()

virtual const std::vector<std::string> PythonEngineGRPCNRPClient::engineProcStartParams ( ) const
inlineoverridevirtual

Get all Engine Process Startup parameters.

Implements EngineClientInterface.

◆ initialize()

virtual void PythonEngineGRPCNRPClient::initialize ( )
inlineoverridevirtual

Initialize engine.

Returns
Returns SUCCESS if no error was encountered
Exceptions
Throwson error

Implements EngineClientInterface.

◆ reset()

virtual void PythonEngineGRPCNRPClient::reset ( )
inlineoverridevirtual

Reset engine.

Returns
Returns SUCCESS if no error was encountered
Exceptions
Throwson error

Implements EngineClientInterface.

◆ shutdown()

virtual void PythonEngineGRPCNRPClient::shutdown ( )
inlineoverridevirtual

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 file: