forked from mpusz/mp-units
refactor: 💥 all iec quantity specifications are now deprecated and moved to isq
IEC 80000-13 is a part of ISQ so quantity specifications should be in an `isq` namespace.
This commit is contained in:
@@ -31,6 +31,7 @@ add_mp_units_module(
|
||||
include/mp-units/systems/isq/atomic_and_nuclear_physics.h
|
||||
include/mp-units/systems/isq/base_quantities.h
|
||||
include/mp-units/systems/isq/electromagnetism.h
|
||||
include/mp-units/systems/isq/information_science_and_technology.h
|
||||
include/mp-units/systems/isq/light_and_radiation.h
|
||||
include/mp-units/systems/isq/mechanics.h
|
||||
include/mp-units/systems/isq/si_quantities.h
|
||||
|
||||
@@ -22,57 +22,67 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/bits/module_macros.h>
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/framework/dimension.h>
|
||||
#include <mp-units/framework/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/information_science_and_technology.h>
|
||||
|
||||
MP_UNITS_EXPORT
|
||||
namespace mp_units::iec {
|
||||
|
||||
// dimensions of base quantities
|
||||
// clang-format off
|
||||
inline constexpr struct dim_traffic_intensity final : base_dimension<"A"> {} dim_traffic_intensity;
|
||||
// clang-format on
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto dim_traffic_intensity =
|
||||
isq::dim_traffic_intensity;
|
||||
|
||||
// quantities
|
||||
QUANTITY_SPEC(traffic_intensity, dim_traffic_intensity);
|
||||
QUANTITY_SPEC(traffic_offered_intensity, traffic_intensity);
|
||||
QUANTITY_SPEC(traffic_carried_intensity, traffic_intensity);
|
||||
inline constexpr auto traffic_load = traffic_carried_intensity;
|
||||
QUANTITY_SPEC(mean_queue_length, dimensionless);
|
||||
QUANTITY_SPEC(loss_probability, dimensionless);
|
||||
QUANTITY_SPEC(waiting_probability, dimensionless);
|
||||
QUANTITY_SPEC(call_intensity, inverse(isq::duration));
|
||||
inline constexpr auto calling_rate = call_intensity;
|
||||
QUANTITY_SPEC(completed_call_intensity, call_intensity);
|
||||
QUANTITY_SPEC(storage_capacity, dimensionless, is_kind);
|
||||
inline constexpr auto storage_size = storage_capacity;
|
||||
QUANTITY_SPEC(equivalent_binary_storage_capacity, storage_capacity);
|
||||
QUANTITY_SPEC(transfer_rate, storage_capacity / isq::duration);
|
||||
QUANTITY_SPEC(period_of_data_elements, isq::period, inverse(transfer_rate));
|
||||
QUANTITY_SPEC(binary_digit_rate, transfer_rate);
|
||||
inline constexpr auto bit_rate = binary_digit_rate;
|
||||
QUANTITY_SPEC(period_of_binary_digits, isq::period, inverse(binary_digit_rate));
|
||||
inline constexpr auto bit_period = period_of_binary_digits;
|
||||
QUANTITY_SPEC(equivalent_binary_digit_rate, binary_digit_rate);
|
||||
inline constexpr auto equivalent_bit_rate = bit_rate;
|
||||
QUANTITY_SPEC(modulation_rate, inverse(isq::duration));
|
||||
inline constexpr auto line_digit_rate = modulation_rate;
|
||||
QUANTITY_SPEC(quantizing_distortion_power, isq::power);
|
||||
QUANTITY_SPEC(carrier_power, isq::power);
|
||||
QUANTITY_SPEC(signal_energy_per_binary_digit, carrier_power* period_of_binary_digits);
|
||||
QUANTITY_SPEC(error_probability, dimensionless);
|
||||
QUANTITY_SPEC(Hamming_distance, dimensionless);
|
||||
QUANTITY_SPEC(clock_frequency, isq::frequency);
|
||||
inline constexpr auto clock_rate = clock_frequency;
|
||||
QUANTITY_SPEC(decision_content, dimensionless);
|
||||
|
||||
// TODO how to model information_content and the following quantities???
|
||||
// QUANTITY_SPEC(information_content, ...);
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto traffic_intensity =
|
||||
isq::traffic_intensity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto traffic_offered_intensity =
|
||||
isq::traffic_offered_intensity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto traffic_carried_intensity =
|
||||
isq::traffic_carried_intensity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto traffic_load =
|
||||
isq::traffic_carried_intensity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto mean_queue_length =
|
||||
isq::mean_queue_length;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto loss_probability =
|
||||
isq::loss_probability;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto waiting_probability =
|
||||
isq::waiting_probability;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto call_intensity = isq::call_intensity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto calling_rate = isq::call_intensity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto completed_call_intensity =
|
||||
isq::completed_call_intensity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto storage_capacity =
|
||||
isq::storage_capacity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto storage_size = isq::storage_capacity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto equivalent_binary_storage_capacity =
|
||||
isq::equivalent_binary_storage_capacity;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto transfer_rate = isq::transfer_rate;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto period_of_data_elements =
|
||||
isq::period_of_data_elements;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto binary_digit_rate =
|
||||
isq::binary_digit_rate;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto bit_rate = isq::binary_digit_rate;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto period_of_binary_digits =
|
||||
isq::period_of_binary_digits;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto bit_period =
|
||||
isq::period_of_binary_digits;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto equivalent_binary_digit_rate =
|
||||
isq::equivalent_binary_digit_rate;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto equivalent_bit_rate = isq::bit_rate;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto modulation_rate =
|
||||
isq::modulation_rate;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto line_digit_rate =
|
||||
isq::modulation_rate;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto quantizing_distortion_power =
|
||||
isq::quantizing_distortion_power;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto carrier_power = isq::carrier_power;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto signal_energy_per_binary_digit =
|
||||
isq::signal_energy_per_binary_digit;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto error_probability =
|
||||
isq::error_probability;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto Hamming_distance =
|
||||
isq::Hamming_distance;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto clock_frequency =
|
||||
isq::clock_frequency;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto clock_rate = isq::clock_frequency;
|
||||
[[deprecated("Quantity type moved to the `isq` namespace")]] inline constexpr auto decision_content =
|
||||
isq::decision_content;
|
||||
|
||||
} // namespace mp_units::iec
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <mp-units/bits/module_macros.h>
|
||||
#include <mp-units/systems/iec/quantities.h>
|
||||
#include <mp-units/systems/isq/electromagnetism.h>
|
||||
#include <mp-units/systems/isq/information_science_and_technology.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
@@ -39,11 +40,11 @@ namespace mp_units::iec {
|
||||
inline constexpr struct volt_ampere_reactive_power final : named_unit<"var", si::volt * si::ampere, kind_of<isq::reactive_power>> {} volt_ampere_reactive_power;
|
||||
|
||||
// Information science and technology
|
||||
inline constexpr struct erlang final : named_unit<"E", kind_of<traffic_intensity>> {} erlang;
|
||||
inline constexpr struct bit final : named_unit<"bit", one, kind_of<storage_capacity>> {} bit;
|
||||
inline constexpr struct erlang final : named_unit<"E", kind_of<isq::traffic_intensity>> {} erlang;
|
||||
inline constexpr struct bit final : named_unit<"bit", one, kind_of<isq::storage_capacity>> {} bit;
|
||||
inline constexpr struct octet final : named_unit<"o", mag<8> * bit> {} octet;
|
||||
inline constexpr struct byte final : named_unit<"B", mag<8> * bit> {} byte;
|
||||
inline constexpr struct baud final : named_unit<"Bd", one / si::second, kind_of<modulation_rate>> {} baud;
|
||||
inline constexpr struct baud final : named_unit<"Bd", one / si::second, kind_of<isq::modulation_rate>> {} baud;
|
||||
// clang-format on
|
||||
|
||||
} // namespace mp_units::iec
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <mp-units/systems/isq/atomic_and_nuclear_physics.h>
|
||||
#include <mp-units/systems/isq/base_quantities.h>
|
||||
#include <mp-units/systems/isq/electromagnetism.h>
|
||||
#include <mp-units/systems/isq/information_science_and_technology.h>
|
||||
#include <mp-units/systems/isq/light_and_radiation.h>
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/si_quantities.h>
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// The MIT License (MIT)
|
||||
//
|
||||
// Copyright (c) 2018 Mateusz Pusz
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/bits/module_macros.h>
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/framework/dimension.h>
|
||||
#include <mp-units/framework/quantity_spec.h>
|
||||
#endif
|
||||
|
||||
MP_UNITS_EXPORT
|
||||
namespace mp_units::isq {
|
||||
|
||||
// dimensions of base quantities
|
||||
// clang-format off
|
||||
inline constexpr struct dim_traffic_intensity final : base_dimension<"A"> {} dim_traffic_intensity;
|
||||
// clang-format on
|
||||
|
||||
// quantities
|
||||
QUANTITY_SPEC(traffic_intensity, dim_traffic_intensity);
|
||||
QUANTITY_SPEC(traffic_offered_intensity, traffic_intensity);
|
||||
QUANTITY_SPEC(traffic_carried_intensity, traffic_intensity);
|
||||
inline constexpr auto traffic_load = traffic_carried_intensity;
|
||||
QUANTITY_SPEC(mean_queue_length, dimensionless);
|
||||
QUANTITY_SPEC(loss_probability, dimensionless);
|
||||
QUANTITY_SPEC(waiting_probability, dimensionless);
|
||||
QUANTITY_SPEC(call_intensity, inverse(isq::duration));
|
||||
inline constexpr auto calling_rate = call_intensity;
|
||||
QUANTITY_SPEC(completed_call_intensity, call_intensity);
|
||||
QUANTITY_SPEC(storage_capacity, dimensionless, is_kind);
|
||||
inline constexpr auto storage_size = storage_capacity;
|
||||
QUANTITY_SPEC(equivalent_binary_storage_capacity, storage_capacity);
|
||||
QUANTITY_SPEC(transfer_rate, storage_capacity / isq::duration);
|
||||
QUANTITY_SPEC(period_of_data_elements, isq::period, inverse(transfer_rate));
|
||||
QUANTITY_SPEC(binary_digit_rate, transfer_rate);
|
||||
inline constexpr auto bit_rate = binary_digit_rate;
|
||||
QUANTITY_SPEC(period_of_binary_digits, isq::period, inverse(binary_digit_rate));
|
||||
inline constexpr auto bit_period = period_of_binary_digits;
|
||||
QUANTITY_SPEC(equivalent_binary_digit_rate, binary_digit_rate);
|
||||
inline constexpr auto equivalent_bit_rate = bit_rate;
|
||||
QUANTITY_SPEC(modulation_rate, inverse(isq::duration));
|
||||
inline constexpr auto line_digit_rate = modulation_rate;
|
||||
QUANTITY_SPEC(quantizing_distortion_power, isq::power);
|
||||
QUANTITY_SPEC(carrier_power, isq::power);
|
||||
QUANTITY_SPEC(signal_energy_per_binary_digit, carrier_power* period_of_binary_digits);
|
||||
QUANTITY_SPEC(error_probability, dimensionless);
|
||||
QUANTITY_SPEC(Hamming_distance, dimensionless);
|
||||
QUANTITY_SPEC(clock_frequency, isq::frequency);
|
||||
inline constexpr auto clock_rate = clock_frequency;
|
||||
QUANTITY_SPEC(decision_content, dimensionless);
|
||||
|
||||
// TODO how to model information_content and the following quantities???
|
||||
// QUANTITY_SPEC(information_content, ...);
|
||||
|
||||
} // namespace mp_units::isq
|
||||
Reference in New Issue
Block a user