class PythonEngineGRPCNRPClient

Overview

PythonGRPCEngine client. More…

#include <python_engine_grpc_nrp_client.h>

class PythonEngineGRPCNRPClient: public EngineGrpcClient {
public:
    // construction

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

    // methods

    virtual void initialize();
    virtual void reset();
    virtual void shutdown();
    virtual const std::vector<std::string> engineProcStartParams() const;
};

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);
    virtual pid_t launchEngine();
    void connectToServer();
    void sendInitializeCommand(const nlohmann::json& data);
    void sendResetCommand();
    void sendShutdownCommand(const nlohmann::json& data);
    virtual SimulationTime runLoopStepCallback(const SimulationTime timeStep);
    virtual datapacks_vector_t getDataPacksFromEngine(const datapack_identifiers_set_t& datapackIdentifiers);
    virtual void sendDataPacksToEngine(const datapacks_set_t& dataPacks);
    virtual const std::vector<std::string> engineProcStartParams() const;
    std::string tryBind(const std::string& address);
    void validateServerAddress();
    const std::string serverAddress() const;

Detailed Documentation

PythonGRPCEngine client.

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 const std::vector<std::string> engineProcStartParams() const

Get all Engine Process Startup parameters.