8#ifndef SEN_CORE_META_UNIT_REGISTRY_H
9#define SEN_CORE_META_UNIT_REGISTRY_H
29class UnitRegistry final
31 SEN_NOCOPY_NOMOVE(UnitRegistry)
39 static const UnitRegistry&
get();
62 ~UnitRegistry() = default;
Here we define a set of template meta-programming helpers to let the compiler take some decisions bas...
Represents the definition of a unit.
Definition unit.h:78
std::vector< Unit * > UnitList
Definition unit_registry.h:34
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 ...
sen::util::IteratorRange< util::SmartPtrIteratorAdapter< UnitStorage::const_iterator > > UnitRange
Definition unit_registry.h:36
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....
static const UnitRegistry & get()
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::vector< std::unique_ptr< Unit > > UnitStorage
Definition unit_registry.h:35
UnitCategory
Type of measurement.
Definition unit.h:30
Basic range abstraction to form a minimal range around two iterators.
Definition iterator_adapters.h:25