game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
task_scheduler.h File Reference
#include <chrono>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <vector>
Include dependency graph for task_scheduler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ScheduledTask
 Information about a scheduled task. More...
struct  TaskDefinition
 Definition for creating a new task. More...
struct  TaskResult
 Result of a task execution. More...
class  TaskScheduler
 Service for scheduling and running background tasks. More...

Enumerations

enum class  TaskPriority { Low , Normal , High , Critical }
 Priority levels for tasks. More...
enum class  TaskState {
  Pending , Running , Completed , Failed ,
  Cancelled , Paused
}
 Current state of a scheduled task. More...

Functions

std::string taskPriorityName (TaskPriority priority)
 Get human-readable priority name.
std::string taskStateName (TaskState state)
 Get human-readable state name.

Enumeration Type Documentation

◆ TaskPriority

enum class TaskPriority
strong

Priority levels for tasks.

Enumerator
Low 

Background maintenance tasks.

Normal 

Regular scheduled tasks.

High 

Important tasks (update checks).

Critical 

Must run ASAP (user-initiated).

Definition at line 42 of file task_scheduler.h.

◆ TaskState

enum class TaskState
strong

Current state of a scheduled task.

Enumerator
Pending 

Waiting to run.

Running 

Currently executing.

Completed 

Finished successfully.

Failed 

Finished with error.

Cancelled 

Was cancelled.

Paused 

Temporarily paused.

Definition at line 54 of file task_scheduler.h.

Function Documentation

◆ taskPriorityName()

std::string taskPriorityName ( TaskPriority priority)

Get human-readable priority name.

Definition at line 91 of file task_scheduler.cpp.

References Critical, High, Low, and Normal.

◆ taskStateName()

std::string taskStateName ( TaskState state)

Get human-readable state name.

Definition at line 108 of file task_scheduler.cpp.

References Cancelled, Completed, Failed, Paused, Pending, and Running.

Referenced by ScheduledTask::getStateStr().