refactor: file tree with systems defninitions refactored to limit ODR issues

Relates to #32 as with this commit we created something like modules for derived quantities
This commit is contained in:
Mateusz Pusz
2020-09-11 18:11:25 +02:00
parent 2c36f21716
commit 2a56438f1c
207 changed files with 965 additions and 456 deletions

View File

@@ -1,4 +1,4 @@
Absorbed Dose
=============
.. doxygenfile:: si/absorbed_dose.h
.. doxygenfile:: si/bits/derived/absorbed_dose.h

View File

@@ -1,4 +1,4 @@
Acceleration
============
.. doxygenfile:: si/acceleration.h
.. doxygenfile:: si/bits/derived/acceleration.h

View File

@@ -1,4 +1,4 @@
Area
====
.. doxygenfile:: si/area.h
.. doxygenfile:: si/bits/derived/area.h

View File

@@ -1,4 +1,4 @@
Capacitance
===========
.. doxygenfile:: si/capacitance.h
.. doxygenfile:: si/bits/derived/capacitance.h

View File

@@ -1,4 +1,4 @@
Catalytic Activity
==================
.. doxygenfile:: si/catalytic_activity.h
.. doxygenfile:: si/bits/derived/catalytic_activity.h

View File

@@ -1,4 +1,4 @@
Acceleration
============
.. doxygenfile:: si/cgs/acceleration.h
.. doxygenfile:: si/cgs/bits/derived/acceleration.h

View File

@@ -1,4 +1,4 @@
Area
====
.. doxygenfile:: si/cgs/area.h
.. doxygenfile:: si/cgs/bits/derived/area.h

View File

@@ -1,4 +1,4 @@
Energy
======
.. doxygenfile:: si/cgs/energy.h
.. doxygenfile:: si/cgs/bits/derived/energy.h

View File

@@ -1,4 +1,4 @@
Force
=====
.. doxygenfile:: si/cgs/force.h
.. doxygenfile:: si/cgs/bits/derived/force.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/cgs/length.h
.. doxygenfile:: si/cgs/base/length.h

View File

@@ -1,4 +1,4 @@
Mass
====
.. doxygenfile:: si/cgs/mass.h
.. doxygenfile:: si/cgs/base/mass.h

View File

@@ -1,4 +1,4 @@
Power
=====
.. doxygenfile:: si/cgs/power.h
.. doxygenfile:: si/cgs/bits/derived/power.h

View File

@@ -1,4 +1,4 @@
Pressure
========
.. doxygenfile:: si/cgs/pressure.h
.. doxygenfile:: si/cgs/bits/derived/pressure.h

View File

@@ -1,4 +1,4 @@
Speed
=====
.. doxygenfile:: si/cgs/speed.h
.. doxygenfile:: si/cgs/bits/derived/speed.h

View File

@@ -1,4 +1,4 @@
Time
====
.. doxygenfile:: si/cgs/time.h
.. doxygenfile:: si/cgs/base/time.h

View File

@@ -1,4 +1,4 @@
Charge Density
==============
.. doxygenfile:: si/charge_density.h
.. doxygenfile:: si/bits/derived/charge_density.h

View File

@@ -1,4 +1,4 @@
Concentration
=============
.. doxygenfile:: si/conductance.h
.. doxygenfile:: si/bits/derived/conductance.h

View File

@@ -1,4 +1,4 @@
Conductance
===========
.. doxygenfile:: si/conductance.h
.. doxygenfile:: si/bits/derived/conductance.h

View File

@@ -1,4 +1,4 @@
Current
=======
.. doxygenfile:: si/current.h
.. doxygenfile:: si/base/current.h

View File

@@ -1,4 +1,4 @@
Current density
===============
.. doxygenfile:: si/current_density.h
.. doxygenfile:: si/bits/derived/current_density.h

View File

@@ -1,4 +1,4 @@
Density
=======
.. doxygenfile:: si/density.h
.. doxygenfile:: si/bits/derived/density.h

View File

@@ -1,4 +1,4 @@
Dynamic Viscosity
=================
.. doxygenfile:: si/dynamic_viscosity.h
.. doxygenfile:: si/bits/derived/dynamic_viscosity.h

View File

@@ -1,4 +1,4 @@
Electric Charge
===============
.. doxygenfile:: si/electric_charge.h
.. doxygenfile:: si/bits/derived/electric_charge.h

