game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
SteamProcessMonitor Class Reference

Multi-threaded Steam process monitor. More...

#include <steam_monitor.h>

Public Types

enum class  State {
  NOT_RUNNING , STARTING , RUNNING , STOPPING ,
  ERROR
}
using StateCallback = std::function<void(State oldState, State newState)>

Public Member Functions

State getCurrentState () const
bool isSteamFullyInitialized () const
bool isSteamRunning () const
void requestSteamShutdown ()
void requestSteamStart ()
void setStateCallback (StateCallback callback)
void startMonitoring ()
void stopMonitoring ()
bool waitForState (State targetState, int timeoutMs=10000)
bool waitForSteamInitialized (int timeoutMs=10000)

Static Public Member Functions

static SteamProcessMonitor & instance ()

Detailed Description

Multi-threaded Steam process monitor.

Monitors Steam process state in a dedicated thread and provides callbacks for state transitions. Handles Steam start/stop requests and verifies completion by watching the actual process.

Definition at line 18 of file steam_monitor.h.

Member Typedef Documentation

◆ StateCallback

using SteamProcessMonitor::StateCallback = std::function<void(State oldState, State newState)>

Definition at line 31 of file steam_monitor.h.

Member Enumeration Documentation

◆ State

enum class SteamProcessMonitor::State
strong
Enumerator
NOT_RUNNING 
STARTING 
RUNNING 
STOPPING 
ERROR 

Definition at line 21 of file steam_monitor.h.

Member Function Documentation

◆ getCurrentState()

SteamProcessMonitor::State SteamProcessMonitor::getCurrentState ( ) const

Definition at line 166 of file steam_monitor.cpp.

Referenced by core::LaunchController::isSteamRunning().

◆ instance()

◆ isSteamFullyInitialized()

bool SteamProcessMonitor::isSteamFullyInitialized ( ) const

◆ isSteamRunning()

bool SteamProcessMonitor::isSteamRunning ( ) const

Definition at line 171 of file steam_monitor.cpp.

References RUNNING.

◆ requestSteamShutdown()

void SteamProcessMonitor::requestSteamShutdown ( )

Definition at line 126 of file steam_monitor.cpp.

References ProcessExecutor::execute(), Logger::info(), NOT_RUNNING, and STOPPING.

◆ requestSteamStart()

void SteamProcessMonitor::requestSteamStart ( )

◆ setStateCallback()

void SteamProcessMonitor::setStateCallback ( StateCallback callback)

Definition at line 251 of file steam_monitor.cpp.

◆ startMonitoring()

void SteamProcessMonitor::startMonitoring ( )

Definition at line 40 of file steam_monitor.cpp.

References Logger::info(), NOT_RUNNING, and RUNNING.

Referenced by MainWindow::MainWindow().

◆ stopMonitoring()

void SteamProcessMonitor::stopMonitoring ( )

Definition at line 64 of file steam_monitor.cpp.

References Logger::info().

Referenced by MainWindow::~MainWindow().

◆ waitForState()

bool SteamProcessMonitor::waitForState ( State targetState,
int timeoutMs = 10000 )

Definition at line 154 of file steam_monitor.cpp.

◆ waitForSteamInitialized()

bool SteamProcessMonitor::waitForSteamInitialized ( int timeoutMs = 10000)

Definition at line 217 of file steam_monitor.cpp.

References Logger::info(), isSteamFullyInitialized(), and Logger::warn().


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