NDEVR
API Documentation
LocalApplicationLauncher

Forward declaration for pipe-based inter-process communication. More...

Inheritance diagram for LocalApplicationLauncher:
[legend]
Collaboration diagram for LocalApplicationLauncher:
[legend]

Public Member Functions

 LocalApplicationLauncher (const StringView &path)
 Constructs a LocalApplicationLauncher with the given executable path.
virtual ~LocalApplicationLauncher ()
 Destructor.
bool applicationFileExists () const
 Checks whether the application executable file exists on disk.
void bringToFront ()
 Brings the launched application window to the foreground.
virtual void execute ()
 Launches the application with the configured parameters.
Buffer< uint08findWindowIDs ()
 Finds the window identifiers associated with the launched process.
bool isRunning ()
 Checks whether the launched application is currently running.
void killProcess ()
 Terminates the launched process.

Static Public Member Functions

static void CallApplication (const StringView &application, const StringView &args=StringView(), bool wait_for_completion=true, bool windowless=false, LogPtr log=LogPtr())
 Convenience function to launch an application in a single call.

Public Attributes

String application
 The path or name of the application executable to launch.
String args
 Command-line arguments to pass to the application.
String environment
 Environment variables to set for the launched process.
LogPtr log
 Log instance for recording output and errors from the launched process.
bool make_child_process = false
 Whether to launch the application as a child process of the current process.
std::function< void()> on_complete_function
 Callback invoked when the launched application completes execution.
bool wait_for_completion = true
 Whether to block until the launched application exits.
bool windowless = false
 Whether to launch the application without a visible window.

Protected Attributes

String m_error_log_buffer
 Buffer for accumulating stderr output from the launched process.
bool m_is_running = false
 Tracks whether the launched process is currently running.
String m_log_buffer
 Buffer for accumulating stdout output from the launched process.
void * m_process_handle = nullptr
 Native handle to the launched process.
uint08 m_process_id = Constant<uint08>::Invalid
 The OS-assigned process identifier of the launched application.

Detailed Description

Forward declaration for pipe-based inter-process communication.


Information and logic for launching an application seperate from the current software


Definition at line 13 of file LocalApplicationLauncher.h.

Constructor & Destructor Documentation

◆ LocalApplicationLauncher()

LocalApplicationLauncher::LocalApplicationLauncher ( const StringView & path)

Constructs a LocalApplicationLauncher with the given executable path.

Parameters
[in]pathThe file path or name of the application to launch.

◆ ~LocalApplicationLauncher()

virtual LocalApplicationLauncher::~LocalApplicationLauncher ( )
virtual

Destructor.

Cleans up any process handles or resources.

Member Function Documentation

◆ applicationFileExists()

bool LocalApplicationLauncher::applicationFileExists ( ) const

Checks whether the application executable file exists on disk.

Returns
True if the application file exists, false otherwise.

◆ CallApplication()

void LocalApplicationLauncher::CallApplication ( const StringView & application,
const StringView & args = StringView(),
bool wait_for_completion = true,
bool windowless = false,
LogPtr log = LogPtr() )
static

Convenience function to launch an application in a single call.

Parameters
[in]applicationThe path or name of the application to launch.
[in]argsCommand-line arguments to pass to the application.
[in]wait_for_completionWhether to block until the application exits.
[in]windowlessWhether to launch without a visible window.
[in]logLog instance for recording output and errors.

References application, args, log, wait_for_completion, and windowless.

Referenced by ShaderTools::compileIndividualShader().

◆ findWindowIDs()

Buffer< uint08 > LocalApplicationLauncher::findWindowIDs ( )

Finds the window identifiers associated with the launched process.

Returns
A buffer of window IDs belonging to the launched application.

◆ isRunning()

bool LocalApplicationLauncher::isRunning ( )

Checks whether the launched application is currently running.

Returns
True if the process is still running, false otherwise.

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