ASAPCabinetFE
 
Loading...
Searching...
No Matches
loading_progress.h
Go to the documentation of this file.
1
14#ifndef LOADING_PROGRESS_H
15#define LOADING_PROGRESS_H // Header guard to prevent multiple inclusions
16
17#include <string> // For std::string in task descriptions and log messages
18#include <vector> // Not used directly but included for potential future expansion
19#include <mutex> // For thread-safe access to the struct's members
20#include <deque> // For logMessages buffer with efficient front/back operations
21
34 std::mutex mutex;
35
38 int currentStage = 0;
39 int totalStages = 11;
40
41 std::string currentTask = "Initializing...";
42
43 int numMatched = 0;
44 int numNoMatch = 0;
45
46 std::deque<std::string> logMessages;
47 size_t maxLogMessages = 10;
48
60 void addLogMessage(const std::string& message) {
61 logMessages.push_back(message);
62 if (logMessages.size() > maxLogMessages) {
63 logMessages.pop_front();
64 }
65 }
66};
67
68#endif // LOADING_PROGRESS_H
Tracks the loading progress state for ASAPCabinetFE.
Definition loading_progress.h:33
int numNoMatch
Number of tables with no metadata match (displayed in UI stats).
Definition loading_progress.h:44
std::string currentTask
Description of the current task (e.g., "Scanning Tables (5)").
Definition loading_progress.h:41
int currentStage
Current overall progress stage (e.g., fetching VPSDB, scanning, matchmaking).
Definition loading_progress.h:38
int numMatched
Number of tables successfully matched with metadata (used for match progress bar).
Definition loading_progress.h:43
void addLogMessage(const std::string &message)
Adds a log message to the buffer for UI display.
Definition loading_progress.h:60
size_t maxLogMessages
Maximum number of log messages to store (keeps last 10, older messages are removed).
Definition loading_progress.h:47
int totalTablesToLoad
Total number of tables to load (denominator for per-table progress bar).
Definition loading_progress.h:37
int currentTablesLoaded
Number of tables currently loaded (used for per-table progress bar).
Definition loading_progress.h:36
std::deque< std::string > logMessages
Buffer of recent log messages for display in the loading screen's mini terminal.
Definition loading_progress.h:46
std::mutex mutex
Mutex for thread-safe access to all members, used by loading and rendering threads.
Definition loading_progress.h:34
int totalStages
Total number of stages.
Definition loading_progress.h:39