View File

@@ -1,4 +1,4 @@
Electric Field Strength
=======================
.. doxygenfile:: si/electric_field_strength.h
.. doxygenfile:: si/bits/derived/electric_field_strength.h

View File

@@ -1,4 +1,4 @@
Energy
======
.. doxygenfile:: si/energy.h
.. doxygenfile:: si/bits/derived/energy.h

View File

@@ -1,4 +1,4 @@
Force
=====
.. doxygenfile:: si/force.h
.. doxygenfile:: si/bits/derived/force.h

View File

@@ -1,4 +1,4 @@
Acceleration
============
.. doxygenfile:: si/fps/acceleration.h
.. doxygenfile:: si/fps/bits/derived/acceleration.h

View File

@@ -1,4 +1,4 @@
Area
====
.. doxygenfile:: si/fps/area.h
.. doxygenfile:: si/fps/bits/derived/area.h

View File

@@ -1,4 +1,4 @@
Density
=======
.. doxygenfile:: si/fps/density.h
.. doxygenfile:: si/fps/bits/derived/density.h

View File

@@ -1,4 +1,4 @@
Energy
======
.. doxygenfile:: si/fps/energy.h
.. doxygenfile:: si/fps/bits/derived/energy.h

View File

@@ -1,4 +1,4 @@
Force
=====
.. doxygenfile:: si/fps/force.h
.. doxygenfile:: si/fps/bits/derived/force.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/fps/length.h
.. doxygenfile:: si/fps/base/length.h

View File

@@ -1,4 +1,4 @@
Mass
====
.. doxygenfile:: si/fps/mass.h
.. doxygenfile:: si/fps/base/mass.h

View File

@@ -1,4 +1,4 @@
Power
=====
.. doxygenfile:: si/fps/power.h
.. doxygenfile:: si/fps/bits/derived/power.h

View File

@@ -1,4 +1,4 @@
Pressure
========
.. doxygenfile:: si/fps/pressure.h
.. doxygenfile:: si/fps/bits/derived/pressure.h

View File

@@ -1,4 +1,4 @@
Speed
=====
.. doxygenfile:: si/fps/speed.h
.. doxygenfile:: si/fps/bits/derived/speed.h

View File

@@ -1,4 +1,4 @@
Time
====
.. doxygenfile:: si/fps/time.h
.. doxygenfile:: si/fps/base/time.h

View File

@@ -1,4 +1,4 @@
Volume
======
.. doxygenfile:: si/fps/volume.h
.. doxygenfile:: si/fps/bits/derived/volume.h

View File

@@ -1,4 +1,4 @@
Frequency
=========
.. doxygenfile:: si/frequency.h
.. doxygenfile:: si/bits/derived/frequency.h

View File

@@ -1,4 +1,4 @@
Heat Capacity
=============
.. doxygenfile:: si/heat_capacity.h
.. doxygenfile:: si/bits/derived/heat_capacity.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/iau/length.h
.. doxygenfile:: si/iau/base/length.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/imperial/length.h
.. doxygenfile:: si/imperial/base/length.h

View File

@@ -1,4 +1,4 @@
Inductance
==========
.. doxygenfile:: si/inductance.h
.. doxygenfile:: si/bits/derived/inductance.h

View File

@@ -1,4 +1,4 @@
Area
====
.. doxygenfile:: si/international/area.h
.. doxygenfile:: si/international/bits/derived/area.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/international/length.h
.. doxygenfile:: si/international/base/length.h

View File

@@ -1,4 +1,4 @@
Speed
=====
.. doxygenfile:: speed/length.h
.. doxygenfile:: speed/bits/derived/speed.h

View File

@@ -1,4 +1,4 @@
Volume
======
.. doxygenfile:: si/international/volume.h
.. doxygenfile:: si/international/bits/derived/volume.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/length.h
.. doxygenfile:: si/base/length.h

View File

@@ -1,4 +1,4 @@
Luminance
=========
.. doxygenfile:: si/luminance.h
.. doxygenfile:: si/base/luminance.h

View File

@@ -1,4 +1,4 @@
Luminous Intensity
==================
.. doxygenfile:: si/luminous_intensity.h
.. doxygenfile:: si/bits/derived/luminous_intensity.h

View File

