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

#include <notification_service.h>

Static Public Member Functions

static void error (const std::string &message, float duration=5.0f)
static void info (const std::string &message, float duration=3.0f)
 Convenience methods that safely handle null instance.
static std::shared_ptr< INotificationService > instance ()
 Get the current notification service instance.
static void setInstance (std::shared_ptr< INotificationService > service)
 Set the notification service implementation UI layer calls this at startup with its implementation.
static void success (const std::string &message, float duration=3.0f)
static void warning (const std::string &message, float duration=5.0f)

Detailed Description

Definition at line 77 of file notification_service.h.

Member Function Documentation

◆ error()

void core::NotificationService::error ( const std::string & message,
float duration = 5.0f )
static

Definition at line 90 of file notification_service.cpp.

◆ info()

void core::NotificationService::info ( const std::string & message,
float duration = 3.0f )
static

Convenience methods that safely handle null instance.

Definition at line 66 of file notification_service.cpp.

◆ instance()

std::shared_ptr< INotificationService > core::NotificationService::instance ( )
static

Get the current notification service instance.

Returns an empty shared_ptr if not set.

Lifetime contract: returns a shared_ptr (not a raw pointer) because at QApplication teardown a background thread may still fire while main()'s scope releases the last reference. Holding a shared_ptr for the duration of the call keeps the underlying service alive past any racing setInstance(nullptr).

Definition at line 49 of file notification_service.cpp.

Referenced by main().

◆ setInstance()

void core::NotificationService::setInstance ( std::shared_ptr< INotificationService > service)
static

Set the notification service implementation UI layer calls this at startup with its implementation.

Definition at line 60 of file notification_service.cpp.

Referenced by main().

◆ success()

void core::NotificationService::success ( const std::string & message,
float duration = 3.0f )
static

Definition at line 74 of file notification_service.cpp.

◆ warning()

void core::NotificationService::warning ( const std::string & message,
float duration = 5.0f )
static

Definition at line 82 of file notification_service.cpp.


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