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

Provides ability to look up a fuel type based on name or code. More...

#include <FuelLookup.h>

Collaboration diagram for fs::fuel::FuelLookup:

Public Member Functions

 FuelLookup (const char *filename)
 Construct by reading from a file.
 
 FuelLookup (const FuelLookup &rhs) noexcept=default
 Copy constructor.
 
 FuelLookup (FuelLookup &&rhs) noexcept=default
 Move constructor.
 
FuelLookupoperator= (const FuelLookup &rhs) noexcept=default
 Copy assignment.
 
FuelLookupoperator= (FuelLookup &&rhs) noexcept=default
 Move assignment.
 
const FuelTypecodeToFuel (FuelSize value, 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 *fuel) const
 Look up the original code for the given FuelType.
 
const FuelTypeoperator() (FuelSize value, FuelSize nodata) const
 Look up a FuelType ba1ed on the given code.
 
set< const FuelType * > usedFuels () const
 Retrieve set of FuelTypes that are used in the lookup table.
 
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.
 

Static Public Attributes

static const array< const FuelType *, NUMBER_OF_FUELS > Fuels
 Array of all FuelTypes available to be used in simulations.
 

Private Attributes

shared_ptr< FuelLookupImplimpl_
 Implementation class for FuelLookup.
 

Detailed Description

Provides ability to look up a fuel type based on name or code.

Constructor & Destructor Documentation

◆ FuelLookup() [1/3]

fs::fuel::FuelLookup::FuelLookup ( const char * filename)
explicit

Construct by reading from a file.

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

◆ FuelLookup() [2/3]

fs::fuel::FuelLookup::FuelLookup ( const FuelLookup & rhs)
defaultnoexcept

Copy constructor.

Parameters
rhsFuelLookup to copy from

◆ FuelLookup() [3/3]

fs::fuel::FuelLookup::FuelLookup ( FuelLookup && rhs)
defaultnoexcept

Move constructor.

Parameters
rhsFuelLookup to move from

Member Function Documentation

◆ byName()

const FuelType * fs::fuel::FuelLookup::byName ( const string & name) const
nodiscard

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::FuelLookup::bySimplifiedName ( const string & name) const
nodiscard

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::FuelLookup::codeToFuel ( FuelSize value,
FuelSize nodata ) const
nodiscard

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 caller graph for this function:

◆ fuelToCode()

FuelSize fs::fuel::FuelLookup::fuelToCode ( const FuelType * fuel) const
nodiscard

Look up the original code for the given FuelType.

Parameters
valueValue to use for lookup
Returns
code for the given FuelType

◆ operator()()

const FuelType * fs::fuel::FuelLookup::operator() ( FuelSize value,
FuelSize nodata ) const
nodiscard

Look up a FuelType ba1ed 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:

◆ operator=() [1/2]

FuelLookup & fs::fuel::FuelLookup::operator= ( const FuelLookup & rhs)
defaultnoexcept

Copy assignment.

Parameters
rhsFuelLookup to copy from
Returns
This, after assignment

◆ operator=() [2/2]

FuelLookup & fs::fuel::FuelLookup::operator= ( FuelLookup && rhs)
defaultnoexcept

Move assignment.

Parameters
rhsFuelLookup to move from
Returns
This, after assignment

◆ usedFuels()

set< const FuelType * > fs::fuel::FuelLookup::usedFuels ( ) const
nodiscard

Retrieve set of FuelTypes that are used in the lookup table.

Returns
set of FuelTypes that are used in the lookup table

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