Types of variables with a unit. More...
Namespaces | |
concepts | |
Infrastructure for the quantities library. | |
datasize_literals | |
Literal constants for data size quantities. | |
details | |
electromagnetism_literals | |
Literal constants for quantities. | |
electronics_literals | |
Literal constants for electronics quantities. | |
energy_literals | |
Literal constants for energy quantities. | |
frequency_literals | |
Literal constants for frequency quantities. | |
intervals | |
points | |
prefixes | |
Definitions of additional prefixes. | |
space_literals | |
Literal constants for space quantities. | |
time_literals | |
Literal constants for time quantities. | |
units | |
Definitions of actual units. | |
Classes | |
struct | NoCategory |
struct | MissingUnit |
String representing a quantity has no unit. More... | |
struct | InvalidUnitPrefix |
String representing a quantity has unsupported unit prefix. More... | |
struct | MismatchingUnit |
String representing a quantity has incompatible unit. More... | |
struct | ValueError |
String representing a quantity has an invalid number. More... | |
struct | ExtraCharactersError |
String representing a quantity has spurious characters after the number. More... | |
Typedefs | |
Data size | |
These time quantities are tied to
| |
template<typename R , typename T = unsigned long long int> | |
using | scaled_byte = concepts::scaled_quantity< units::Byte, R, T > |
The most generic units::Byte -based quantity. More... | |
template<typename T = unsigned long long int> | |
using | byte_as = scaled_byte< std::ratio< 1 >, T > |
Type of data size stored in bytes. More... | |
template<typename T = unsigned long long int> | |
using | bytes_as = byte_as< T > |
Alias for common language habits. More... | |
using | byte = byte_as<> |
Type of data size stored in bytes, in long long precision. More... | |
using | bytes = byte |
Alias for common language habits. More... | |
template<typename T = unsigned long long int> | |
using | kibibyte_as = concepts::rescale< byte_as< T >, prefixes::kibi > |
Type of data size stored in kibibytes. More... | |
template<typename T = unsigned long long int> | |
using | kibibytes_as = kibibyte_as< T > |
Alias for common language habits. More... | |
using | kibibyte = kibibyte_as<> |
Type of data size stored in kibibytes, in long long precision. More... | |
using | kibibytes = kibibyte |
Alias for common language habits. More... | |
template<typename T = unsigned long long int> | |
using | mebibyte_as = concepts::rescale< byte_as< T >, prefixes::mebi > |
Type of data size stored in mebibytes. More... | |
template<typename T = unsigned long long int> | |
using | mebibytes_as = mebibyte_as< T > |
Alias for common language habits. More... | |
using | mebibyte = mebibyte_as<> |
Type of data size stored in mebibytes, in long long precision. More... | |
using | mebibytes = mebibyte |
Alias for common language habits. More... | |
template<typename T = unsigned long long int> | |
using | gibibyte_as = concepts::rescale< byte_as< T >, prefixes::gibi > |
Type of data size stored in gibibytes. More... | |
template<typename T = unsigned long long int> | |
using | gibibytes_as = gibibyte_as< T > |
Alias for common language habits. More... | |
using | gibibyte = gibibyte_as<> |
Type of data size stored in pebibytes, in long long precision. More... | |
using | gibibytes = gibibyte |
Alias for common language habits. More... | |
template<typename T = unsigned long long int> | |
using | tebibyte_as = concepts::rescale< byte_as< T >, prefixes::tebi > |
Type of data size stored in tebibytes. More... | |
template<typename T = unsigned long long int> | |
using | tebibytes_as = tebibyte_as< T > |
Alias for common language habits. More... | |
using | tebibyte = tebibyte_as<> |
Type of data size stored in tebibytes, in long long precision. More... | |
using | tebibytes = tebibyte |
Alias for common language habits. More... | |
template<typename T = unsigned long long int> | |
using | pebibyte_as = concepts::rescale< byte_as< T >, prefixes::pebi > |
Type of data size stored in pebibytes. More... | |
template<typename T = unsigned long long int> | |
using | pebibytes_as = pebibyte_as< T > |
Alias for common language habits. More... | |
using | pebibyte = pebibyte_as<> |
Type of data size stored in pebibytes, in long long precision. More... | |
using | pebibytes = pebibyte |
Alias for common language habits. More... | |
template<typename T = unsigned long long int> | |
using | exbibyte_as = concepts::rescale< byte_as< T >, prefixes::exbi > |
Type of data size stored in exbibytes. More... | |
template<typename T = unsigned long long int> | |
using | exbibytes_as = exbibyte_as< T > |
Alias for common language habits. More... | |
using | exbibyte = exbibyte_as<> |
Type of data size stored in exbibytes, in long long precision. More... | |
using | exbibytes = exbibyte |
Alias for common language habits. More... | |
Charge quantities | |
These charge quantities are tied to
| |
template<typename R , typename T = double> | |
using | scaled_coulomb = concepts::scaled_quantity< units::Coulomb, R, T > |
The most generic units::Coulomb -based quantity. More... | |
template<typename T = double> | |
using | coulomb_as = scaled_coulomb< std::ratio< 1 >, T > |
Type of charge stored in coulomb. More... | |
using | coulomb = coulomb_as<> |
Type of charge stored in coulombs, in double precision. More... | |
template<typename T = double> | |
using | millicoulomb_as = concepts::rescale< coulomb_as< T >, std::milli > |
Type of charge stored in millicoulomb. More... | |
using | millicoulomb = millicoulomb_as<> |
Type of charge stored in millicoulomb, in double precision. More... | |
template<typename T = double> | |
using | microcoulomb_as = concepts::rescale< coulomb_as< T >, std::micro > |
Type of charge stored in microcoulomb. More... | |
using | microcoulomb = microcoulomb_as<> |
Type of charge stored in microcoulomb, in double precision. More... | |
template<typename T = double> | |
using | nanocoulomb_as = concepts::rescale< coulomb_as< T >, std::nano > |
Type of charge stored in nanocoulomb. More... | |
using | nanocoulomb = nanocoulomb_as<> |
Type of charge stored in nanocoulomb, in double precision. More... | |
template<typename T = double> | |
using | picocoulomb_as = concepts::rescale< coulomb_as< T >, std::pico > |
Type of charge stored in picocoulomb. More... | |
using | picocoulomb = picocoulomb_as<> |
Type of charge stored in picocoulomb, in double precision. More... | |
template<typename T = double> | |
using | femtocoulomb_as = concepts::rescale< coulomb_as< T >, std::femto > |
Type of charge stored in femtocoulomb. More... | |
using | femtocoulomb = femtocoulomb_as<> |
Type of charge stored in femtocoulomb, in double precision. More... | |
Electric potential quantities | |
These potential quantities are tied to
| |
template<typename R , typename T = double> | |
using | scaled_volt = concepts::scaled_quantity< units::Volt, R, T > |
The most generic units::Volt -based quantity. More... | |
template<typename T = double> | |
using | volt_as = scaled_volt< std::ratio< 1 >, T > |
Type of potential stored in volt. More... | |
using | volt = volt_as<> |
Type of potential stored in volts, in double precision. More... | |
template<typename T = double> | |
using | millivolt_as = concepts::rescale< volt_as< T >, std::milli > |
Type of potential stored in millivolt. More... | |
using | millivolt = millivolt_as<> |
Type of potential stored in millivolt, in double precision. More... | |
template<typename T = double> | |
using | microvolt_as = concepts::rescale< volt_as< T >, std::micro > |
Type of potential stored in microvolt. More... | |
using | microvolt = microvolt_as<> |
Type of potential stored in microvolt, in double precision. More... | |
template<typename T = double> | |
using | kilovolt_as = concepts::rescale< volt_as< T >, std::kilo > |
Type of potential stored in kilovolt. More... | |
using | kilovolt = kilovolt_as<> |
Type of potential stored in kilovolt, in double precision. More... | |
template<typename T = double> | |
using | megavolt_as = concepts::rescale< volt_as< T >, std::mega > |
Type of potential stored in megavolt. More... | |
using | megavolt = megavolt_as<> |
Type of potential stored in megavolt, in double precision. More... | |
template<typename T = double> | |
using | gigavolt_as = concepts::rescale< volt_as< T >, std::giga > |
Type of potential stored in gigavolt. More... | |
using | gigavolt = gigavolt_as<> |
Type of potential stored in gigavolt, in double precision. More... | |
Ticks | |
These tick quantities are tied to
For this unit in particular, additional options are provided to accommodate the custom of using the unit in plural form: | |
template<typename T = std::ptrdiff_t> | |
using | tick_as = concepts::scaled_quantity< units::Tick, std::ratio< 1 >, T > |
Tick number, represented by the specified type T . More... | |
template<typename T = tick_as<>::value_t> | |
using | ticks_as = tick_as< T > |
Alias for common language habits. More... | |
using | tick = tick_as<> |
Tick number, represented by std::ptrdiff_t . More... | |
using | ticks = tick |
Alias for common language habits. More... | |
using | tick_f = tick_as< float > |
Tick number, represented by float . More... | |
using | ticks_f = tick_f |
Alias for common language habits. More... | |
using | tick_d = tick_as< double > |
Tick number, represented by double . More... | |
using | ticks_d = tick_d |
Alias for common language habits. More... | |
ADC counts | |
These ADC count quantities are tied to
| |
template<typename T = signed short int> | |
using | counts_as = concepts::scaled_quantity< units::Counts, std::ratio< 1 >, T > |
Number of ADC counts, represented by the specified type T . More... | |
using | counts = counts_as<> |
Number of ADC counts, represented by signed short int . More... | |
using | counts_f = counts_as< float > |
Number of ADC counts, represented by float . More... | |
Particle energy quantities | |
These energy quantities are tied to
| |
template<typename R , typename T = double> | |
using | scaled_electronvolt = concepts::scaled_quantity< units::ElectronVolt, R, T > |
The most generic units::ElectronVolt -based quantity. More... | |
template<typename T = double> | |
using | electronvolt_as = scaled_electronvolt< std::ratio< 1 >, T > |
Type of energy stored in electronvolt. More... | |
using | electronvolt = electronvolt_as<> |
Type of energy stored in electronvolts, in double precision. More... | |
template<typename T = double> | |
using | microelectronvolt_as = concepts::rescale< electronvolt_as< T >, std::micro > |
Type of energy stored in microelectronvolt. More... | |
using | microelectronvolt = microelectronvolt_as<> |
Type of energy stored in microelectronvolt, in double precision. More... | |
template<typename T = double> | |
using | millielectronvolt_as = concepts::rescale< electronvolt_as< T >, std::milli > |
Type of energy stored in millielectronvolt. More... | |
using | millielectronvolt = millielectronvolt_as<> |
Type of energy stored in millielectronvolt, in double precision. More... | |
template<typename T = double> | |
using | kiloelectronvolt_as = concepts::rescale< electronvolt_as< T >, std::kilo > |
Type of energy stored in kiloelectronvolt. More... | |
using | kiloelectronvolt = kiloelectronvolt_as<> |
Type of energy stored in kiloelectronvolt, in double precision. More... | |
template<typename T = double> | |
using | megaelectronvolt_as = concepts::rescale< electronvolt_as< T >, std::mega > |
Type of energy stored in megaelectronvolt. More... | |
using | megaelectronvolt = megaelectronvolt_as<> |
Type of energy stored in megaelectronvolt, in double precision. More... | |
template<typename T = double> | |
using | gigaelectronvolt_as = concepts::rescale< electronvolt_as< T >, std::giga > |
Type of energy stored in gigaelectronvolt. More... | |
using | gigaelectronvolt = gigaelectronvolt_as<> |
Type of energy stored in gigaelectronvolt, in double precision. More... | |
template<typename T = double> | |
using | teraelectronvolt_as = concepts::rescale< electronvolt_as< T >, std::tera > |
Type of energy stored in teraelectronvolt. More... | |
using | teraelectronvolt = teraelectronvolt_as<> |
Type of energy stored in teraelectronvolt, in double precision. More... | |
Frequency quantities | |
These frequency quantities are tied to
| |
template<typename R , typename T = double> | |
using | scaled_hertz = concepts::scaled_quantity< units::Hertz, R, T > |
The most generic units::Hertz -based quantity. More... | |
template<typename T = double> | |
using | hertz_as = scaled_hertz< std::ratio< 1 >, T > |
Type of frequency stored in hertz. More... | |
using | hertz = hertz_as<> |
Type of frequency stored in hertz, in double precision. More... | |
template<typename T = double> | |
using | kilohertz_as = concepts::rescale< hertz_as< T >, std::kilo > |
Type of frequency stored in kilohertz. More... | |
using | kilohertz = kilohertz_as<> |
Type of frequency stored in kilohertz, in double precision. More... | |
template<typename T = double> | |
using | megahertz_as = concepts::rescale< hertz_as< T >, std::mega > |
Type of frequency stored in megahertz. More... | |
using | megahertz = megahertz_as<> |
Type of frequency stored in megahertz, in double precision. More... | |
template<typename T = double> | |
using | gigahertz_as = concepts::rescale< hertz_as< T >, std::giga > |
Type of frequency stored in gigahertz. More... | |
using | gigahertz = gigahertz_as<> |
Type of frequency stored in gigahertz, in double precision. More... | |
Time quantities | |
These time quantities are tied to
For this unit in particular, additional options are provided to accommodate the custom of using the unit in plural form: | |
template<typename R , typename T = double> | |
using | scaled_second = concepts::scaled_quantity< units::Second, R, T > |
The most generic units::Second -based quantity. More... | |
template<typename T = double> | |
using | second_as = scaled_second< std::ratio< 1 >, T > |
Type of time stored in seconds. More... | |
template<typename T = double> | |
using | seconds_as = second_as< T > |
Alias for common language habits. More... | |
using | second = second_as<> |
Type of time stored in seconds, in double precision. More... | |
using | seconds = second |
Alias for common language habits. More... | |
template<typename T = double> | |
using | millisecond_as = concepts::rescale< second_as< T >, std::milli > |
Type of time stored in milliseconds. More... | |
template<typename T = double> | |
using | milliseconds_as = millisecond_as< T > |
Alias for common language habits. More... | |
using | millisecond = millisecond_as<> |
Type of time stored in milliseconds, in double precision. More... | |
using | milliseconds = millisecond |
Alias for common language habits. More... | |
template<typename T = double> | |
using | microsecond_as = concepts::rescale< second_as< T >, std::micro > |
Type of time stored in microseconds. More... | |
template<typename T = double> | |
using | microseconds_as = microsecond_as< T > |
Alias for common language habits. More... | |
using | microsecond = microsecond_as<> |
Type of time stored in microseconds, in double precision. More... | |
using | microseconds = microsecond |
Alias for common language habits. More... | |
template<typename T = double> | |
using | nanosecond_as = concepts::rescale< second_as< T >, std::nano > |
Type of time stored in nanoseconds. More... | |
template<typename T = double> | |
using | nanoseconds_as = nanosecond_as< T > |
Alias for common language habits. More... | |
using | nanosecond = nanosecond_as<> |
Type of time stored in nanoseconds, in double precision. More... | |
using | nanoseconds = nanosecond |
Alias for common language habits. More... | |
template<typename T = double> | |
using | picosecond_as = concepts::rescale< second_as< T >, std::pico > |
Type of time stored in picoseconds. More... | |
template<typename T = double> | |
using | picoseconds_as = picosecond_as< T > |
Alias for common language habits. More... | |
using | picosecond = picosecond_as<> |
Type of time stored in picoseconds, in double precision. More... | |
using | picoseconds = picosecond |
Alias for common language habits. More... | |
Linear space quantities | |
These space quantities are tied to
For this unit in particular, additional options are provided to accommodate the custom of using the unit in plural form: | |
template<typename R , typename T = double> | |
using | scaled_meter = concepts::scaled_quantity< units::Meter, R, T > |
The most generic units::Meter -based quantity. More... | |
template<typename T = double> | |
using | meter_as = scaled_meter< std::ratio< 1 >, T > |
Type of space stored in meters. More... | |
template<typename T = double> | |
using | meters_as = meter_as< T > |
Alias for common language habits. More... | |
using | meter = meter_as<> |
Type of space stored in meters, in double precision. More... | |
using | meters = meter |
Alias for common language habits. More... | |
template<typename T = double> | |
using | kilometer_as = concepts::rescale< meter_as< T >, std::kilo > |
Type of space stored in kilometers. More... | |
template<typename T = double> | |
using | kilometers_as = kilometer_as< T > |
Alias for common language habits. More... | |
using | kilometer = kilometer_as<> |
Type of space stored in kilometers, in double precision. More... | |
using | kilometers = kilometer |
Alias for common language habits. More... | |
template<typename T = double> | |
using | centimeter_as = concepts::rescale< meter_as< T >, std::centi > |
Type of space stored in centimeters. More... | |
template<typename T = double> | |
using | centimeters_as = centimeter_as< T > |
Alias for common language habits. More... | |
using | centimeter = centimeter_as<> |
Type of space stored in centimeters, in double precision. More... | |
using | centimeters = centimeter |
Alias for common language habits. More... | |
template<typename T = double> | |
using | millimeter_as = concepts::rescale< meter_as< T >, std::milli > |
Type of space stored in millimeters. More... | |
template<typename T = double> | |
using | millimeters_as = millimeter_as< T > |
Alias for common language habits. More... | |
using | millimeter = millimeter_as<> |
Type of space stored in millimeters, in double precision. More... | |
using | millimeters = millimeter |
Alias for common language habits. More... | |
template<typename T = double> | |
using | micrometer_as = concepts::rescale< meter_as< T >, std::micro > |
Type of space stored in micrometers. More... | |
template<typename T = double> | |
using | micrometers_as = micrometer_as< T > |
Alias for common language habits. More... | |
using | micrometer = micrometer_as<> |
Type of space stored in micrometers, in double precision. More... | |
using | micrometers = micrometer |
Alias for common language habits. More... | |
template<typename T = double> | |
using | nanometer_as = concepts::rescale< meter_as< T >, std::nano > |
Type of space stored in nanometers. More... | |
template<typename T = double> | |
using | nanometers_as = nanometer_as< T > |
Alias for common language habits. More... | |
using | nanometer = nanometer_as<> |
Type of space stored in nanometers, in double precision. More... | |
using | nanometers = nanometer |
Alias for common language habits. More... | |
template<typename T = double> | |
using | picometer_as = concepts::rescale< meter_as< T >, std::pico > |
Type of space stored in picometers. More... | |
template<typename T = double> | |
using | picometers_as = picometer_as< T > |
Alias for common language habits. More... | |
using | picometer = picometer_as<> |
Type of space stored in picometers, in double precision. More... | |
using | picometers = picometer |
Alias for common language habits. More... | |
template<typename T = double> | |
using | femtometer_as = concepts::rescale< meter_as< T >, std::femto > |
Type of space stored in femtometers. More... | |
template<typename T = double> | |
using | femtometers_as = femtometer_as< T > |
Alias for common language habits. More... | |
using | femtometer = femtometer_as<> |
Type of space stored in femtometers, in double precision. More... | |
using | femtometers = femtometer |
Alias for common language habits. More... | |
Functions | |
template<typename IV > | |
IV | makeInterval (std::string_view s, bool unitOptional=false) |
Returns an interval of the specified type parsed from a string. More... | |
template<typename IV > | |
IV | makeInterval (std::string const &s, bool unitOptional=false) |
template<typename IV > | |
IV | makeInterval (char const *s, bool unitOptional=false) |
template<typename PT > | |
PT | makePoint (std::string_view s, bool unitOptional=false) |
Returns a point of the specified type parsed from a string. More... | |
template<typename PT > | |
PT | makePoint (std::string const &s, bool unitOptional=false) |
template<typename PT > | |
PT | makePoint (char const *s, bool unitOptional=false) |
template<typename Quantity > | |
Quantity | makeQuantity (std::string_view s, bool unitOptional=false) |
Returns a quantity of the specified type parsed from a string. More... | |
template<typename Quantity > | |
Quantity | makeQuantity (std::string const &s, bool unitOptional=false) |
template<typename Quantity > | |
Quantity | makeQuantity (char const *s, bool unitOptional=false) |
Types of variables with a unit.
This library uses the following concepts, vaguely inspired by Boost Units library:
util::quantities::UnitBase
ScaledUnit
Quantity
class.Differently from Boost Units library, this one does not provide dimensional analysis (hence the lack of need for the "dimension" concept.
The following examples use units of time, whose definitions are actually provided elsewhere in this library (see lardataalg/Utilities/quantites/spacetime.h
and the unit util::quantities::units::Second
).
The code of this library is entirely under this namespace (util::quantities
). It is organised in a few subspaces:
concepts
contains all the infrastructure for the library, including the definition of classes representing a unit, a quantity, and moredetails
: implementation details (users should not bother with them)units
contains the definitions of actual units (e.g. seconds, ampere...)The file lardataalg/Utilities/quantities.h
does not contain the definition of any actual quantity nor unit. Quantity libraries are expected to include this header, extend the namespace units
to include the units they need, and finally adding the quantites needed directly in this very namespace.
An example of adding the definition of "ampere":
sv
converts the literal string into a std::string_view
, which is one of the few string types which can be defined at compile time (constexpr
) and have a decently complete interface.Another example may be data size:
This example mostly works, with the following exceptions:
using util::quantities::byte = typedef byte_as<> |
Type of data size stored in bytes, in long long
precision.
Definition at line 98 of file datasize.h.
using util::quantities::byte_as = typedef scaled_byte<std::ratio<1>, T> |
Type of data size stored in bytes.
Definition at line 91 of file datasize.h.
using util::quantities::bytes = typedef byte |
Alias for common language habits.
Definition at line 101 of file datasize.h.
using util::quantities::bytes_as = typedef byte_as<T> |
Alias for common language habits.
Definition at line 95 of file datasize.h.
using util::quantities::centimeter = typedef centimeter_as<> |
Type of space stored in centimeters, in double precision.
Definition at line 434 of file spacetime.h.
using util::quantities::centimeter_as = typedef concepts::rescale<meter_as<T>, std::centi> |
Type of space stored in centimeters.
Definition at line 427 of file spacetime.h.
using util::quantities::centimeters = typedef centimeter |
Alias for common language habits.
Definition at line 437 of file spacetime.h.
using util::quantities::centimeters_as = typedef centimeter_as<T> |
Alias for common language habits.
Definition at line 431 of file spacetime.h.
using util::quantities::coulomb = typedef coulomb_as<> |
Type of charge stored in coulombs, in double precision.
Definition at line 80 of file electromagnetism.h.
using util::quantities::coulomb_as = typedef scaled_coulomb<std::ratio<1>, T> |
Type of charge stored in coulomb.
Definition at line 77 of file electromagnetism.h.
using util::quantities::counts = typedef counts_as<> |
Number of ADC counts, represented by signed short int
.
Definition at line 116 of file electronics.h.
using util::quantities::counts_as = typedef concepts::scaled_quantity<units::Counts, std::ratio<1>, T> |
Number of ADC counts, represented by the specified type T
.
Definition at line 113 of file electronics.h.
using util::quantities::counts_f = typedef counts_as<float> |
Number of ADC counts, represented by float
.
Definition at line 119 of file electronics.h.
using util::quantities::electronvolt = typedef electronvolt_as<> |
using util::quantities::electronvolt_as = typedef scaled_electronvolt<std::ratio<1>, T> |
using util::quantities::exbibyte = typedef exbibyte_as<> |
Type of data size stored in exbibytes, in long long
precision.
Definition at line 200 of file datasize.h.
using util::quantities::exbibyte_as = typedef concepts::rescale<byte_as<T>, prefixes::exbi> |
Type of data size stored in exbibytes.
Definition at line 193 of file datasize.h.
using util::quantities::exbibytes = typedef exbibyte |
Alias for common language habits.
Definition at line 203 of file datasize.h.
using util::quantities::exbibytes_as = typedef exbibyte_as<T> |
Alias for common language habits.
Definition at line 197 of file datasize.h.
using util::quantities::femtocoulomb = typedef femtocoulomb_as<> |
Type of charge stored in femtocoulomb, in double precision.
Definition at line 130 of file electromagnetism.h.
using util::quantities::femtocoulomb_as = typedef concepts::rescale<coulomb_as<T>, std::femto> |
Type of charge stored in femtocoulomb.
Definition at line 127 of file electromagnetism.h.
using util::quantities::femtometer = typedef femtometer_as<> |
Type of space stored in femtometers, in double precision.
Definition at line 519 of file spacetime.h.
using util::quantities::femtometer_as = typedef concepts::rescale<meter_as<T>, std::femto> |
Type of space stored in femtometers.
Definition at line 512 of file spacetime.h.
using util::quantities::femtometers = typedef femtometer |
Alias for common language habits.
Definition at line 522 of file spacetime.h.
using util::quantities::femtometers_as = typedef femtometer_as<T> |
Alias for common language habits.
Definition at line 516 of file spacetime.h.
using util::quantities::gibibyte = typedef gibibyte_as<> |
Type of data size stored in pebibytes, in long long
precision.
Definition at line 149 of file datasize.h.
using util::quantities::gibibyte_as = typedef concepts::rescale<byte_as<T>, prefixes::gibi> |
Type of data size stored in gibibytes.
Definition at line 142 of file datasize.h.
using util::quantities::gibibytes = typedef gibibyte |
Alias for common language habits.
Definition at line 152 of file datasize.h.
using util::quantities::gibibytes_as = typedef gibibyte_as<T> |
Alias for common language habits.
Definition at line 146 of file datasize.h.
using util::quantities::gigaelectronvolt = typedef gigaelectronvolt_as<> |
using util::quantities::gigaelectronvolt_as = typedef concepts::rescale<electronvolt_as<T>, std::giga> |
using util::quantities::gigahertz = typedef gigahertz_as<> |
Type of frequency stored in gigahertz, in double precision.
Definition at line 111 of file frequency.h.
using util::quantities::gigahertz_as = typedef concepts::rescale<hertz_as<T>, std::giga> |
Type of frequency stored in gigahertz.
Definition at line 108 of file frequency.h.
using util::quantities::gigavolt = typedef gigavolt_as<> |
Type of potential stored in gigavolt, in double precision.
Definition at line 216 of file electromagnetism.h.
using util::quantities::gigavolt_as = typedef concepts::rescale<volt_as<T>, std::giga> |
Type of potential stored in gigavolt.
Definition at line 213 of file electromagnetism.h.
using util::quantities::hertz = typedef hertz_as<> |
Type of frequency stored in hertz, in double precision.
Definition at line 81 of file frequency.h.
using util::quantities::hertz_as = typedef scaled_hertz<std::ratio<1>, T> |
Type of frequency stored in hertz.
Definition at line 78 of file frequency.h.
using util::quantities::kibibyte = typedef kibibyte_as<> |
Type of data size stored in kibibytes, in long long
precision.
Definition at line 115 of file datasize.h.
using util::quantities::kibibyte_as = typedef concepts::rescale<byte_as<T>, prefixes::kibi> |
Type of data size stored in kibibytes.
Definition at line 108 of file datasize.h.
using util::quantities::kibibytes = typedef kibibyte |
Alias for common language habits.
Definition at line 118 of file datasize.h.
using util::quantities::kibibytes_as = typedef kibibyte_as<T> |
Alias for common language habits.
Definition at line 112 of file datasize.h.
using util::quantities::kiloelectronvolt = typedef kiloelectronvolt_as<> |
using util::quantities::kiloelectronvolt_as = typedef concepts::rescale<electronvolt_as<T>, std::kilo> |
using util::quantities::kilohertz = typedef kilohertz_as<> |
Type of frequency stored in kilohertz, in double precision.
Definition at line 91 of file frequency.h.
using util::quantities::kilohertz_as = typedef concepts::rescale<hertz_as<T>, std::kilo> |
Type of frequency stored in kilohertz.
Definition at line 88 of file frequency.h.
using util::quantities::kilometer = typedef kilometer_as<> |
Type of space stored in kilometers, in double precision.
Definition at line 417 of file spacetime.h.
using util::quantities::kilometer_as = typedef concepts::rescale<meter_as<T>, std::kilo> |
Type of space stored in kilometers.
Definition at line 410 of file spacetime.h.
using util::quantities::kilometers = typedef kilometer |
Alias for common language habits.
Definition at line 420 of file spacetime.h.
using util::quantities::kilometers_as = typedef kilometer_as<T> |
Alias for common language habits.
Definition at line 414 of file spacetime.h.
using util::quantities::kilovolt = typedef kilovolt_as<> |
Type of potential stored in kilovolt, in double precision.
Definition at line 196 of file electromagnetism.h.
using util::quantities::kilovolt_as = typedef concepts::rescale<volt_as<T>, std::kilo> |
Type of potential stored in kilovolt.
Definition at line 193 of file electromagnetism.h.
using util::quantities::mebibyte = typedef mebibyte_as<> |
Type of data size stored in mebibytes, in long long
precision.
Definition at line 132 of file datasize.h.
using util::quantities::mebibyte_as = typedef concepts::rescale<byte_as<T>, prefixes::mebi> |
Type of data size stored in mebibytes.
Definition at line 125 of file datasize.h.
using util::quantities::mebibytes = typedef mebibyte |
Alias for common language habits.
Definition at line 135 of file datasize.h.
using util::quantities::mebibytes_as = typedef mebibyte_as<T> |
Alias for common language habits.
Definition at line 129 of file datasize.h.
using util::quantities::megaelectronvolt = typedef megaelectronvolt_as<> |
using util::quantities::megaelectronvolt_as = typedef concepts::rescale<electronvolt_as<T>, std::mega> |
using util::quantities::megahertz = typedef megahertz_as<> |
Type of frequency stored in megahertz, in double precision.
Definition at line 101 of file frequency.h.
using util::quantities::megahertz_as = typedef concepts::rescale<hertz_as<T>, std::mega> |
Type of frequency stored in megahertz.
Definition at line 98 of file frequency.h.
using util::quantities::megavolt = typedef megavolt_as<> |
Type of potential stored in megavolt, in double precision.
Definition at line 206 of file electromagnetism.h.
using util::quantities::megavolt_as = typedef concepts::rescale<volt_as<T>, std::mega> |
Type of potential stored in megavolt.
Definition at line 203 of file electromagnetism.h.
using util::quantities::meter = typedef meter_as<> |
Type of space stored in meters, in double precision.
Definition at line 400 of file spacetime.h.
using util::quantities::meter_as = typedef scaled_meter<std::ratio<1>, T> |
Type of space stored in meters.
Definition at line 393 of file spacetime.h.
using util::quantities::meters = typedef meter |
Alias for common language habits.
Definition at line 403 of file spacetime.h.
using util::quantities::meters_as = typedef meter_as<T> |
Alias for common language habits.
Definition at line 397 of file spacetime.h.
using util::quantities::microcoulomb = typedef microcoulomb_as<> |
Type of charge stored in microcoulomb, in double precision.
Definition at line 100 of file electromagnetism.h.
using util::quantities::microcoulomb_as = typedef concepts::rescale<coulomb_as<T>, std::micro> |
Type of charge stored in microcoulomb.
Definition at line 97 of file electromagnetism.h.
using util::quantities::microelectronvolt = typedef microelectronvolt_as<> |
using util::quantities::microelectronvolt_as = typedef concepts::rescale<electronvolt_as<T>, std::micro> |
using util::quantities::micrometer = typedef micrometer_as<> |
Type of space stored in micrometers, in double precision.
Definition at line 468 of file spacetime.h.
using util::quantities::micrometer_as = typedef concepts::rescale<meter_as<T>, std::micro> |
Type of space stored in micrometers.
Definition at line 461 of file spacetime.h.
using util::quantities::micrometers = typedef micrometer |
Alias for common language habits.
Definition at line 471 of file spacetime.h.
using util::quantities::micrometers_as = typedef micrometer_as<T> |
Alias for common language habits.
Definition at line 465 of file spacetime.h.
using util::quantities::microsecond = typedef microsecond_as<> |
Type of time stored in microseconds, in double precision.
Definition at line 119 of file spacetime.h.
using util::quantities::microsecond_as = typedef concepts::rescale<second_as<T>, std::micro> |
Type of time stored in microseconds.
Definition at line 112 of file spacetime.h.
using util::quantities::microseconds = typedef microsecond |
Alias for common language habits.
Definition at line 122 of file spacetime.h.
using util::quantities::microseconds_as = typedef microsecond_as<T> |
Alias for common language habits.
Definition at line 116 of file spacetime.h.
using util::quantities::microvolt = typedef microvolt_as<> |
Type of potential stored in microvolt, in double precision.
Definition at line 186 of file electromagnetism.h.
using util::quantities::microvolt_as = typedef concepts::rescale<volt_as<T>, std::micro> |
Type of potential stored in microvolt.
Definition at line 183 of file electromagnetism.h.
using util::quantities::millicoulomb = typedef millicoulomb_as<> |
Type of charge stored in millicoulomb, in double precision.
Definition at line 90 of file electromagnetism.h.
using util::quantities::millicoulomb_as = typedef concepts::rescale<coulomb_as<T>, std::milli> |
Type of charge stored in millicoulomb.
Definition at line 87 of file electromagnetism.h.
using util::quantities::millielectronvolt = typedef millielectronvolt_as<> |
using util::quantities::millielectronvolt_as = typedef concepts::rescale<electronvolt_as<T>, std::milli> |
using util::quantities::millimeter = typedef millimeter_as<> |
Type of space stored in millimeters, in double precision.
Definition at line 451 of file spacetime.h.
using util::quantities::millimeter_as = typedef concepts::rescale<meter_as<T>, std::milli> |
Type of space stored in millimeters.
Definition at line 444 of file spacetime.h.
using util::quantities::millimeters = typedef millimeter |
Alias for common language habits.
Definition at line 454 of file spacetime.h.
using util::quantities::millimeters_as = typedef millimeter_as<T> |
Alias for common language habits.
Definition at line 448 of file spacetime.h.
using util::quantities::millisecond = typedef millisecond_as<> |
Type of time stored in milliseconds, in double precision.
Definition at line 102 of file spacetime.h.
using util::quantities::millisecond_as = typedef concepts::rescale<second_as<T>, std::milli> |
Type of time stored in milliseconds.
Definition at line 95 of file spacetime.h.
using util::quantities::milliseconds = typedef millisecond |
Alias for common language habits.
Definition at line 105 of file spacetime.h.
using util::quantities::milliseconds_as = typedef millisecond_as<T> |
Alias for common language habits.
Definition at line 99 of file spacetime.h.
using util::quantities::millivolt = typedef millivolt_as<> |
Type of potential stored in millivolt, in double precision.
Definition at line 176 of file electromagnetism.h.
using util::quantities::millivolt_as = typedef concepts::rescale<volt_as<T>, std::milli> |
Type of potential stored in millivolt.
Definition at line 173 of file electromagnetism.h.
using util::quantities::nanocoulomb = typedef nanocoulomb_as<> |
Type of charge stored in nanocoulomb, in double precision.
Definition at line 110 of file electromagnetism.h.
using util::quantities::nanocoulomb_as = typedef concepts::rescale<coulomb_as<T>, std::nano> |
Type of charge stored in nanocoulomb.
Definition at line 107 of file electromagnetism.h.
using util::quantities::nanometer = typedef nanometer_as<> |
Type of space stored in nanometers, in double precision.
Definition at line 485 of file spacetime.h.
using util::quantities::nanometer_as = typedef concepts::rescale<meter_as<T>, std::nano> |
Type of space stored in nanometers.
Definition at line 478 of file spacetime.h.
using util::quantities::nanometers = typedef nanometer |
Alias for common language habits.
Definition at line 488 of file spacetime.h.
using util::quantities::nanometers_as = typedef nanometer_as<T> |
Alias for common language habits.
Definition at line 482 of file spacetime.h.
using util::quantities::nanosecond = typedef nanosecond_as<> |
Type of time stored in nanoseconds, in double precision.
Definition at line 136 of file spacetime.h.
using util::quantities::nanosecond_as = typedef concepts::rescale<second_as<T>, std::nano> |
Type of time stored in nanoseconds.
Definition at line 129 of file spacetime.h.
using util::quantities::nanoseconds = typedef nanosecond |
Alias for common language habits.
Definition at line 139 of file spacetime.h.
using util::quantities::nanoseconds_as = typedef nanosecond_as<T> |
Alias for common language habits.
Definition at line 133 of file spacetime.h.
using util::quantities::pebibyte = typedef pebibyte_as<> |
Type of data size stored in pebibytes, in long long
precision.
Definition at line 183 of file datasize.h.
using util::quantities::pebibyte_as = typedef concepts::rescale<byte_as<T>, prefixes::pebi> |
Type of data size stored in pebibytes.
Definition at line 176 of file datasize.h.
using util::quantities::pebibytes = typedef pebibyte |
Alias for common language habits.
Definition at line 186 of file datasize.h.
using util::quantities::pebibytes_as = typedef pebibyte_as<T> |
Alias for common language habits.
Definition at line 180 of file datasize.h.
using util::quantities::picocoulomb = typedef picocoulomb_as<> |
Type of charge stored in picocoulomb, in double precision.
Definition at line 120 of file electromagnetism.h.
using util::quantities::picocoulomb_as = typedef concepts::rescale<coulomb_as<T>, std::pico> |
Type of charge stored in picocoulomb.
Definition at line 117 of file electromagnetism.h.
using util::quantities::picometer = typedef picometer_as<> |
Type of space stored in picometers, in double precision.
Definition at line 502 of file spacetime.h.
using util::quantities::picometer_as = typedef concepts::rescale<meter_as<T>, std::pico> |
Type of space stored in picometers.
Definition at line 495 of file spacetime.h.
using util::quantities::picometers = typedef picometer |
Alias for common language habits.
Definition at line 505 of file spacetime.h.
using util::quantities::picometers_as = typedef picometer_as<T> |
Alias for common language habits.
Definition at line 499 of file spacetime.h.
using util::quantities::picosecond = typedef picosecond_as<> |
Type of time stored in picoseconds, in double precision.
Definition at line 153 of file spacetime.h.
using util::quantities::picosecond_as = typedef concepts::rescale<second_as<T>, std::pico> |
Type of time stored in picoseconds.
Definition at line 146 of file spacetime.h.
using util::quantities::picoseconds = typedef picosecond |
Alias for common language habits.
Definition at line 156 of file spacetime.h.
using util::quantities::picoseconds_as = typedef picosecond_as<T> |
Alias for common language habits.
Definition at line 150 of file spacetime.h.
using util::quantities::scaled_byte = typedef concepts::scaled_quantity<units::Byte, R, T> |
The most generic units::Byte
-based quantity.
Definition at line 84 of file datasize.h.
using util::quantities::scaled_coulomb = typedef concepts::scaled_quantity<units::Coulomb, R, T> |
The most generic units::Coulomb
-based quantity.
Definition at line 70 of file electromagnetism.h.
using util::quantities::scaled_electronvolt = typedef concepts::scaled_quantity<units::ElectronVolt, R, T> |
The most generic units::ElectronVolt
-based quantity.
using util::quantities::scaled_hertz = typedef concepts::scaled_quantity<units::Hertz, R, T> |
The most generic units::Hertz
-based quantity.
Definition at line 71 of file frequency.h.
using util::quantities::scaled_meter = typedef concepts::scaled_quantity<units::Meter, R, T> |
The most generic units::Meter
-based quantity.
Definition at line 386 of file spacetime.h.
using util::quantities::scaled_second = typedef concepts::scaled_quantity<units::Second, R, T> |
The most generic units::Second
-based quantity.
Definition at line 71 of file spacetime.h.
using util::quantities::scaled_volt = typedef concepts::scaled_quantity<units::Volt, R, T> |
The most generic units::Volt
-based quantity.
Definition at line 156 of file electromagnetism.h.
using util::quantities::second = typedef second_as<> |
Type of time stored in seconds, in double precision.
Definition at line 85 of file spacetime.h.
using util::quantities::second_as = typedef scaled_second<std::ratio<1>, T> |
Type of time stored in seconds.
Definition at line 78 of file spacetime.h.
using util::quantities::seconds = typedef second |
Alias for common language habits.
Definition at line 88 of file spacetime.h.
using util::quantities::seconds_as = typedef second_as<T> |
Alias for common language habits.
Definition at line 82 of file spacetime.h.
using util::quantities::tebibyte = typedef tebibyte_as<> |
Type of data size stored in tebibytes, in long long
precision.
Definition at line 166 of file datasize.h.
using util::quantities::tebibyte_as = typedef concepts::rescale<byte_as<T>, prefixes::tebi> |
Type of data size stored in tebibytes.
Definition at line 159 of file datasize.h.
using util::quantities::tebibytes = typedef tebibyte |
Alias for common language habits.
Definition at line 169 of file datasize.h.
using util::quantities::tebibytes_as = typedef tebibyte_as<T> |
Alias for common language habits.
Definition at line 163 of file datasize.h.
using util::quantities::teraelectronvolt = typedef teraelectronvolt_as<> |
using util::quantities::teraelectronvolt_as = typedef concepts::rescale<electronvolt_as<T>, std::tera> |
using util::quantities::tick = typedef tick_as<> |
Tick number, represented by std::ptrdiff_t
.
Definition at line 75 of file electronics.h.
using util::quantities::tick_as = typedef concepts::scaled_quantity<units::Tick, std::ratio<1>, T> |
Tick number, represented by the specified type T
.
Definition at line 68 of file electronics.h.
using util::quantities::tick_d = typedef tick_as<double> |
Tick number, represented by double
.
Definition at line 87 of file electronics.h.
using util::quantities::tick_f = typedef tick_as<float> |
Tick number, represented by float
.
Definition at line 81 of file electronics.h.
using util::quantities::ticks = typedef tick |
Alias for common language habits.
Definition at line 78 of file electronics.h.
using util::quantities::ticks_as = typedef tick_as<T> |
Alias for common language habits.
Definition at line 72 of file electronics.h.
using util::quantities::ticks_d = typedef tick_d |
Alias for common language habits.
Definition at line 90 of file electronics.h.
using util::quantities::ticks_f = typedef tick_f |
Alias for common language habits.
Definition at line 84 of file electronics.h.
using util::quantities::volt = typedef volt_as<> |
Type of potential stored in volts, in double precision.
Definition at line 166 of file electromagnetism.h.
using util::quantities::volt_as = typedef scaled_volt<std::ratio<1>, T> |
Type of potential stored in volt.
Definition at line 163 of file electromagnetism.h.
IV util::quantities::makeInterval | ( | std::string_view | s, |
bool | unitOptional = false |
||
) |
Returns an interval of the specified type parsed from a string.
IV | the type of quantity interval to be returned |
s | the string to be parsed |
unitOptional | (default: false ) whether unit is not required in s |
MissingUnit | s does not contain the required unit |
ValueError | the numerical value in s is not parseable |
ExtraCharactersError | spurious characters after the numeric value |
util::makeQuantity()
This function behaves like util::makeQuantity()
.
Definition at line 1205 of file intervals.h.
IV util::quantities::makeInterval | ( | std::string const & | s, |
bool | unitOptional = false |
||
) |
Definition at line 1215 of file intervals.h.
IV util::quantities::makeInterval | ( | char const * | s, |
bool | unitOptional = false |
||
) |
Definition at line 1225 of file intervals.h.
PT util::quantities::makePoint | ( | std::string_view | s, |
bool | unitOptional = false |
||
) |
Returns a point of the specified type parsed from a string.
PT | the type of quantity point to be returned |
s | the string to be parsed |
unitOptional | (default: false ) whether unit is not required in s |
MissingUnit | s does not contain the required unit |
ValueError | the numerical value in s is not parseable |
ExtraCharactersError | spurious characters after the numeric value |
util::makeQuantity()
This function behaves like util::makeQuantity()
.
Definition at line 1235 of file intervals.h.
PT util::quantities::makePoint | ( | std::string const & | s, |
bool | unitOptional = false |
||
) |
Definition at line 1245 of file intervals.h.
PT util::quantities::makePoint | ( | char const * | s, |
bool | unitOptional = false |
||
) |
Definition at line 1255 of file intervals.h.
Quantity util::quantities::makeQuantity | ( | std::string_view | s, |
bool | unitOptional = false |
||
) |
Returns a quantity of the specified type parsed from a string.
Quantity | the quantity to be returned |
s | the string to be parsed |
unitOptional | (default: false ) whether unit is not required in s |
MissingUnit | s does not contain the required unit |
ValueError | the numerical value in s is not parseable |
ExtraCharactersError | spurious characters after the numeric value (including an unrecognised unit prefix) |
A quantity of type Quantity
is returned, whose value is interpreted from the content of s
. The standard format includes a real number, a space and a unit symbol. If unitOptional
is false
, that unit is required, otherwise it is optional and defaults to the unit and scale in Quantity
. The base unit in s
, when present, must exactly match the base unit of Quantity
; the scale may differ, in which case the proper conversion is applied.
Example:
will assign to t
the value 7000
.
Definition at line 1690 of file quantities.h.
Quantity util::quantities::makeQuantity | ( | std::string const & | s, |
bool | unitOptional = false |
||
) |
Definition at line 1653 of file quantities.h.
Quantity util::quantities::makeQuantity | ( | char const * | s, |
bool | unitOptional = false |
||
) |
Definition at line 1700 of file quantities.h.