refactor: References are now guarded UNITS_REFERENCES with (ON by default) + examples duplicated to subdirectories

Now References can be disabled to meassure a compile time impact. Also the same examples are now provided in two subdirectories to be able to easily compare the pros and cons of every quantity construction technique.
This commit is contained in:
Mateusz Pusz committed 2021-04-06 15:57:28 +02:00
1 parent b842c3f94a
commit b982921d27
118 files changed
+2841 -71

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
avg_speed
=========
.. literalinclude:: ../../example/avg_speed.cpp
.. literalinclude:: ../../example/references/avg_speed.cpp
:caption: avg_speed.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
box_example
===========
.. literalinclude:: ../../example/box_example.cpp
.. literalinclude:: ../../example/references/box_example.cpp
:caption: box_example.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
capacitor_time_curve
====================
.. literalinclude:: ../../example/capacitor_time_curve.cpp
.. literalinclude:: ../../example/references/capacitor_time_curve.cpp
:caption: capacitor_time_curve.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
clcpp_response
==============
.. literalinclude:: ../../example/clcpp_response.cpp
.. literalinclude:: ../../example/references/clcpp_response.cpp
:caption: clcpp_response.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
conversion_factor
=================
.. literalinclude:: ../../example/conversion_factor.cpp
.. literalinclude:: ../../example/references/conversion_factor.cpp
:caption: conversion_factor.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
custom_systems
==============
.. literalinclude:: ../../example/custom_systems.cpp
.. literalinclude:: ../../example/references/custom_systems.cpp
:caption: custom_systems.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
foot_pound_second
=================
.. literalinclude:: ../../example/foot_pound_second.cpp
.. literalinclude:: ../../example/references/foot_pound_second.cpp
:caption: foot_pound_second.cpp
:start-at: #include
:linenos:
+6 -6
View File
@@ -13,7 +13,7 @@ This example presents the usage of:
- quantities text output formatting,
- cooperation with `std::chrono`.
.. literalinclude:: ../../example/glide_computer.h
.. literalinclude:: ../../example/references/glide_computer.h
:caption: glide_computer.h
:start-at: #include
:end-before: using namespace units;
@@ -35,7 +35,7 @@ For example we have 3 for a quantity of length:
- ``height`` - a relative altitude difference between 2 points in the air
- ``altitude`` - an absolute altitude value measured form the mean sea level (AMSL).
.. literalinclude:: ../../example/glide_computer.h
.. literalinclude:: ../../example/references/glide_computer.h
:caption: glide_computer.h
:start-at: using namespace units;
:end-before: // text output
@@ -44,7 +44,7 @@ For example we have 3 for a quantity of length:
Next a custom text output is provided both for C++ output streams and the text formatting facility.
.. literalinclude:: ../../example/glide_computer.h
.. literalinclude:: ../../example/references/glide_computer.h
:caption: glide_computer.h
:start-at: // text output
:end-before: // definition of glide computer databases and utilities
@@ -58,13 +58,13 @@ convert it to the one required by the engine interface.
The glide calculator takes task created as a list of waypoints, glider performance data, weather conditions,
safety constraints, and a towing height.
.. literalinclude:: ../../example/glide_computer.h
.. literalinclude:: ../../example/references/glide_computer.h
:caption: glide_computer.h
:start-at: // definition of glide computer databases and utilities
:linenos:
:lineno-match:
.. literalinclude:: ../../example/glide_computer_example.cpp
.. literalinclude:: ../../example/references/glide_computer_example.cpp
:caption: glide_computer_example.cpp
:start-at: #include
:linenos:
@@ -74,7 +74,7 @@ Having all of that it estimates the number of flight phases (towing, circling, g
needed to finish a task. As an output it provides the duration needed to finish the task while
flying a selected glider in the specific weather conditions.
.. literalinclude:: ../../example/glide_computer.cpp
.. literalinclude:: ../../example/references/glide_computer.cpp
:caption: glide_computer.cpp
:start-at: #include
:linenos:
@@ -4,7 +4,7 @@ kalman_filter-alpha_beta_filter_example2
This example is based on the 1d aircraft α-β filter example 2 from the
`Kalman Filter <https://www.kalmanfilter.net/alphabeta.html#ex2>`_ tutorial.
.. literalinclude:: ../../example/kalman_filter-alpha_beta_filter_example2.cpp
.. literalinclude:: ../../example/references/kalman_filter-alpha_beta_filter_example2.cpp
:caption: kalman_filter-alpha_beta_filter_example2.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
linear_algebra
==============
.. literalinclude:: ../../example/linear_algebra.cpp
.. literalinclude:: ../../example/references/linear_algebra.cpp
:caption: linear_algebra.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
measurement
===========
.. literalinclude:: ../../example/measurement.cpp
.. literalinclude:: ../../example/references/measurement.cpp
:caption: measurement.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
total_energy
============
.. literalinclude:: ../../example/total_energy.cpp
.. literalinclude:: ../../example/references/total_energy.cpp
:caption: total_energy.cpp
:start-at: #include
:linenos:
+1 -1
View File
@@ -1,7 +1,7 @@
unknown_dimension
=================
.. literalinclude:: ../../example/unknown_dimension.cpp
.. literalinclude:: ../../example/references/unknown_dimension.cpp
:caption: unknown_dimension.cpp
:start-at: #include
:linenos: