morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::units::UnitAlternative< E > Struct Template Reference

A derived per-unit view of one convertible display/entry unit. More...

#include <quantity.hpp>

Public Attributes

E unit {}
 The alternative (convertible) unit.
std::int64_t num {1}
 Numerator of the exact alternative-to-canonical ratio.
std::int64_t den {1}
 Denominator of the exact alternative-to-canonical ratio.

Detailed Description

template<typename E>
struct morph::units::UnitAlternative< E >

A derived per-unit view of one convertible display/entry unit.

Not declared by the application — computed from UnitTraits<E>::relations by Quantity::unitAlternatives(). value_in_canonical = value_in_unit * num/den, where the canonical unit is the field's own unit.

Template Parameters
EThe application's unit enum type.

Definition at line 242 of file quantity.hpp.

Member Data Documentation

◆ unit

template<typename E>
E morph::units::UnitAlternative< E >::unit {}

The alternative (convertible) unit.

Definition at line 244 of file quantity.hpp.

◆ num

template<typename E>
std::int64_t morph::units::UnitAlternative< E >::num {1}

Numerator of the exact alternative-to-canonical ratio.

Definition at line 247 of file quantity.hpp.

◆ den

template<typename E>
std::int64_t morph::units::UnitAlternative< E >::den {1}

Denominator of the exact alternative-to-canonical ratio.

Definition at line 250 of file quantity.hpp.


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