#include <quantities.h>
Public Types | |
using | baseunit_t = U |
Base, unscaled unit. More... | |
using | unit_t = ScaledUnit< U, R > |
Unit with scale (i.e. this object). More... | |
using | ratio = R |
The ratio to go from the base unit to this one. More... | |
using | prefix_t = Prefix< ratio > |
The prefix of the unit. More... | |
Static Public Member Functions | |
Conversion to string. | |
| |
static auto | symbol () |
Returns short symbol of the unit (e.g. "ns") is a string-like object. More... | |
static auto | name () |
Representation conversions. | |
template<typename T > | |
static constexpr T | scale (T v) |
Converts a value from the base unit to this one. More... | |
template<typename T > | |
static constexpr T | unscale (T v) |
Converts a value from this scaled unit to the base one. More... | |
template<typename TargetRatio , typename T > | |
static constexpr T | scaleTo (T v) |
Converts a value from the scaled unit to a different TargetRatio . More... | |
template<typename TargetRatio , typename T > | |
static constexpr T | fromRepr (T v) |
Converts a value from TargetRatio scale to this scaled unit. More... | |
Type features | |
static constexpr prefix_t | prefix () |
Returns an instance of the prefix_t type. More... | |
static constexpr baseunit_t | baseUnit () |
Returns an instance of the baseunit_t type. More... | |
static constexpr unit_t | unit () |
Returns an instance of the unit_t type. More... | |
template<typename OU > | |
static constexpr bool | sameBaseUnitAs () |
Returns whether scaled unit U has the same base unit as this one. More... | |
template<typename OU > | |
static constexpr bool | sameUnitAs () |
Returns whether scaled unit U has the same base unit as this one. More... | |
Definition at line 394 of file quantities.h.
using util::quantities::concepts::ScaledUnit< U, R >::baseunit_t = U |
Base, unscaled unit.
Definition at line 396 of file quantities.h.
using util::quantities::concepts::ScaledUnit< U, R >::prefix_t = Prefix<ratio> |
The prefix of the unit.
Definition at line 399 of file quantities.h.
using util::quantities::concepts::ScaledUnit< U, R >::ratio = R |
The ratio to go from the base unit to this one.
Definition at line 398 of file quantities.h.
using util::quantities::concepts::ScaledUnit< U, R >::unit_t = ScaledUnit<U, R> |
Unit with scale (i.e. this object).
Definition at line 397 of file quantities.h.
|
inlinestatic |
Returns an instance of the baseunit_t
type.
Definition at line 466 of file quantities.h.
|
inlinestatic |
Converts a value from TargetRatio
scale to this scaled unit.
Definition at line 449 of file quantities.h.
|
inlinestatic |
Returns full name of the unit (e.g. "nanoseconds") as a string-like object.
Definition at line 418 of file quantities.h.
|
inlinestatic |
Returns an instance of the prefix_t
type.
Definition at line 463 of file quantities.h.
|
inlinestatic |
Returns whether scaled unit U
has the same base unit as this one.
Definition at line 473 of file quantities.h.
|
inlinestatic |
Returns whether scaled unit U
has the same base unit as this one.
Definition at line 478 of file quantities.h.
|
inlinestatic |
Converts a value from the base unit to this one.
Definition at line 431 of file quantities.h.
|
inlinestatic |
Converts a value from the scaled unit to a different TargetRatio
.
Definition at line 441 of file quantities.h.
|
inlinestatic |
Returns short symbol of the unit (e.g. "ns") is a string-like object.
Definition at line 413 of file quantities.h.
|
inlinestatic |
Returns an instance of the unit_t
type.
Definition at line 469 of file quantities.h.
|
inlinestatic |
Converts a value from this scaled unit to the base one.
Definition at line 436 of file quantities.h.