FireSTARR
Loading...
Searching...
No Matches
fs::fuel::FuelLookupImpl Class Reference

Implementation class for FuelLookup. More...

Collaboration diagram for fs::fuel::FuelLookupImpl:

Public Member Functions

 FuelLookupImpl (const char *filename)
 Construct by reading from a file.
 
void emplaceFuel (const FuelType *fuel)
 Put fuel into lookup table based on name.
 
void emplaceFuel (const string &name, const FuelType *fuel)
 Put fuel into lookup table based on name.
 
set< const FuelType * > usedFuels () const
 Create a set of all FuelTypes used in this lookup table.
 
 FuelLookupImpl (const FuelLookupImpl &rhs)=delete
 
 FuelLookupImpl (FuelLookupImpl &&rhs)=delete
 
FuelLookupImploperator= (const FuelLookupImpl &rhs)=delete
 
FuelLookupImploperator= (FuelLookupImpl &&rhs)=delete
 
const FuelTypecodeToFuel (const FuelSize value, const FuelSize nodata) const
 Look up a FuelType based on the given code.
 
void listFuels () const
 List all fuels and their codes.
 
FuelSize fuelToCode (const FuelType *const value) const
 Look up the original grid code for a FuelType.
 
const FuelTypebyName (const string &name) const
 Look up a FuelType based on the given name.
 
const FuelTypebySimplifiedName (const string &name) const
 Look up a FuelType based on the given simplified name.
 

Private Attributes

array< const FuelType *, numeric_limits< FuelSize >::max()> * fuel_types_
 Array of all possible fuel types.
 
unordered_map< const FuelType *, FuelSize > fuel_grid_codes_ {}
 Map of FuelType to (first) original grid value.
 
unordered_map< string, const FuelType * > fuel_by_name_ {}
 Map of fuel name to FuelType.
 
unordered_map< string, const FuelType * > fuel_by_simplified_name_ {}
 Map of simplified fuel name to FuelType.
 
unordered_map< string, bool > used_by_name_ {}
 Map of fuel name to whether or not it is used in this simulation.
 
unordered_map< FuelSize, vector< string > > fuel_good_values_ {}
 Codes from input .lut that were for fuel types that are implemented.
 
unordered_map< FuelSize, vector< string > > fuel_bad_values_ {}
 Codes from input .lut that were for fuel types that are not implemented.
 

Detailed Description

Implementation class for FuelLookup.

Constructor & Destructor Documentation

◆ FuelLookupImpl()

fs::fuel::FuelLookupImpl::FuelLookupImpl ( const char * filename)
inlineexplicit

Construct by reading from a file.

Parameters
filenameFile to read from. Uses .lut format from Prometheus

Member Function Documentation

◆ byName()

const FuelType * fs::fuel::FuelLookupImpl::byName ( const string & name) const
inline

Look up a FuelType based on the given name.

Parameters
nameName of the fuel to find
Returns
FuelType based on the given name

◆ bySimplifiedName()

const FuelType * fs::fuel::FuelLookupImpl::bySimplifiedName ( const string & name) const
inline

Look up a FuelType based on the given simplified name.

Parameters
nameSimplified name of the fuel to find
Returns
FuelType based on the given name

◆ codeToFuel()

const FuelType * fs::fuel::FuelLookupImpl::codeToFuel ( const FuelSize value,
const FuelSize nodata ) const
inline

Look up a FuelType based on the given code.

Parameters
valueValue to use for lookup
nodataValue that represents no data
Returns
FuelType based on the given code
Here is the call graph for this function:

◆ emplaceFuel() [1/2]

void fs::fuel::FuelLookupImpl::emplaceFuel ( const FuelType * fuel)
inline

Put fuel into lookup table based on name.

Parameters
fuelFuelType to put into lookup table based on its name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplaceFuel() [2/2]

void fs::fuel::FuelLookupImpl::emplaceFuel ( const string & name,
const FuelType * fuel )
inline

Put fuel into lookup table based on name.

Parameters
nameName to use for FuelType in lookup table
fuelFuelType to put into lookup table
Here is the call graph for this function:

◆ fuelToCode()

FuelSize fs::fuel::FuelLookupImpl::fuelToCode ( const FuelType *const value) const
inline

Look up the original grid code for a FuelType.

Parameters
valueValue to use for lookup
Returns
Original grid code for the FuelType
Here is the call graph for this function:

◆ usedFuels()

set< const FuelType * > fs::fuel::FuelLookupImpl::usedFuels ( ) const
inline

Create a set of all FuelTypes used in this lookup table.

Returns
Set of all FuelTypes used in this lookup table

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