A registry of units.
More...
#include <unit_registry.h>
|
| UnitRange | getUnits () const noexcept |
| | The currently registered units. Does not include the builtin units.
|
| UnitList | getUnitsByCategory (UnitCategory category) const |
| | Returns all registered units that belong to a given category. It also searches in the built-in units.
|
| std::optional< const Unit * > | searchUnitByName (std::string_view name) const |
| | Tries to find a unit with a specific name (case sensitive) It also searches in the built-in units. Returns nullopt if the unit was not found, otherwise a valid pointer to the unit.
|
| std::optional< const Unit * > | searchUnitByAbbreviation (std::string_view abbrev) const |
| | Tries to find a unit with a specific abbreviation (case sensitive). It also searches in the built-in units. Returns nullopt if the unit was not found, otherwise a valid pointer to the unit.
|
|
| static const UnitRegistry & | get () |
◆ UnitList
◆ UnitStorage
◆ UnitRange
◆ get()
| const UnitRegistry & sen::UnitRegistry::get |
( |
| ) |
|
|
static |
◆ getUnits()
| UnitRange sen::UnitRegistry::getUnits |
( |
| ) |
const |
|
nodiscardnoexcept |
The currently registered units. Does not include the builtin units.
◆ getUnitsByCategory()
Returns all registered units that belong to a given category. It also searches in the built-in units.
◆ searchUnitByName()
| std::optional< const Unit * > sen::UnitRegistry::searchUnitByName |
( |
std::string_view | name | ) |
const |
|
nodiscard |
Tries to find a unit with a specific name (case sensitive) It also searches in the built-in units. Returns nullopt if the unit was not found, otherwise a valid pointer to the unit.
◆ searchUnitByAbbreviation()
| std::optional< const Unit * > sen::UnitRegistry::searchUnitByAbbreviation |
( |
std::string_view | abbrev | ) |
const |
|
nodiscard |
Tries to find a unit with a specific abbreviation (case sensitive). It also searches in the built-in units. Returns nullopt if the unit was not found, otherwise a valid pointer to the unit.
The documentation for this class was generated from the following file: