dimval 0.2.0
Modern C++23 header-only library of dimensional values (units, measures, ranges)
Loading...
Searching...
No Matches
dimval::MeasureRegistry Class Reference

Registry of measure descriptors. More...

#include <registry.hpp>

Public Member Functions

void register_measure (const MeasureDescriptor &d)
 Register a descriptor. Existing entries with the same id are replaced.
 
template<MeasureLike Measure>
bool register_measure ()
 Register a measure by tag — pulls the descriptor through Measure::descriptor().
 
bool compatible (const std::string_view measure_id, const std::string_view unit_id) const
 True iff measure_id and unit_id both resolve and the measure's declared base unit equals unit_id.
 

Static Public Member Functions

static MeasureRegistryglobal ()
 Process-wide singleton.
 

Detailed Description

Registry of measure descriptors.

Member Function Documentation

◆ register_measure()

template<MeasureLike Measure>
bool dimval::MeasureRegistry::register_measure ( )
inline

Register a measure by tag — pulls the descriptor through Measure::descriptor().

Returns false if the id was already present.


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