ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
active::measure::AreaUnit Struct Reference

#include <AreaUnit.h>

Inheritance diagram for active::measure::AreaUnit:
Inheritance graph
[legend]
Collaboration diagram for active::measure::AreaUnit:
Collaboration graph
[legend]

Public Types

using Type = AreaType
 

Public Member Functions

 AreaUnit ()
 
 AreaUnit (AreaType type, uint8_t prec, bool isDecimal=true, bool suffixes=true)
 
- Public Member Functions inherited from active::measure::Unit< AreaUnit, AreaType >
 Unit (AreaType type)
 
 Unit (AreaType first, AreaType second)
 
 Unit (AreaType type, uint8_t prec, bool isDecimal=true, bool suffixes=true)
 
 Unit (AreaType first, AreaType second, uint8_t prec, bool isDecimal=true)
 
 Unit (AreaType first, AreaType second, AreaType third, uint8_t prec, bool isDecimal=true)
 
bool isDecimal () const
 
double divisor () const
 
double eps () const
 
bool isMetric (AreaType type) const
 
double simpleRatio (double value, double factor, bool reversed) const
 
double conversion (AreaType type, double value, bool reversed=false) const
 
utility::String suffix (AreaType type) const
 
std::optional< AreaTypefromTag (const utility::String &text) const
 
utility::String toTag (AreaType type) const
 
std::optional< std::pair< AreaType, utility::String::size_type > > findSuffix (const utility::String &text, utility::String::size_type startPos=0) const
 

Static Public Member Functions

static AreaUnit metresSquare (uint8_t prec=6, bool suffixes=true)
 
static AreaUnit hectares (uint8_t prec=2, bool suffixes=true)
 
static AreaUnit feetSquare (uint8_t prec=5, bool suffixes=true)
 

Friends

struct Unit
 

Additional Inherited Members

- Public Attributes inherited from active::measure::Unit< AreaUnit, AreaType >
AreaType primary
 The primary unit to display.
 
std::optional< AreaTypesecondary
 An optional secondary unit, e.g. for foot/inch combos (nullopt = none)
 
std::optional< AreaTypetertiary
 An optional teriary unit, e.g. for degrees/minutes/seconds combos (nullopt = none, ignored if no secondary unit)
 
uint8_t precision
 The display precision (decimal places for metric or 2^-n for fractional units.
 
double base
 The numeric base for fractional quantities (10.0 = floating point to specified decimal places, other values create a fraction)
 
bool isUnitSuffix
 True if values should be displayed with a unit suffix, e.g. "100.0mm" rather than "100.0" (always true when multiple units)
 
bool isLeadingZero
 True if a value is displayed with multiple units and zero values (apart from the last unit) should be included, e.g. 0' 10" vs 10".
 

Detailed Description

Structure to represent area units

Constructor & Destructor Documentation

◆ AreaUnit() [1/2]

active::measure::AreaUnit::AreaUnit ( )
inline

Default constructor

◆ AreaUnit() [2/2]

active::measure::AreaUnit::AreaUnit ( AreaType type,
uint8_t prec,
bool isDecimal = true,
bool suffixes = true )
inline

Constructor

Parameters
typeThe primary unit type
precThe unit display precision (decimal places for metric or 2^-n for fractional units)
isDecimalTrue if fractional values should display as decimal (floating point) numbers
suffixesTrue if the value should be displayed with the unit suffix, e.g. 100mm

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