@@ -1,4 +1,4 @@
Magnetic Flux
=============
.. doxygenfile:: si/magnetic_flux.h
.. doxygenfile:: si/bits/derived/magnetic_flux.h

View File

@@ -1,4 +1,4 @@
Magnetic Induction
==================
.. doxygenfile:: si/magnetic_induction.h
.. doxygenfile:: si/bits/derived/magnetic_induction.h

View File

@@ -1,4 +1,4 @@
Mass
====
.. doxygenfile:: si/mass.h
.. doxygenfile:: si/base/mass.h

View File

@@ -1,4 +1,4 @@
Molar Energy
============
.. doxygenfile:: si/molar_energy.h
.. doxygenfile:: si/bits/derived/molar_energy.h

View File

@@ -1,4 +1,4 @@
Momentum
========
.. doxygenfile:: si/momentum.h
.. doxygenfile:: si/bits/derived/momentum.h

View File

@@ -1,4 +1,4 @@
Permeability
============
.. doxygenfile:: si/permeability.h
.. doxygenfile:: si/bits/derived/permeability.h

View File

@@ -1,4 +1,4 @@
Permittivity
============
.. doxygenfile:: si/permittivity.h
.. doxygenfile:: si/bits/derived/permittivity.h

View File

@@ -1,4 +1,4 @@
Power
=====
.. doxygenfile:: si/power.h
.. doxygenfile:: si/bits/derived/power.h

View File

@@ -1,4 +1,4 @@
Prefixes
========
.. doxygenfile:: si/prefixes.h
.. doxygenfile:: si/bits/derived/prefixes.h

View File

@@ -1,4 +1,4 @@
Pressure
========
.. doxygenfile:: si/pressure.h
.. doxygenfile:: si/bits/derived/pressure.h

View File

@@ -1,4 +1,4 @@
Resistance
==========
.. doxygenfile:: si/resistance.h
.. doxygenfile:: si/bits/derived/resistance.h

View File

@@ -1,4 +1,4 @@
Speed
=====
.. doxygenfile:: si/speed.h
.. doxygenfile:: si/bits/derived/speed.h

View File

@@ -1,4 +1,4 @@
Substance
=========
.. doxygenfile:: si/substance.h
.. doxygenfile:: si/base/substance.h

View File

@@ -1,4 +1,4 @@
Surface Tension
===============
.. doxygenfile:: si/surface_tension.h
.. doxygenfile:: si/bits/derived/surface_tension.h

View File

@@ -1,4 +1,4 @@
Temperature
===========
.. doxygenfile:: si/temperature.h
.. doxygenfile:: si/base/temperature.h

View File

@@ -1,4 +1,4 @@
Thermal Conductivity
====================
.. doxygenfile:: si/thermal_conductivity.h
.. doxygenfile:: si/bits/derived/thermal_conductivity.h

View File

@@ -1,4 +1,4 @@
Time
====
.. doxygenfile:: si/time.h
.. doxygenfile:: si/base/time.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/typographic/length.h
.. doxygenfile:: si/typographic/base/length.h

View File

@@ -1,4 +1,4 @@
Length
======
.. doxygenfile:: si/us/length.h
.. doxygenfile:: si/us/base/length.h

View File

@@ -1,4 +1,4 @@
Voltage
=======
.. doxygenfile:: si/voltage.h
.. doxygenfile:: si/bits/derived/voltage.h

View File

@@ -1,4 +1,4 @@
Volume
======
.. doxygenfile:: si/volume.h
.. doxygenfile:: si/bits/derived/volume.h

View File

