Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamunits::NamedUnit Struct Reference

One registry entry: a unit and the two names it can be looked up by. More...

#include <shamunits/include/shamunits/details/registry.hpp>

Collaboration diagram for shamunits::NamedUnit:

Public Member Functions

constexpr NamedUnit (std::string_view lname, std::string_view sname, Unit<> u) noexcept
 Constructor, so registry rows stay compact: {"metre", "m", metre}.

Public Attributes

std::string_view long_name
 e.g. "metre", "astronomical_unit"
std::string_view short_name
 e.g. "m", "au"
Unit unit
 the unit, always in the reference precision (double)

Detailed Description

One registry entry: a unit and the two names it can be looked up by.

Definition at line 32 of file registry.hpp.

Constructor & Destructor Documentation

◆ NamedUnit()

shamunits::NamedUnit::NamedUnit ( std::string_view lname,
std::string_view sname,
Unit<> u )
inlineconstexprnoexcept

Constructor, so registry rows stay compact: {"metre", "m", metre}.

Definition at line 38 of file registry.hpp.

Member Data Documentation

◆ long_name

std::string_view shamunits::NamedUnit::long_name

e.g. "metre", "astronomical_unit"

Definition at line 33 of file registry.hpp.

◆ short_name

std::string_view shamunits::NamedUnit::short_name

e.g. "m", "au"

Definition at line 34 of file registry.hpp.

◆ unit

Unit shamunits::NamedUnit::unit

the unit, always in the reference precision (double)

Definition at line 35 of file registry.hpp.


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