.. index:: pair: class; BasicFork .. _doxid-class_basic_fork: class BasicFork =============== .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class BasicFork: public :ref:`LaunchCommand` { public: // methods virtual pid_t :ref:`launchProcess`( const :ref:`nlohmann::json`& launcherConfig, const std::string& procCmd, const std::vector& envParams, const std::vector& startParams, bool appendParentEnv = true, int logFD = -1 ); virtual pid_t :ref:`stopProcess`(unsigned int killWait); virtual :ref:`ENGINE_RUNNING_STATUS` :ref:`getProcessStatus`(); }; 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`; // enums enum :ref:`ENGINE_RUNNING_STATUS`; // fields static constexpr auto :ref:`LaunchType` = :ref:`LAUNCH_COMMAND`; // methods virtual pid_t :ref:`launchProcess`( const :ref:`nlohmann::json`& launcherConfig, const std::string& procCmd, const std::vector& envParams, const std::vector& startParams, bool appendParentEnv = true, int logFD = -1 ) = 0; virtual pid_t :ref:`stopProcess`(unsigned int killWait) = 0; virtual :ref:`ENGINE_RUNNING_STATUS` :ref:`getProcessStatus`(); virtual std::string_view :ref:`launchType`() const = 0; virtual std::string_view :ref:`launchType`() const; .. _details-class_basic_fork: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; launchProcess .. _doxid-class_basic_fork_1acbf68d0d2ec4a2156251409d821009ba: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual pid_t launchProcess( const :ref:`nlohmann::json`& launcherConfig, const std::string& procCmd, const std::vector& envParams, const std::vector& startParams, bool appendParentEnv = true, int logFD = -1 ) Fork a new process for the given engine. Will read environment variables and start params from engineConfig The function should take the environment parameters and start parameters defined in engineConfig, and append any additional strings defined in envParams and startParams before starting the Engine specified in engineConfig. If appendParentEnv is set to true, use the parent environment in the forked child. If set to false, scrub the environment before continuing. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - launcherConfig - Configuration specific to the launch command * - procCmd - Process command * - envParams - Additional Environment Variables for Engine process. Will take precedence over default env params if appendParentEnv is true * - startParams - Additional Start parameters * - appendParentEnv - Should parent env variables be appended to Engine process .. rubric:: Returns: Returns PID of child process on success .. index:: pair: function; stopProcess .. _doxid-class_basic_fork_1aae277dcdfb3c8744fb0bdb22877573f2: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual pid_t stopProcess(unsigned int killWait) Stop a running engine process. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - killWait - Time (in seconds) to wait for process to quit by itself before force killing it. 0 means it will wait indefinetly .. rubric:: Returns: Returns 0 on success, negative value on error .. index:: pair: function; getProcessStatus .. _doxid-class_basic_fork_1a32b88a5458bad8e180972f2f664b6838: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`ENGINE_RUNNING_STATUS` getProcessStatus() Get the current engine process status. If status cannot be retrieved, return ENGINE_RUNNING_STATUS::UNKNOWN. .. rubric:: Returns: Returns status as enum :ref:`ProcessLauncherInterface::ENGINE_RUNNING_STATUS `