NDEVR
API Documentation
VehicleDatabase

A database of vehicle specifications (make, model, year, dimensions, weight) loaded from DBF files and INI-based search term mappings, used for vehicle selection and placement. More...

Collaboration diagram for VehicleDatabase:
[legend]

Public Member Functions

 VehicleDatabase ()
 Default constructor.
Buffer< uint04filterModels (const String &make, const String &model, uint04 year) const
 Returns indices of records matching the given make, model, and year criteria.
Buffer< StringgetMakes (const String &model=String(), uint04 year=Constant< uint04 >::Invalid) const
 Returns all unique makes, optionally filtered by model and year.
Buffer< StringgetModels (const String &make=String(), uint04 year=Constant< uint04 >::Invalid) const
 Returns all unique models, optionally filtered by make and year.
Buffer< uint04getYears (const String &make=String(), const String &model=String()) const
 Returns all unique years, optionally filtered by make and model.
void readDatabaseFromFolder (const File &folder)
 Reads vehicle data and search terms from DBF and INI files in the given folder.
void readFromDBF (const File &f)
 Reads vehicle records from a single DBF file.
void readSearchTermsFromFolder (const File &folder)
 Reads vehicle-to-model search term mappings from INI files in the given folder.
VehicleRecord record (uint04 i) const
 Returns a record accessor for the given index.
uint04 recordCount () const
 Returns the total number of vehicle records.
bool recordFilterPass (uint04 record_number, const String &make, const String &model, uint04 year) const
 Checks whether a specific record passes the given filter criteria.

Static Public Member Functions

static VehicleDatabaseDefaultDatabase ()
 Returns the global singleton VehicleDatabase instance.
static uint04 ParseYear (const File &f)
 Parses a year value from a file name.

Public Attributes

Buffer< fltp08curb_weight
 Vehicle curb weights, one per record.
Buffer< VehicleSearchItemfile_search_terms
 Search term mappings for associating records to 3D model files.
Buffer< fltp08overall_height
 Vehicle overall heights, one per record.
Buffer< fltp08overall_length
 Vehicle overall lengths, one per record.
Buffer< fltp08overall_width
 Vehicle overall widths, one per record.
Buffer< Stringvehicle_makes
 Vehicle manufacturer names, one per record.
Buffer< Stringvehicle_models
 Vehicle model names, one per record.
Buffer< uint04vehicle_year
 Vehicle model years, one per record.
Buffer< fltp08wheel_base
 Vehicle wheel bases, one per record.

Detailed Description

A database of vehicle specifications (make, model, year, dimensions, weight) loaded from DBF files and INI-based search term mappings, used for vehicle selection and placement.


Definition at line 76 of file VehicleDatabase.h.

Member Function Documentation

◆ DefaultDatabase()

VehicleDatabase & VehicleDatabase::DefaultDatabase ( )
static

Returns the global singleton VehicleDatabase instance.

Returns
Reference to the default database.

References VehicleDatabase().

◆ filterModels()

Buffer< uint04 > VehicleDatabase::filterModels ( const String & make,
const String & model,
uint04 year ) const

Returns indices of records matching the given make, model, and year criteria.

Parameters
[in]makeMake search string (empty matches all).
[in]modelModel search string (empty matches all).
[in]yearYear filter (Invalid matches all).
Returns
Buffer of matching record indices.

◆ getMakes()

Buffer< String > VehicleDatabase::getMakes ( const String & model = String(),
uint04 year = Constantuint04 >::Invalid ) const

Returns all unique makes, optionally filtered by model and year.

Parameters
[in]modelOptional model filter.
[in]yearOptional year filter.
Returns
Buffer of unique make strings.

◆ getModels()

Buffer< String > VehicleDatabase::getModels ( const String & make = String(),
uint04 year = Constantuint04 >::Invalid ) const

Returns all unique models, optionally filtered by make and year.

Parameters
[in]makeOptional make filter.
[in]yearOptional year filter.
Returns
Buffer of unique model strings.

◆ getYears()

Buffer< uint04 > VehicleDatabase::getYears ( const String & make = String(),
const String & model = String() ) const

Returns all unique years, optionally filtered by make and model.

Parameters
[in]makeOptional make filter.
[in]modelOptional model filter.
Returns
Buffer of unique year values.

◆ ParseYear()

uint04 VehicleDatabase::ParseYear ( const File & f)
static

Parses a year value from a file name.

Parameters
[in]fThe file whose name contains a year.
Returns
The parsed year, or Invalid if not found.

◆ readDatabaseFromFolder()

void VehicleDatabase::readDatabaseFromFolder ( const File & folder)

Reads vehicle data and search terms from DBF and INI files in the given folder.

Parameters
[in]folderThe folder containing database files.

◆ readFromDBF()

void VehicleDatabase::readFromDBF ( const File & f)

Reads vehicle records from a single DBF file.

Parameters
[in]fThe DBF file to parse.

◆ readSearchTermsFromFolder()

void VehicleDatabase::readSearchTermsFromFolder ( const File & folder)

Reads vehicle-to-model search term mappings from INI files in the given folder.

Parameters
[in]folderThe folder containing search term INI files.

◆ record()

VehicleRecord VehicleDatabase::record ( uint04 i) const
inline

Returns a record accessor for the given index.

Parameters
[in]iThe record index.
Returns
A VehicleRecord for the given index.

Definition at line 111 of file VehicleDatabase.h.

◆ recordCount()

uint04 VehicleDatabase::recordCount ( ) const
inline

Returns the total number of vehicle records.

Returns
The record count.

Definition at line 107 of file VehicleDatabase.h.

References vehicle_makes.

◆ recordFilterPass()

bool VehicleDatabase::recordFilterPass ( uint04 record_number,
const String & make,
const String & model,
uint04 year ) const

Checks whether a specific record passes the given filter criteria.

Parameters
[in]record_numberThe record index to test.
[in]makeMake search string.
[in]modelModel search string.
[in]yearYear filter.
Returns
true if the record passes the filter.

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