@@ -1,7 +1,7 @@
#pragma once
#include <units/physical/si/acceleration.h>
#include <units/physical/si/si.h>
namespace units{
namespace experimental{

View File

@@ -1,7 +1,7 @@
#pragma once
#include <units/physical/si/area.h>
#include <units/physical/si/si.h>
namespace area {

View File

@@ -20,9 +20,7 @@
physical_quantities
*/
#include <units/physical/si/capacitance.h>
#include <units/physical/si/resistance.h>
#include <units/physical/si/time.h>
#include <units/physical/si/si.h>
#include <units/math.h>
#include "./voltage.h"
#include <iostream>

View File

@@ -2,7 +2,7 @@
#pragma once
#include <units/physical/si/density.h>
#include <units/physical/si/si.h>
namespace units{
namespace experimental{

View File

@@ -1,7 +1,7 @@
#pragma once
#include <units/physical/si/force.h>
#include <units/physical/si/si.h>
namespace units{
namespace experimental{

View File

@@ -2,12 +2,12 @@
#pragma once
#include <units/physical/si/length.h>
#include <units/physical/si/imperial/length.h>
#include <units/physical/si/international/length.h>
#include <units/physical/si/typographic/length.h>
#include <units/physical/si/us/length.h>
#include <units/physical/si/iau/length.h>
#include <units/physical/si/si.h>
#include <units/physical/si/imperial/imperial.h>
#include <units/physical/si/international/international.h>
#include <units/physical/si/typographic/typographic.h>
#include <units/physical/si/us/us.h>
#include <units/physical/si/iau/iau.h>
namespace units{
namespace experimental{

View File

@@ -2,7 +2,7 @@
#pragma once
#include <units/physical/si/mass.h>
#include <units/physical/si/si.h>
namespace units{
namespace experimental{

View File

@@ -1,7 +1,7 @@
#pragma once
#include <units/physical/si/time.h>
#include <units/physical/si/si.h>
// named qtime due to conflict with time_t time(time_t*)
namespace q_time {

View File

@@ -2,7 +2,7 @@
#pragma once
#include <units/physical/si/voltage.h>
#include <units/physical/si/si.h>
namespace units{
namespace experimental{

View File

@@ -2,7 +2,7 @@
#pragma once
#include <units/physical/si/volume.h>
#include <units/physical/si/si.h>
namespace units{
namespace experimental{
@@ -16,4 +16,3 @@ using m3 = units::physical::si::volume<units::physical::si::cubic_metre, Rep>;
}} // units::experimental

View File

@@ -20,9 +20,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <units/physical/si/cgs/speed.h>
#include <units/physical/si/international/speed.h>
#include <units/physical/si/speed.h>
#include <units/physical/si/cgs/cgs.h>
#include <units/physical/si/international/international.h>
#include <units/physical/si/si.h>
#include <iostream>
namespace {

View File

@@ -1,11 +1,4 @@
#include <units/physical/si/acceleration.h>
#include <units/physical/si/constants.h>
#include <units/physical/si/density.h>
#include <units/physical/si/force.h>
#include <units/physical/si/length.h>
#include <units/physical/si/mass.h>
#include <units/physical/si/time.h>
#include <units/physical/si/volume.h>
#include <units/physical/si/si.h>
#include <units/format.h>
#include <cassert>

View File

@@ -20,10 +20,7 @@
physical_quantities
*/
#include <units/physical/si/capacitance.h>
#include <units/physical/si/resistance.h>
#include <units/physical/si/time.h>
#include <units/physical/si/voltage.h>
#include <units/physical/si/si.h>
#include <units/math.h>
#include <iostream>

View File

@@ -16,15 +16,12 @@
*/
#include <units/format.h>
#include <units/physical/si/area.h>
#include <units/physical/si/iau/length.h>
#include <units/physical/si/imperial/length.h>
#include <units/physical/si/international/length.h>
#include <units/physical/si/length.h>
#include <units/physical/si/time.h>
#include <units/physical/si/typographic/length.h>
#include <units/physical/si/us/length.h>
#include <units/physical/si/volume.h>
#include <units/physical/si/si.h>
#include <units/physical/si/iau/iau.h>
#include <units/physical/si/imperial/imperial.h>
#include <units/physical/si/international/international.h>
#include <units/physical/si/typographic/typographic.h>
#include <units/physical/si/us/us.h>
#include <iostream>
namespace {

View File

@@ -15,7 +15,7 @@
along with this program. If not, see http://www.gnu.org/licenses./
*/
#include <units/physical/si/length.h>
#include <units/physical/si/si.h>
#include <units/format.h>
#include <iostream>

View File

@@ -21,9 +21,7 @@
// SOFTWARE.
#include <units/format.h>
#include <units/physical/si/energy.h>
#include <units/physical/si/length.h>
#include <units/physical/si/torque.h>
#include <units/physical/si/si.h>
#include <iostream>
using namespace units;

View File

@@ -22,17 +22,8 @@
#include <units/concepts.h>
#include <units/format.h>
#include <units/physical/si/fps/density.h>
#include <units/physical/si/fps/length.h>
#include <units/physical/si/fps/mass.h>
#include <units/physical/si/fps/power.h>
#include <units/physical/si/fps/speed.h>
#include <units/physical/si/fps/volume.h>
#include <units/physical/si/length.h>
#include <units/physical/si/mass.h>
#include <units/physical/si/power.h>
#include <units/physical/si/speed.h>
#include <units/physical/si/volume.h>
#include <units/physical/si/fps/fps.h>
#include <units/physical/si/si.h>
#include <units/quantity.h>
#include <iostream>

View File

@@ -22,8 +22,8 @@
#include <units/format.h>
#include <units/math.h>
#include <units/physical/si/international/length.h>
#include <units/physical/si/speed.h>
#include <units/physical/si/international/international.h>
#include <units/physical/si/si.h>
#include <units/quantity_point.h>
#include <array>
#include <compare>

View File

@@ -21,8 +21,8 @@
// SOFTWARE.
#include <units/format.h>
#include <units/physical/si/international/speed.h>
#include <units/physical/si/speed.h>
#include <units/physical/si/international/international.h>
#include <units/physical/si/si.h>
#include <iostream>
using namespace units::physical;

View File

@@ -1,7 +1,5 @@
#include <units/format.h>
#include <units/physical/si/length.h>
#include <units/physical/si/time.h>
#include <units/physical/si/speed.h>
#include <units/physical/si/si.h>
#include <iostream>
#include <array>

View File

@@ -20,9 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <units/physical/si/speed.h>
#include <units/physical/si/force.h>
#include <units/physical/si/energy.h>
#include <units/physical/si/si.h>
#include <units/format.h>
#include <linear_algebra.hpp>
#include <iostream>

View File

@@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <units/physical/si/acceleration.h>
#include <units/physical/si/si.h>
#include <cmath>
#include <compare>
#include <iostream>

View File

@@ -20,11 +20,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <units/physical/natural/constants.h>
#include <units/physical/si/energy.h>
#include <units/physical/si/momentum.h>
#include <units/physical/si/speed.h>
#include <units/physical/si/constants.h>
#include <units/physical/natural/natural.h>
#include <units/physical/si/si.h>
#include <units/math.h>
#include <iostream>

View File

@@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <units/physical/si/speed.h>
#include <units/physical/si/si.h>
#include <iostream>
namespace {
@@ -40,6 +40,7 @@ void example()
Time auto t1 = 10_q_s;
Speed auto v1 = avg_speed(d1, t1);
// TODO: check if below is still true after adding whole SI module
auto temp1 = v1 * 50_q_m; // produces intermediate unknown dimension with 'unknown_coherent_unit' as its 'coherent_unit'
Speed auto v2 = temp1 / 100_q_m; // back to known dimensions again
Length auto d2 = v2 * 60_q_s;

View File

@@ -22,9 +22,15 @@
#pragma once
#include <units/data/information.h>
#ifndef MP_UNITS_SYSTEM_DATA
#error "Please do not include this file directly. Use `units/physical/data/data.h` to prevent potential ODR violation issues."
#endif
#include <units/data/base/information.h>
#include <units/derived_dimension.h>
#include <units/physical/si/time.h>
#include <units/physical/si/base/time.h>
#include <units/quantity.h>
namespace units::data {

View File

@@ -0,0 +1,29 @@
// 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
#define MP_UNITS_SYSTEM_DATA
#include <units/data/base/information.h>
#include <units/data/bits/derived/bitrate.h>
#include <units/data/prefixes.h>

View File

@@ -22,18 +22,18 @@
#pragma once
#include <units/physical/dimensions.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
namespace units::physical::si {
namespace units {
struct radian : named_unit<radian, "rad", prefix> {};
struct radian : named_unit<radian, "rad", physical::si::prefix> {};
struct dim_angle : physical::dim_angle<radian> {};
template<Unit U = radian>
struct dim_angle : base_dimension<"A", U> {};
template<Unit U, ScalableNumber Rep = double>
using angle = quantity<dim_angle, U, Rep>;
using angle = quantity<dim_angle<>, U, Rep>;
inline namespace literals {
@@ -44,4 +44,4 @@ constexpr auto operator"" _q_rad(long double l) { return angle<radian, long doub
} // namespace literals
} // namespace units::physical::si
} // namespace units

Some files were not shown because too many files have changed in this diff Show More