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

Monitors all Steam games for update availability. More...

#include <steam_integration.h>

Classes

class  Impl

Public Types

using UpdateAvailableCallback = std::function<void(const SteamGameUpdateInfo& info)>
using UpdateCompletedCallback
using UpdateStartedCallback = std::function<void(const SteamGameUpdateInfo& info)>

Public Member Functions

 SteamUpdateMonitor (const SteamUpdateMonitor &)=delete
void clearCache ()
 Clear cached update states (force fresh detection).
std::vector< SteamGameUpdateInfo > getGamesNeedingUpdate () const
 Get all games currently needing updates.
size_t getUpdateCount () const
 Get count of games needing updates.
bool isRunning () const
 Check if monitor is running.
SteamUpdateMonitor & operator= (const SteamUpdateMonitor &)=delete
std::vector< SteamGameUpdateInfo > scanNow ()
 Force an immediate scan for updates.
void setOnUpdateAvailable (UpdateAvailableCallback callback)
 Set callback for when a new update is detected.
void setOnUpdateCompleted (UpdateCompletedCallback callback)
 Set callback for when an update completes.
void setOnUpdateStarted (UpdateStartedCallback callback)
 Set callback for when an update starts downloading.
void start (int scanIntervalSeconds=300)
 Start monitoring for updates.
void stop ()
 Stop monitoring.

Static Public Member Functions

static SteamUpdateMonitor & instance ()

Detailed Description

Monitors all Steam games for update availability.

This class provides library-wide monitoring for game updates by:

  1. Scanning all appmanifest files periodically
  2. Detecting StateFlags changes indicating updates available
  3. Notifying callbacks when new updates are detected

Unlike SteamDownloadMonitor which watches specific games, this monitors ALL installed games for update status changes.

Usage:

auto& monitor = SteamUpdateMonitor::instance();
monitor.setOnUpdateAvailable([](const SteamGameUpdateInfo& info) {
std::cout << info.gameName << " has an update!\n";
});
monitor.start(); // Scans every 5 minutes by default
static SteamUpdateMonitor & instance()
Information about a game's update status.

Definition at line 1113 of file steam_integration.h.

Member Typedef Documentation

◆ UpdateAvailableCallback

using SteamUpdateMonitor::UpdateAvailableCallback = std::function<void(const SteamGameUpdateInfo& info)>

Definition at line 1116 of file steam_integration.h.

◆ UpdateCompletedCallback

Initial value:
std::function<void(uint32_t appId, const std::string& gameName)>

Definition at line 1118 of file steam_integration.h.

◆ UpdateStartedCallback

using SteamUpdateMonitor::UpdateStartedCallback = std::function<void(const SteamGameUpdateInfo& info)>

Definition at line 1117 of file steam_integration.h.

Constructor & Destructor Documentation

◆ SteamUpdateMonitor()

SteamUpdateMonitor::SteamUpdateMonitor ( const SteamUpdateMonitor & )
delete

Member Function Documentation

◆ clearCache()

void SteamUpdateMonitor::clearCache ( )

Clear cached update states (force fresh detection).

Definition at line 5760 of file steam_integration.cpp.

References Logger::info().

Referenced by operator=().

◆ getGamesNeedingUpdate()

std::vector< SteamGameUpdateInfo > SteamUpdateMonitor::getGamesNeedingUpdate ( ) const

Get all games currently needing updates.

Definition at line 5728 of file steam_integration.cpp.

Referenced by operator=(), and scanNow().

◆ getUpdateCount()

size_t SteamUpdateMonitor::getUpdateCount ( ) const

Get count of games needing updates.

Definition at line 5744 of file steam_integration.cpp.

Referenced by operator=().

◆ instance()

SteamUpdateMonitor & SteamUpdateMonitor::instance ( )
static

Definition at line 5667 of file steam_integration.cpp.

References SteamUpdateMonitor(), and instance().

Referenced by instance(), and main().

◆ isRunning()

bool SteamUpdateMonitor::isRunning ( ) const

Check if monitor is running.

Definition at line 5717 of file steam_integration.cpp.

Referenced by operator=().

◆ operator=()

◆ scanNow()

std::vector< SteamGameUpdateInfo > SteamUpdateMonitor::scanNow ( )

Force an immediate scan for updates.

Returns
Vector of games with updates available

Definition at line 5722 of file steam_integration.cpp.

References getGamesNeedingUpdate().

Referenced by operator=().

◆ setOnUpdateAvailable()

void SteamUpdateMonitor::setOnUpdateAvailable ( UpdateAvailableCallback callback)

Set callback for when a new update is detected.

Definition at line 5770 of file steam_integration.cpp.

Referenced by operator=().

◆ setOnUpdateCompleted()

void SteamUpdateMonitor::setOnUpdateCompleted ( UpdateCompletedCallback callback)

Set callback for when an update completes.

Definition at line 5782 of file steam_integration.cpp.

Referenced by operator=().

◆ setOnUpdateStarted()

void SteamUpdateMonitor::setOnUpdateStarted ( UpdateStartedCallback callback)

Set callback for when an update starts downloading.

Definition at line 5776 of file steam_integration.cpp.

Referenced by operator=().

◆ start()

void SteamUpdateMonitor::start ( int scanIntervalSeconds = 300)

Start monitoring for updates.

Parameters
scanIntervalSecondsHow often to scan for updates (default: 300s = 5 min)

Definition at line 5680 of file steam_integration.cpp.

References Logger::info(), SteamUpdateMonitor::Impl::monitorLoop(), and Logger::warn().

Referenced by operator=().

◆ stop()

void SteamUpdateMonitor::stop ( )

Stop monitoring.

Definition at line 5700 of file steam_integration.cpp.

References Logger::info().

Referenced by operator=().


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