ASAPCabinetFE
 
Loading...
Searching...
No Matches
TableLoader Class Reference

Implements table loading and indexing for ASAPCabinetFE. More...

#include <table_loader.h>

+ Inheritance diagram for TableLoader:
+ Collaboration diagram for TableLoader:

Public Member Functions

 TableLoader ()=default
 Constructs a TableLoader instance.
 
std::vector< TableDataloadTableList (const Settings &settings, LoadingProgress *progress=nullptr) override
 Loads the list of table data based on application settings.
 
const std::map< char, int > & getLetterIndex () const override
 Retrieves the letter-based index for table navigation.
 

Detailed Description

Implements table loading and indexing for ASAPCabinetFE.

This class loads a list of TableData by scanning VPX files, matchmaking metadata from VPSDB or ASAP indexes, and sorting based on user-defined criteria (e.g., title, author). It supports a five-stage process (fetching VPSDB, scanning, matchmaking, saving, sorting) with optional progress tracking via LoadingProgress. The class maintains a letter index for quick navigation and is configurable via Settings parameters, with extensibility for configUI adjustments (e.g., sort options, metadata sources).

Constructor & Destructor Documentation

◆ TableLoader()

TableLoader::TableLoader ( )
default

Constructs a TableLoader instance.

Default constructor initializes the loader with an empty letter index.

Member Function Documentation

◆ getLetterIndex()

const std::map< char, int > & TableLoader::getLetterIndex ( ) const
inlineoverridevirtual

Retrieves the letter-based index for table navigation.

Returns a map where keys are the first characters (uppercased letters or digits) of table titles, and values are the corresponding indices in the sorted table list.

Returns
A constant reference to the letter index map.

Implements ITableLoader.

◆ loadTableList()

std::vector< TableData > TableLoader::loadTableList ( const Settings settings,
LoadingProgress progress = nullptr 
)
overridevirtual

Loads the list of table data based on application settings.

Executes a multi-stage process to load tables: fetching VPSDB (if enabled), scanning VPX files or loading from an ASAP index, matchmaking metadata, saving the index, and sorting. Progress is tracked via LoadingProgress if provided. The method is configurable via Settings (e.g., titleSource, fetchVPSdb, sortBy).

Parameters
settingsThe application settings controlling the loading process.
progressOptional pointer to LoadingProgress for real-time updates.
Returns
A vector of TableData representing the loaded tables.

Implements ITableLoader.

+ Here is the call graph for this function:

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