NGen
Loading...
Searching...
No Matches
UnitsHelper::normalized_units Struct Reference

A pair of normalized units. More...

#include <UnitsHelper.hpp>

+ Collaboration diagram for UnitsHelper::normalized_units:

Public Member Functions

 normalized_units (std::string in_units, std::string out_units)
 Reduce in_units and out_units to the form the questions below are asked of.
 
bool is_identity () const
 Whether converting between these would leave every value exactly as it is.
 

Public Attributes

std::string in
 
std::string out
 

Detailed Description

A pair of normalized units.

This struct encapsulates the noneish semantics of unit strings, normalizing various representations of "no units" for consistent handling in conversion checks.

Constructor & Destructor Documentation

◆ normalized_units()

UnitsHelper::normalized_units::normalized_units ( std::string in_units,
std::string out_units )

Reduce in_units and out_units to the form the questions below are asked of.

References in, and out.

Member Function Documentation

◆ is_identity()

bool UnitsHelper::normalized_units::is_identity ( ) const
inline

Whether converting between these would leave every value exactly as it is.

True in two cases:

  1. The output units are empty (no units stated).
  2. The input and output units are identical.

References in, and out.

Referenced by UnitsHelper::convert_values(), and UnitsHelper::get_converted_value().

Member Data Documentation

◆ in

std::string UnitsHelper::normalized_units::in

◆ out

std::string UnitsHelper::normalized_units::out

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