.. index:: pair: class; EngineClientInterface .. _doxid-class_engine_client_interface: class EngineClientInterface =========================== .. toctree:: :hidden: Overview ~~~~~~~~ Interface to engines. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class EngineClientInterface: public :ref:`PtrTemplates` { public: // construction :target:`EngineClientInterface`(:ref:`ProcessLauncherInterface::unique_ptr`&& launcher); // methods virtual const std::string :ref:`engineName`() const = 0; virtual const :ref:`nlohmann::json`& :ref:`engineConfig`() const = 0; virtual :ref:`nlohmann::json`& :ref:`engineConfig`() = 0; virtual const std::vector :ref:`engineProcStartParams`() const = 0; virtual pid_t :ref:`launchEngine`(); virtual void :ref:`initialize`() = 0; virtual void :ref:`reset`() = 0; virtual void :ref:`shutdown`() = 0; virtual :ref:`SimulationTime` :ref:`getEngineTimestep`() const = 0; virtual :ref:`SimulationTime` :ref:`getEngineTime`() const = 0; virtual const std::string :ref:`engineSchema`() const = 0; virtual void :ref:`runLoopStepAsync`(:ref:`SimulationTime` timeStep) = 0; virtual void :ref:`runLoopStepAsyncGet`(:ref:`SimulationTime` timeOut) = 0; virtual void :ref:`sendDataPacksToEngine`(const :ref:`datapacks_set_t`& dataPacks) = 0; virtual :ref:`datapacks_vector_t` :ref:`getDataPacksFromEngine`(const :ref:`datapack_identifiers_set_t`& datapackIdentifiers) = 0; }; // direct descendants template class :ref:`EngineClient`; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // typedefs typedef std::shared_ptr :ref:`shared_ptr`; typedef std::shared_ptr :ref:`const_shared_ptr`; typedef std::unique_ptr :ref:`unique_ptr`; typedef std::unique_ptr :ref:`const_unique_ptr`; .. _details-class_engine_client_interface: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Interface to engines. Methods ------- .. index:: pair: function; engineName .. _doxid-class_engine_client_interface_1abb12cc28100d5fb2baddbad92d0293f6: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const std::string engineName() const = 0 Get Engine Name. .. rubric:: Returns: Returns engine name .. index:: pair: function; engineConfig .. _doxid-class_engine_client_interface_1a176fcd0c5de87a149574999c53461ac2: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const :ref:`nlohmann::json`& engineConfig() const = 0 Get engine config data. .. index:: pair: function; engineConfig .. _doxid-class_engine_client_interface_1a450994aebcb9dda0252d08d14fbde89a: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`nlohmann::json`& engineConfig() = 0 Get engine config data. .. index:: pair: function; engineProcStartParams .. _doxid-class_engine_client_interface_1a6747137f2b551040adca807e6df38a59: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const std::vector engineProcStartParams() const = 0 Get all Engine Process Startup parameters. .. index:: pair: function; launchEngine .. _doxid-class_engine_client_interface_1a42dd02dc80abcc1f48dccf9da0ce2f0c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual pid_t launchEngine() Launch the engine. .. rubric:: Returns: Returns engine process ID on success, throws on failure .. index:: pair: function; initialize .. _doxid-class_engine_client_interface_1ac600fd036f83cc1aa0ae8fa79b176b44: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void initialize() = 0 Initialize engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Throws - on error .. rubric:: Returns: Returns SUCCESS if no error was encountered .. index:: pair: function; reset .. _doxid-class_engine_client_interface_1a65d86ba09fd72e32b0399ca290c38632: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void reset() = 0 Reset engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Throws - on error .. rubric:: Returns: Returns SUCCESS if no error was encountered .. index:: pair: function; shutdown .. _doxid-class_engine_client_interface_1a0a15d1d539bc8134f8ed62668c284883: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void shutdown() = 0 Shutdown engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Throws - on error .. rubric:: Returns: Return SUCCESS if no error was encountered .. index:: pair: function; getEngineTimestep .. _doxid-class_engine_client_interface_1a292b03422ca28976dc3d70f90e11d4e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`SimulationTime` getEngineTimestep() const = 0 Get engine timestep. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Throws - on error .. index:: pair: function; getEngineTime .. _doxid-class_engine_client_interface_1ab3080a4a253a676d9be0205a3abe9224: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`SimulationTime` getEngineTime() const = 0 Get current engine time. .. rubric:: Returns: Returns engine time .. index:: pair: function; engineSchema .. _doxid-class_engine_client_interface_1a93fc42d5d932c15f856e3db395dac5d5: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const std::string engineSchema() const = 0 Get json schema for this specific engine type. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Throws - on error .. rubric:: Returns: Returns URI of engine schema .. index:: pair: function; runLoopStepAsync .. _doxid-class_engine_client_interface_1aabe6d06f4b2272422b782aef2ba7df4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void runLoopStepAsync(:ref:`SimulationTime` timeStep) = 0 Starts a single loop step in a separate thread. The function should be called in tandem with :ref:`EngineClientInterface::runLoopStepAsyncGet() `, which will join the worker thread and retrieve the results of the loop step. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - timeStep - Requested duration of the simulation loop step. .. index:: pair: function; runLoopStepAsyncGet .. _doxid-class_engine_client_interface_1af7df79c71a0b87597b1638b07384c4e9: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void runLoopStepAsyncGet(:ref:`SimulationTime` timeOut) = 0 Waits and gets the results of the loop step started by :ref:`EngineClientInterface::runLoopStepAsync() ` The function should be called after calling :ref:`EngineClientInterface::runLoopStepAsync() `. It should join the worker thread and retrieve the results of the loop step. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - timeOut - Timeout of the loop step. If it's less or equal to 0, the function will wait indefinitely. .. index:: pair: function; sendDataPacksToEngine .. _doxid-class_engine_client_interface_1af27e2651c84893b47966ec72715e287b: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void sendDataPacksToEngine(const :ref:`datapacks_set_t`& dataPacks) = 0 Sends datapacks to engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - datapacksArray - Array of datapacks that will be send to the engine * - Throws - on error .. rubric:: Returns: Returns SUCCESS if all datapacks could be handles, ERROR otherwise .. index:: pair: function; getDataPacksFromEngine .. _doxid-class_engine_client_interface_1a866fdbecf9d82b1315561c985d0cddf5: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`datapacks_vector_t` getDataPacksFromEngine(const :ref:`datapack_identifiers_set_t`& datapackIdentifiers) = 0 Gets requested datapacks from engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - datapackNames - All requested datapack ids * - Throws - on error .. rubric:: Returns: Returns all requested datapacks