morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::UnitOption Struct Reference

One unit a Quantity can be entered in; the first of a field's units is canonical. More...

#include <field_model.hpp>

Public Member Functions

bool operator== (UnitOption const &other) const =default
 Member-wise equality.

Public Attributes

std::string id
 The unit id (ExtUnits.unitAscii, or the alternative's id).
std::string display
 What a selector shows.
std::uint32_t decimals = 0
 Fraction digits accepted in this unit.
std::int64_t num = 1
 Numerator of the exact unit-to-canonical ratio.
std::int64_t den = 1
 Denominator of the exact unit-to-canonical ratio.

Detailed Description

One unit a Quantity can be entered in; the first of a field's units is canonical.

Definition at line 113 of file field_model.hpp.

Member Function Documentation

◆ operator==()

bool morph::forms::UnitOption::operator== ( UnitOption const & other) const
default

Member-wise equality.

Parameters
otherThe other unit.
Returns
true when every member matches.

Member Data Documentation

◆ id

std::string morph::forms::UnitOption::id

The unit id (ExtUnits.unitAscii, or the alternative's id).

Definition at line 115 of file field_model.hpp.

◆ display

std::string morph::forms::UnitOption::display

What a selector shows.

Definition at line 117 of file field_model.hpp.

◆ decimals

std::uint32_t morph::forms::UnitOption::decimals = 0

Fraction digits accepted in this unit.

Definition at line 119 of file field_model.hpp.

◆ num

std::int64_t morph::forms::UnitOption::num = 1

Numerator of the exact unit-to-canonical ratio.

Definition at line 121 of file field_model.hpp.

◆ den

std::int64_t morph::forms::UnitOption::den = 1

Denominator of the exact unit-to-canonical ratio.

Definition at line 123 of file field_model.hpp.


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