Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
proc::proc_t Class Reference

Tracks launched child processes and terminates them during shutdown. More...

#include <src/process.h>

Public Member Functions

int execute (int app_id, std::shared_ptr< rtsp_stream::launch_session_t > launch_session)
 Launch the configured application process.
std::string get_app_image (int app_id)
 Get app image.
std::vector< ctx_t > & get_apps ()
 Return the configured applications.
const std::vector< ctx_t > & get_apps () const
 Return the configured applications.
std::string get_last_run_app_name ()
 Get last run app name.
proc_t & operator= (proc_t &&)=default
 Defaulted move assignment for the generated type. * *.
 proc_t ()=default
 Default constructor for the generated type.
 proc_t (boost::process::v1::environment &&env, std::vector< ctx_t > &&apps)
 Construct a process manager.
 proc_t (proc_t &&)=default
 Defaulted move constructor for the generated type.
int running ()
void terminate ()
 Terminate the launched application process.
void update_apps_and_env (proc_t &&other)
 Update the cached app list and environment without disturbing running process state.

Detailed Description

Tracks launched child processes and terminates them during shutdown.

Constructor & Destructor Documentation

◆ proc_t() [1/3]

proc::proc_t::proc_t ( proc_t && )
default

Defaulted move constructor for the generated type.

◆ proc_t() [2/3]

proc::proc_t::proc_t ( )
default

Default constructor for the generated type.

◆ proc_t() [3/3]

proc::proc_t::proc_t ( boost::process::v1::environment && env,
std::vector< ctx_t > && apps )
inline

Construct a process manager.

Parameters
envEnvironment used when launching processes.
appsApplication launch contexts.

Member Function Documentation

◆ execute()

int proc::proc_t::execute ( int app_id,
std::shared_ptr< rtsp_stream::launch_session_t > launch_session )

Launch the configured application process.

Parameters
app_idApp ID.
launch_sessionLaunch session.
Returns
Process exit code or launch error status.

◆ get_app_image()

std::string proc::proc_t::get_app_image ( int app_id)

Get app image.

Parameters
app_idApp ID.
Returns
Validated image path for the requested application.

◆ get_apps() [1/2]

std::vector< ctx_t > & proc::proc_t::get_apps ( )

Return the configured applications.

Returns
Mutable application list owned by the process manager.

◆ get_apps() [2/2]

const std::vector< ctx_t > & proc::proc_t::get_apps ( ) const

Return the configured applications.

Returns
Immutable application list owned by the process manager.

◆ get_last_run_app_name()

std::string proc::proc_t::get_last_run_app_name ( )

Get last run app name.

Returns
Name of the most recently launched application.

◆ operator=()

proc_t & proc::proc_t::operator= ( proc_t && )
default

Defaulted move assignment for the generated type. * *.

  • Returns
    This instance.

◆ running()

int proc::proc_t::running ( )
Returns
_app_id if a process is running, otherwise returns 0

◆ update_apps_and_env()

void proc::proc_t::update_apps_and_env ( proc_t && other)

Update the cached app list and environment without disturbing running process state.

This replaces only the application configuration data (_apps and _env) from a newly parsed proc_t, preserving the current _app_id, _process, _process_group, and other fields that track an in-flight streaming session.

Parameters
otherThe newly parsed proc_t whose apps and env will be moved into this instance.

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