From 99c02d69db9ae03dda22378c287c876a8853fb7f Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Mon, 28 Oct 2024 11:55:18 -0400 Subject: [PATCH] Add forward declarations for individual units (#314) Individual `"au/units/*.hh"` files still pull in some decently heavy machinery. The sensible, scalable solution is to provide a `"au/units/*_fwd.hh"` file corresponding to each of them. Each "regular" units header will include its `_fwd.hh` header as the first include (and we add a comment to that effect to prevent clang-format from reordering them). Happily, this enables us to write a somewhat meaningful test for the forward declaraction machinery. We can now make a header file that provides an interface with only the forward declarations. Then we call that API inside of a test file. Finally, this is worth updating the docs for: - **Installation:** mention the `fwd.hh` files. - **Alternatives:** mention this feature, as we're the first units library I know of that provides it. All of these changes are in separate commits for the convenience of the reviewer: I recommend starting at the first, and using `n` and `p` to navigate them. Fixes #232. --- au/BUILD.bazel | 17 ++++++++ au/code/au/CMakeLists.txt | 55 ++++++++++++++++++++++++ au/code/au/fwd_test.cc | 29 +++++++++++++ au/code/au/fwd_test_lib.cc | 32 ++++++++++++++ au/code/au/fwd_test_lib.hh | 26 +++++++++++ au/code/au/units/amperes.hh | 3 ++ au/code/au/units/amperes_fwd.hh | 21 +++++++++ au/code/au/units/bars.hh | 3 ++ au/code/au/units/bars_fwd.hh | 21 +++++++++ au/code/au/units/becquerel.hh | 3 ++ au/code/au/units/becquerel_fwd.hh | 21 +++++++++ au/code/au/units/bits.hh | 3 ++ au/code/au/units/bits_fwd.hh | 21 +++++++++ au/code/au/units/bytes.hh | 3 ++ au/code/au/units/bytes_fwd.hh | 21 +++++++++ au/code/au/units/candelas.hh | 3 ++ au/code/au/units/candelas_fwd.hh | 21 +++++++++ au/code/au/units/celsius.hh | 3 ++ au/code/au/units/celsius_fwd.hh | 19 ++++++++ au/code/au/units/coulombs.hh | 3 ++ au/code/au/units/coulombs_fwd.hh | 21 +++++++++ au/code/au/units/days.hh | 3 ++ au/code/au/units/days_fwd.hh | 21 +++++++++ au/code/au/units/degrees.hh | 3 ++ au/code/au/units/degrees_fwd.hh | 21 +++++++++ au/code/au/units/fahrenheit.hh | 3 ++ au/code/au/units/fahrenheit_fwd.hh | 21 +++++++++ au/code/au/units/farads.hh | 3 ++ au/code/au/units/farads_fwd.hh | 21 +++++++++ au/code/au/units/fathoms.hh | 3 ++ au/code/au/units/fathoms_fwd.hh | 21 +++++++++ au/code/au/units/feet.hh | 3 ++ au/code/au/units/feet_fwd.hh | 21 +++++++++ au/code/au/units/furlongs.hh | 3 ++ au/code/au/units/furlongs_fwd.hh | 21 +++++++++ au/code/au/units/grams.hh | 3 ++ au/code/au/units/grams_fwd.hh | 21 +++++++++ au/code/au/units/grays.hh | 3 ++ au/code/au/units/grays_fwd.hh | 21 +++++++++ au/code/au/units/henries.hh | 3 ++ au/code/au/units/henries_fwd.hh | 21 +++++++++ au/code/au/units/hertz.hh | 3 ++ au/code/au/units/hertz_fwd.hh | 21 +++++++++ au/code/au/units/hours.hh | 3 ++ au/code/au/units/hours_fwd.hh | 21 +++++++++ au/code/au/units/inches.hh | 3 ++ au/code/au/units/inches_fwd.hh | 21 +++++++++ au/code/au/units/joules.hh | 3 ++ au/code/au/units/joules_fwd.hh | 21 +++++++++ au/code/au/units/katals.hh | 3 ++ au/code/au/units/katals_fwd.hh | 21 +++++++++ au/code/au/units/kelvins.hh | 3 ++ au/code/au/units/kelvins_fwd.hh | 21 +++++++++ au/code/au/units/knots.hh | 3 ++ au/code/au/units/knots_fwd.hh | 21 +++++++++ au/code/au/units/liters.hh | 3 ++ au/code/au/units/liters_fwd.hh | 21 +++++++++ au/code/au/units/lumens.hh | 3 ++ au/code/au/units/lumens_fwd.hh | 21 +++++++++ au/code/au/units/lux.hh | 3 ++ au/code/au/units/lux_fwd.hh | 21 +++++++++ au/code/au/units/meters.hh | 3 ++ au/code/au/units/meters_fwd.hh | 21 +++++++++ au/code/au/units/miles.hh | 3 ++ au/code/au/units/miles_fwd.hh | 21 +++++++++ au/code/au/units/minutes.hh | 3 ++ au/code/au/units/minutes_fwd.hh | 21 +++++++++ au/code/au/units/moles.hh | 3 ++ au/code/au/units/moles_fwd.hh | 21 +++++++++ au/code/au/units/nautical_miles.hh | 3 ++ au/code/au/units/nautical_miles_fwd.hh | 21 +++++++++ au/code/au/units/newtons.hh | 3 ++ au/code/au/units/newtons_fwd.hh | 21 +++++++++ au/code/au/units/ohms.hh | 3 ++ au/code/au/units/ohms_fwd.hh | 21 +++++++++ au/code/au/units/pascals.hh | 3 ++ au/code/au/units/pascals_fwd.hh | 21 +++++++++ au/code/au/units/percent.hh | 3 ++ au/code/au/units/percent_fwd.hh | 21 +++++++++ au/code/au/units/pounds_force.hh | 3 ++ au/code/au/units/pounds_force_fwd.hh | 21 +++++++++ au/code/au/units/pounds_mass.hh | 3 ++ au/code/au/units/pounds_mass_fwd.hh | 21 +++++++++ au/code/au/units/radians.hh | 3 ++ au/code/au/units/radians_fwd.hh | 21 +++++++++ au/code/au/units/revolutions.hh | 3 ++ au/code/au/units/revolutions_fwd.hh | 21 +++++++++ au/code/au/units/seconds.hh | 3 ++ au/code/au/units/seconds_fwd.hh | 21 +++++++++ au/code/au/units/siemens.hh | 3 ++ au/code/au/units/siemens_fwd.hh | 21 +++++++++ au/code/au/units/slugs.hh | 3 ++ au/code/au/units/slugs_fwd.hh | 21 +++++++++ au/code/au/units/standard_gravity.hh | 3 ++ au/code/au/units/standard_gravity_fwd.hh | 21 +++++++++ au/code/au/units/steradians.hh | 3 ++ au/code/au/units/steradians_fwd.hh | 21 +++++++++ au/code/au/units/tesla.hh | 3 ++ au/code/au/units/tesla_fwd.hh | 21 +++++++++ au/code/au/units/unos.hh | 3 ++ au/code/au/units/unos_fwd.hh | 21 +++++++++ au/code/au/units/us_gallons.hh | 3 ++ au/code/au/units/us_gallons_fwd.hh | 21 +++++++++ au/code/au/units/us_pints.hh | 3 ++ au/code/au/units/us_pints_fwd.hh | 21 +++++++++ au/code/au/units/us_quarts.hh | 3 ++ au/code/au/units/us_quarts_fwd.hh | 21 +++++++++ au/code/au/units/volts.hh | 3 ++ au/code/au/units/volts_fwd.hh | 21 +++++++++ au/code/au/units/watts.hh | 3 ++ au/code/au/units/watts_fwd.hh | 21 +++++++++ au/code/au/units/webers.hh | 3 ++ au/code/au/units/webers_fwd.hh | 21 +++++++++ au/code/au/units/yards.hh | 3 ++ au/code/au/units/yards_fwd.hh | 21 +++++++++ docs/alternatives/index.md | 7 ++- docs/install.md | 4 +- 117 files changed, 1485 insertions(+), 3 deletions(-) create mode 100644 au/code/au/fwd_test.cc create mode 100644 au/code/au/fwd_test_lib.cc create mode 100644 au/code/au/fwd_test_lib.hh create mode 100644 au/code/au/units/amperes_fwd.hh create mode 100644 au/code/au/units/bars_fwd.hh create mode 100644 au/code/au/units/becquerel_fwd.hh create mode 100644 au/code/au/units/bits_fwd.hh create mode 100644 au/code/au/units/bytes_fwd.hh create mode 100644 au/code/au/units/candelas_fwd.hh create mode 100644 au/code/au/units/celsius_fwd.hh create mode 100644 au/code/au/units/coulombs_fwd.hh create mode 100644 au/code/au/units/days_fwd.hh create mode 100644 au/code/au/units/degrees_fwd.hh create mode 100644 au/code/au/units/fahrenheit_fwd.hh create mode 100644 au/code/au/units/farads_fwd.hh create mode 100644 au/code/au/units/fathoms_fwd.hh create mode 100644 au/code/au/units/feet_fwd.hh create mode 100644 au/code/au/units/furlongs_fwd.hh create mode 100644 au/code/au/units/grams_fwd.hh create mode 100644 au/code/au/units/grays_fwd.hh create mode 100644 au/code/au/units/henries_fwd.hh create mode 100644 au/code/au/units/hertz_fwd.hh create mode 100644 au/code/au/units/hours_fwd.hh create mode 100644 au/code/au/units/inches_fwd.hh create mode 100644 au/code/au/units/joules_fwd.hh create mode 100644 au/code/au/units/katals_fwd.hh create mode 100644 au/code/au/units/kelvins_fwd.hh create mode 100644 au/code/au/units/knots_fwd.hh create mode 100644 au/code/au/units/liters_fwd.hh create mode 100644 au/code/au/units/lumens_fwd.hh create mode 100644 au/code/au/units/lux_fwd.hh create mode 100644 au/code/au/units/meters_fwd.hh create mode 100644 au/code/au/units/miles_fwd.hh create mode 100644 au/code/au/units/minutes_fwd.hh create mode 100644 au/code/au/units/moles_fwd.hh create mode 100644 au/code/au/units/nautical_miles_fwd.hh create mode 100644 au/code/au/units/newtons_fwd.hh create mode 100644 au/code/au/units/ohms_fwd.hh create mode 100644 au/code/au/units/pascals_fwd.hh create mode 100644 au/code/au/units/percent_fwd.hh create mode 100644 au/code/au/units/pounds_force_fwd.hh create mode 100644 au/code/au/units/pounds_mass_fwd.hh create mode 100644 au/code/au/units/radians_fwd.hh create mode 100644 au/code/au/units/revolutions_fwd.hh create mode 100644 au/code/au/units/seconds_fwd.hh create mode 100644 au/code/au/units/siemens_fwd.hh create mode 100644 au/code/au/units/slugs_fwd.hh create mode 100644 au/code/au/units/standard_gravity_fwd.hh create mode 100644 au/code/au/units/steradians_fwd.hh create mode 100644 au/code/au/units/tesla_fwd.hh create mode 100644 au/code/au/units/unos_fwd.hh create mode 100644 au/code/au/units/us_gallons_fwd.hh create mode 100644 au/code/au/units/us_pints_fwd.hh create mode 100644 au/code/au/units/us_quarts_fwd.hh create mode 100644 au/code/au/units/volts_fwd.hh create mode 100644 au/code/au/units/watts_fwd.hh create mode 100644 au/code/au/units/webers_fwd.hh create mode 100644 au/code/au/units/yards_fwd.hh diff --git a/au/BUILD.bazel b/au/BUILD.bazel index 6f5ac26f..826f55b8 100644 --- a/au/BUILD.bazel +++ b/au/BUILD.bazel @@ -47,6 +47,23 @@ cc_library( visibility = ["//visibility:public"], ) +cc_test( + name = "fwd_test", + size = "small", + srcs = [ + "code/au/fwd_test.cc", + "code/au/fwd_test_lib.cc", + "code/au/fwd_test_lib.hh", + ], + deps = [ + ":fwd", + ":io", + ":quantity", + ":units", + "@com_google_googletest//:gtest_main", + ], +) + cc_library( name = "io", hdrs = ["code/au/io.hh"], diff --git a/au/code/au/CMakeLists.txt b/au/code/au/CMakeLists.txt index 860d89e7..c6e4f2af 100644 --- a/au/code/au/CMakeLists.txt +++ b/au/code/au/CMakeLists.txt @@ -48,60 +48,115 @@ header_only_library( stdx/type_traits.hh stdx/utility.hh units/amperes.hh + units/amperes_fwd.hh units/bars.hh + units/bars_fwd.hh units/becquerel.hh + units/becquerel_fwd.hh units/bits.hh + units/bits_fwd.hh units/bytes.hh + units/bytes_fwd.hh units/candelas.hh + units/candelas_fwd.hh units/celsius.hh + units/celsius_fwd.hh units/coulombs.hh + units/coulombs_fwd.hh units/days.hh + units/days_fwd.hh units/degrees.hh + units/degrees_fwd.hh units/fahrenheit.hh + units/fahrenheit_fwd.hh units/farads.hh + units/farads_fwd.hh units/fathoms.hh + units/fathoms_fwd.hh units/feet.hh + units/feet_fwd.hh units/furlongs.hh + units/furlongs_fwd.hh units/grams.hh + units/grams_fwd.hh units/grays.hh + units/grays_fwd.hh units/henries.hh + units/henries_fwd.hh units/hertz.hh + units/hertz_fwd.hh units/hours.hh + units/hours_fwd.hh units/inches.hh + units/inches_fwd.hh units/joules.hh + units/joules_fwd.hh units/katals.hh + units/katals_fwd.hh units/kelvins.hh + units/kelvins_fwd.hh units/knots.hh + units/knots_fwd.hh units/liters.hh + units/liters_fwd.hh units/lumens.hh + units/lumens_fwd.hh units/lux.hh + units/lux_fwd.hh units/meters.hh + units/meters_fwd.hh units/miles.hh + units/miles_fwd.hh units/minutes.hh + units/minutes_fwd.hh units/moles.hh + units/moles_fwd.hh units/nautical_miles.hh + units/nautical_miles_fwd.hh units/newtons.hh + units/newtons_fwd.hh units/ohms.hh + units/ohms_fwd.hh units/pascals.hh + units/pascals_fwd.hh units/percent.hh + units/percent_fwd.hh units/pounds_force.hh + units/pounds_force_fwd.hh units/pounds_mass.hh + units/pounds_mass_fwd.hh units/radians.hh + units/radians_fwd.hh units/revolutions.hh + units/revolutions_fwd.hh units/seconds.hh + units/seconds_fwd.hh units/siemens.hh + units/siemens_fwd.hh units/slugs.hh + units/slugs_fwd.hh units/standard_gravity.hh + units/standard_gravity_fwd.hh units/steradians.hh + units/steradians_fwd.hh units/tesla.hh + units/tesla_fwd.hh units/unos.hh + units/unos_fwd.hh units/us_gallons.hh + units/us_gallons_fwd.hh units/us_pints.hh + units/us_pints_fwd.hh units/us_quarts.hh + units/us_quarts_fwd.hh units/volts.hh + units/volts_fwd.hh units/watts.hh + units/watts_fwd.hh units/webers.hh + units/webers_fwd.hh units/yards.hh + units/yards_fwd.hh utility/factoring.hh utility/string_constant.hh utility/type_traits.hh diff --git a/au/code/au/fwd_test.cc b/au/code/au/fwd_test.cc new file mode 100644 index 00000000..67c5ded4 --- /dev/null +++ b/au/code/au/fwd_test.cc @@ -0,0 +1,29 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "au/fwd_test_lib.hh" +#include "au/quantity.hh" +#include "au/units/meters.hh" +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +using ::testing::StrEq; + +namespace au { + +TEST(Fwd, CanCallFunctionDeclaredWithOnlyFwdFiles) { + EXPECT_THAT(print_to_string(meters(1)), StrEq("1 m")); +} + +} // namespace au diff --git a/au/code/au/fwd_test_lib.cc b/au/code/au/fwd_test_lib.cc new file mode 100644 index 00000000..14ea6a9d --- /dev/null +++ b/au/code/au/fwd_test_lib.cc @@ -0,0 +1,32 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "au/fwd_test_lib.hh" + +#include +#include + +#include "au/io.hh" +#include "au/quantity.hh" +#include "au/units/meters.hh" + +namespace au { + +std::string print_to_string(const QuantityI &q) { + std::ostringstream oss; + oss << q; + return oss.str(); +} + +} // namespace au diff --git a/au/code/au/fwd_test_lib.hh b/au/code/au/fwd_test_lib.hh new file mode 100644 index 00000000..c870897d --- /dev/null +++ b/au/code/au/fwd_test_lib.hh @@ -0,0 +1,26 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include + +#include "au/fwd.hh" +#include "au/units/meters_fwd.hh" + +namespace au { + +std::string print_to_string(const QuantityI &q); + +} // namespace au diff --git a/au/code/au/units/amperes.hh b/au/code/au/units/amperes.hh index 411d5953..d7cb3a26 100644 --- a/au/code/au/units/amperes.hh +++ b/au/code/au/units/amperes.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/amperes_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/amperes_fwd.hh b/au/code/au/units/amperes_fwd.hh new file mode 100644 index 00000000..a6b30dc7 --- /dev/null +++ b/au/code/au/units/amperes_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Amperes; + +} // namespace au diff --git a/au/code/au/units/bars.hh b/au/code/au/units/bars.hh index c8973c3d..e92133db 100644 --- a/au/code/au/units/bars.hh +++ b/au/code/au/units/bars.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/bars_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/bars_fwd.hh b/au/code/au/units/bars_fwd.hh new file mode 100644 index 00000000..7ac83f98 --- /dev/null +++ b/au/code/au/units/bars_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Bars; + +} // namespace au diff --git a/au/code/au/units/becquerel.hh b/au/code/au/units/becquerel.hh index c3869248..ee3286dc 100644 --- a/au/code/au/units/becquerel.hh +++ b/au/code/au/units/becquerel.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/becquerel_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/seconds.hh" diff --git a/au/code/au/units/becquerel_fwd.hh b/au/code/au/units/becquerel_fwd.hh new file mode 100644 index 00000000..e4b7fb0b --- /dev/null +++ b/au/code/au/units/becquerel_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Becquerel; + +} // namespace au diff --git a/au/code/au/units/bits.hh b/au/code/au/units/bits.hh index 8af4344e..1e49f591 100644 --- a/au/code/au/units/bits.hh +++ b/au/code/au/units/bits.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/bits_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/bits_fwd.hh b/au/code/au/units/bits_fwd.hh new file mode 100644 index 00000000..47c66c1f --- /dev/null +++ b/au/code/au/units/bits_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Bits; + +} // namespace au diff --git a/au/code/au/units/bytes.hh b/au/code/au/units/bytes.hh index 677d21c1..8ef0286c 100644 --- a/au/code/au/units/bytes.hh +++ b/au/code/au/units/bytes.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/bytes_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/bits.hh" diff --git a/au/code/au/units/bytes_fwd.hh b/au/code/au/units/bytes_fwd.hh new file mode 100644 index 00000000..3ba4f9be --- /dev/null +++ b/au/code/au/units/bytes_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Bytes; + +} // namespace au diff --git a/au/code/au/units/candelas.hh b/au/code/au/units/candelas.hh index 0d42b22a..4322bd9d 100644 --- a/au/code/au/units/candelas.hh +++ b/au/code/au/units/candelas.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/candelas_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/candelas_fwd.hh b/au/code/au/units/candelas_fwd.hh new file mode 100644 index 00000000..803ef1c8 --- /dev/null +++ b/au/code/au/units/candelas_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Candelas; + +} // namespace au diff --git a/au/code/au/units/celsius.hh b/au/code/au/units/celsius.hh index 980bea6d..4867cb39 100644 --- a/au/code/au/units/celsius.hh +++ b/au/code/au/units/celsius.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/celsius_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/quantity_point.hh" diff --git a/au/code/au/units/celsius_fwd.hh b/au/code/au/units/celsius_fwd.hh new file mode 100644 index 00000000..353c886c --- /dev/null +++ b/au/code/au/units/celsius_fwd.hh @@ -0,0 +1,19 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace au { + +struct Celsius; + +} // namespace au diff --git a/au/code/au/units/coulombs.hh b/au/code/au/units/coulombs.hh index e5df9ded..8dc21908 100644 --- a/au/code/au/units/coulombs.hh +++ b/au/code/au/units/coulombs.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/coulombs_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/amperes.hh" diff --git a/au/code/au/units/coulombs_fwd.hh b/au/code/au/units/coulombs_fwd.hh new file mode 100644 index 00000000..9742a69d --- /dev/null +++ b/au/code/au/units/coulombs_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Coulombs; + +} // namespace au diff --git a/au/code/au/units/days.hh b/au/code/au/units/days.hh index e3222978..11a5a87e 100644 --- a/au/code/au/units/days.hh +++ b/au/code/au/units/days.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/days_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/hours.hh" diff --git a/au/code/au/units/days_fwd.hh b/au/code/au/units/days_fwd.hh new file mode 100644 index 00000000..dfd4aef4 --- /dev/null +++ b/au/code/au/units/days_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Days; + +} // namespace au diff --git a/au/code/au/units/degrees.hh b/au/code/au/units/degrees.hh index 333e8c06..3d897eb2 100644 --- a/au/code/au/units/degrees.hh +++ b/au/code/au/units/degrees.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/degrees_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/radians.hh" diff --git a/au/code/au/units/degrees_fwd.hh b/au/code/au/units/degrees_fwd.hh new file mode 100644 index 00000000..4050c6f1 --- /dev/null +++ b/au/code/au/units/degrees_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Degrees; + +} // namespace au diff --git a/au/code/au/units/fahrenheit.hh b/au/code/au/units/fahrenheit.hh index 01fe5ea0..e6348469 100644 --- a/au/code/au/units/fahrenheit.hh +++ b/au/code/au/units/fahrenheit.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/fahrenheit_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/quantity_point.hh" diff --git a/au/code/au/units/fahrenheit_fwd.hh b/au/code/au/units/fahrenheit_fwd.hh new file mode 100644 index 00000000..562752f8 --- /dev/null +++ b/au/code/au/units/fahrenheit_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2022 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Fahrenheit; + +} // namespace au diff --git a/au/code/au/units/farads.hh b/au/code/au/units/farads.hh index 6cf5089a..de60db79 100644 --- a/au/code/au/units/farads.hh +++ b/au/code/au/units/farads.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/farads_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/coulombs.hh" diff --git a/au/code/au/units/farads_fwd.hh b/au/code/au/units/farads_fwd.hh new file mode 100644 index 00000000..1b0ab66a --- /dev/null +++ b/au/code/au/units/farads_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Farads; + +} // namespace au diff --git a/au/code/au/units/fathoms.hh b/au/code/au/units/fathoms.hh index b73e75d4..77e54fd4 100644 --- a/au/code/au/units/fathoms.hh +++ b/au/code/au/units/fathoms.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/fathoms_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/feet.hh" diff --git a/au/code/au/units/fathoms_fwd.hh b/au/code/au/units/fathoms_fwd.hh new file mode 100644 index 00000000..15cb23a7 --- /dev/null +++ b/au/code/au/units/fathoms_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Fathoms; + +} // namespace au diff --git a/au/code/au/units/feet.hh b/au/code/au/units/feet.hh index f6e94466..aea57db4 100644 --- a/au/code/au/units/feet.hh +++ b/au/code/au/units/feet.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/feet_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/inches.hh" diff --git a/au/code/au/units/feet_fwd.hh b/au/code/au/units/feet_fwd.hh new file mode 100644 index 00000000..4bd99d75 --- /dev/null +++ b/au/code/au/units/feet_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Feet; + +} // namespace au diff --git a/au/code/au/units/furlongs.hh b/au/code/au/units/furlongs.hh index ff40fc53..7ab65146 100644 --- a/au/code/au/units/furlongs.hh +++ b/au/code/au/units/furlongs.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/furlongs_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/miles.hh" diff --git a/au/code/au/units/furlongs_fwd.hh b/au/code/au/units/furlongs_fwd.hh new file mode 100644 index 00000000..7d06bf51 --- /dev/null +++ b/au/code/au/units/furlongs_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Furlongs; + +} // namespace au diff --git a/au/code/au/units/grams.hh b/au/code/au/units/grams.hh index 005992dc..f15c70ba 100644 --- a/au/code/au/units/grams.hh +++ b/au/code/au/units/grams.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/grams_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/grams_fwd.hh b/au/code/au/units/grams_fwd.hh new file mode 100644 index 00000000..fb5f1a40 --- /dev/null +++ b/au/code/au/units/grams_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Grams; + +} // namespace au diff --git a/au/code/au/units/grays.hh b/au/code/au/units/grays.hh index 9c8a45dc..bac082d9 100644 --- a/au/code/au/units/grays.hh +++ b/au/code/au/units/grays.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/grays_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/grays_fwd.hh b/au/code/au/units/grays_fwd.hh new file mode 100644 index 00000000..41eb953a --- /dev/null +++ b/au/code/au/units/grays_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Grays; + +} // namespace au diff --git a/au/code/au/units/henries.hh b/au/code/au/units/henries.hh index 312312e0..33653d8f 100644 --- a/au/code/au/units/henries.hh +++ b/au/code/au/units/henries.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/henries_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/amperes.hh" diff --git a/au/code/au/units/henries_fwd.hh b/au/code/au/units/henries_fwd.hh new file mode 100644 index 00000000..fc568182 --- /dev/null +++ b/au/code/au/units/henries_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Henries; + +} // namespace au diff --git a/au/code/au/units/hertz.hh b/au/code/au/units/hertz.hh index a44b22a3..99bae0ff 100644 --- a/au/code/au/units/hertz.hh +++ b/au/code/au/units/hertz.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/hertz_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/seconds.hh" diff --git a/au/code/au/units/hertz_fwd.hh b/au/code/au/units/hertz_fwd.hh new file mode 100644 index 00000000..8c1b3a26 --- /dev/null +++ b/au/code/au/units/hertz_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Hertz; + +} // namespace au diff --git a/au/code/au/units/hours.hh b/au/code/au/units/hours.hh index 7b77d807..2b29e32f 100644 --- a/au/code/au/units/hours.hh +++ b/au/code/au/units/hours.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/hours_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/minutes.hh" diff --git a/au/code/au/units/hours_fwd.hh b/au/code/au/units/hours_fwd.hh new file mode 100644 index 00000000..88a10f54 --- /dev/null +++ b/au/code/au/units/hours_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Hours; + +} // namespace au diff --git a/au/code/au/units/inches.hh b/au/code/au/units/inches.hh index cc71994b..3dd66b1d 100644 --- a/au/code/au/units/inches.hh +++ b/au/code/au/units/inches.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/inches_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/inches_fwd.hh b/au/code/au/units/inches_fwd.hh new file mode 100644 index 00000000..20c21bb2 --- /dev/null +++ b/au/code/au/units/inches_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Inches; + +} // namespace au diff --git a/au/code/au/units/joules.hh b/au/code/au/units/joules.hh index 61c491d1..d11d6c0a 100644 --- a/au/code/au/units/joules.hh +++ b/au/code/au/units/joules.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/joules_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/meters.hh" diff --git a/au/code/au/units/joules_fwd.hh b/au/code/au/units/joules_fwd.hh new file mode 100644 index 00000000..86bdc8bf --- /dev/null +++ b/au/code/au/units/joules_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Joules; + +} // namespace au diff --git a/au/code/au/units/katals.hh b/au/code/au/units/katals.hh index 2357dd29..21bfe2dc 100644 --- a/au/code/au/units/katals.hh +++ b/au/code/au/units/katals.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/katals_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/moles.hh" diff --git a/au/code/au/units/katals_fwd.hh b/au/code/au/units/katals_fwd.hh new file mode 100644 index 00000000..e6c9632a --- /dev/null +++ b/au/code/au/units/katals_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Katals; + +} // namespace au diff --git a/au/code/au/units/kelvins.hh b/au/code/au/units/kelvins.hh index 0fe646e1..4c9c7669 100644 --- a/au/code/au/units/kelvins.hh +++ b/au/code/au/units/kelvins.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/kelvins_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/quantity_point.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/kelvins_fwd.hh b/au/code/au/units/kelvins_fwd.hh new file mode 100644 index 00000000..296a293d --- /dev/null +++ b/au/code/au/units/kelvins_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Kelvins; + +} // namespace au diff --git a/au/code/au/units/knots.hh b/au/code/au/units/knots.hh index af5d3ba1..23af955c 100644 --- a/au/code/au/units/knots.hh +++ b/au/code/au/units/knots.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/knots_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/hours.hh" diff --git a/au/code/au/units/knots_fwd.hh b/au/code/au/units/knots_fwd.hh new file mode 100644 index 00000000..12ef238a --- /dev/null +++ b/au/code/au/units/knots_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Knots; + +} // namespace au diff --git a/au/code/au/units/liters.hh b/au/code/au/units/liters.hh index ae8013c7..3cbfd269 100644 --- a/au/code/au/units/liters.hh +++ b/au/code/au/units/liters.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/liters_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/liters_fwd.hh b/au/code/au/units/liters_fwd.hh new file mode 100644 index 00000000..b86ebd33 --- /dev/null +++ b/au/code/au/units/liters_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Liters; + +} // namespace au diff --git a/au/code/au/units/lumens.hh b/au/code/au/units/lumens.hh index ed842aa8..8a00f5b5 100644 --- a/au/code/au/units/lumens.hh +++ b/au/code/au/units/lumens.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/lumens_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/candelas.hh" diff --git a/au/code/au/units/lumens_fwd.hh b/au/code/au/units/lumens_fwd.hh new file mode 100644 index 00000000..80f64dac --- /dev/null +++ b/au/code/au/units/lumens_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Lumens; + +} // namespace au diff --git a/au/code/au/units/lux.hh b/au/code/au/units/lux.hh index 3b13572d..9f802bd3 100644 --- a/au/code/au/units/lux.hh +++ b/au/code/au/units/lux.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/lux_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/lumens.hh" diff --git a/au/code/au/units/lux_fwd.hh b/au/code/au/units/lux_fwd.hh new file mode 100644 index 00000000..110fc51c --- /dev/null +++ b/au/code/au/units/lux_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Lux; + +} // namespace au diff --git a/au/code/au/units/meters.hh b/au/code/au/units/meters.hh index 898936f5..5e9e8999 100644 --- a/au/code/au/units/meters.hh +++ b/au/code/au/units/meters.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/meters_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/quantity_point.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/meters_fwd.hh b/au/code/au/units/meters_fwd.hh new file mode 100644 index 00000000..7638c6bc --- /dev/null +++ b/au/code/au/units/meters_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Meters; + +} // namespace au diff --git a/au/code/au/units/miles.hh b/au/code/au/units/miles.hh index 7fca0661..5cd4b590 100644 --- a/au/code/au/units/miles.hh +++ b/au/code/au/units/miles.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/miles_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/feet.hh" diff --git a/au/code/au/units/miles_fwd.hh b/au/code/au/units/miles_fwd.hh new file mode 100644 index 00000000..f2eae844 --- /dev/null +++ b/au/code/au/units/miles_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Miles; + +} // namespace au diff --git a/au/code/au/units/minutes.hh b/au/code/au/units/minutes.hh index 452f1739..5f141f2a 100644 --- a/au/code/au/units/minutes.hh +++ b/au/code/au/units/minutes.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/minutes_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/seconds.hh" diff --git a/au/code/au/units/minutes_fwd.hh b/au/code/au/units/minutes_fwd.hh new file mode 100644 index 00000000..9749bd9f --- /dev/null +++ b/au/code/au/units/minutes_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Minutes; + +} // namespace au diff --git a/au/code/au/units/moles.hh b/au/code/au/units/moles.hh index 01053070..5cd9026f 100644 --- a/au/code/au/units/moles.hh +++ b/au/code/au/units/moles.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/moles_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/moles_fwd.hh b/au/code/au/units/moles_fwd.hh new file mode 100644 index 00000000..4a903e97 --- /dev/null +++ b/au/code/au/units/moles_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Moles; + +} // namespace au diff --git a/au/code/au/units/nautical_miles.hh b/au/code/au/units/nautical_miles.hh index b6521c79..b0e831f5 100644 --- a/au/code/au/units/nautical_miles.hh +++ b/au/code/au/units/nautical_miles.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/nautical_miles_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/meters.hh" diff --git a/au/code/au/units/nautical_miles_fwd.hh b/au/code/au/units/nautical_miles_fwd.hh new file mode 100644 index 00000000..e2a858de --- /dev/null +++ b/au/code/au/units/nautical_miles_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct NauticalMiles; + +} // namespace au diff --git a/au/code/au/units/newtons.hh b/au/code/au/units/newtons.hh index 2f2bdf6a..1b180e94 100644 --- a/au/code/au/units/newtons.hh +++ b/au/code/au/units/newtons.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/newtons_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/newtons_fwd.hh b/au/code/au/units/newtons_fwd.hh new file mode 100644 index 00000000..c65569f0 --- /dev/null +++ b/au/code/au/units/newtons_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Newtons; + +} // namespace au diff --git a/au/code/au/units/ohms.hh b/au/code/au/units/ohms.hh index 8f6bc272..45b2a38b 100644 --- a/au/code/au/units/ohms.hh +++ b/au/code/au/units/ohms.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/ohms_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/amperes.hh" diff --git a/au/code/au/units/ohms_fwd.hh b/au/code/au/units/ohms_fwd.hh new file mode 100644 index 00000000..1cb13969 --- /dev/null +++ b/au/code/au/units/ohms_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Ohms; + +} // namespace au diff --git a/au/code/au/units/pascals.hh b/au/code/au/units/pascals.hh index a2a81560..42350db1 100644 --- a/au/code/au/units/pascals.hh +++ b/au/code/au/units/pascals.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/pascals_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/quantity_point.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/pascals_fwd.hh b/au/code/au/units/pascals_fwd.hh new file mode 100644 index 00000000..03b45029 --- /dev/null +++ b/au/code/au/units/pascals_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Pascals; + +} // namespace au diff --git a/au/code/au/units/percent.hh b/au/code/au/units/percent.hh index 9a917621..ed01e204 100644 --- a/au/code/au/units/percent.hh +++ b/au/code/au/units/percent.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/percent_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/unos.hh" diff --git a/au/code/au/units/percent_fwd.hh b/au/code/au/units/percent_fwd.hh new file mode 100644 index 00000000..7aaf83db --- /dev/null +++ b/au/code/au/units/percent_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Percent; + +} // namespace au diff --git a/au/code/au/units/pounds_force.hh b/au/code/au/units/pounds_force.hh index b48603a2..6e0ca3ca 100644 --- a/au/code/au/units/pounds_force.hh +++ b/au/code/au/units/pounds_force.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/pounds_force_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/pounds_mass.hh" diff --git a/au/code/au/units/pounds_force_fwd.hh b/au/code/au/units/pounds_force_fwd.hh new file mode 100644 index 00000000..b8132a5f --- /dev/null +++ b/au/code/au/units/pounds_force_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct PoundsForce; + +} // namespace au diff --git a/au/code/au/units/pounds_mass.hh b/au/code/au/units/pounds_mass.hh index 0c1bdb74..a3e80e60 100644 --- a/au/code/au/units/pounds_mass.hh +++ b/au/code/au/units/pounds_mass.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/pounds_mass_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/prefix.hh" #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/pounds_mass_fwd.hh b/au/code/au/units/pounds_mass_fwd.hh new file mode 100644 index 00000000..e747d5ad --- /dev/null +++ b/au/code/au/units/pounds_mass_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct PoundsMass; + +} // namespace au diff --git a/au/code/au/units/radians.hh b/au/code/au/units/radians.hh index ed368730..f8eecc3e 100644 --- a/au/code/au/units/radians.hh +++ b/au/code/au/units/radians.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/radians_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/radians_fwd.hh b/au/code/au/units/radians_fwd.hh new file mode 100644 index 00000000..24a08652 --- /dev/null +++ b/au/code/au/units/radians_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Radians; + +} // namespace au diff --git a/au/code/au/units/revolutions.hh b/au/code/au/units/revolutions.hh index a2432546..d804910e 100644 --- a/au/code/au/units/revolutions.hh +++ b/au/code/au/units/revolutions.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/revolutions_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/degrees.hh" diff --git a/au/code/au/units/revolutions_fwd.hh b/au/code/au/units/revolutions_fwd.hh new file mode 100644 index 00000000..e96ce9d3 --- /dev/null +++ b/au/code/au/units/revolutions_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Revolutions; + +} // namespace au diff --git a/au/code/au/units/seconds.hh b/au/code/au/units/seconds.hh index 2d37ea79..2a137c51 100644 --- a/au/code/au/units/seconds.hh +++ b/au/code/au/units/seconds.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/seconds_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" diff --git a/au/code/au/units/seconds_fwd.hh b/au/code/au/units/seconds_fwd.hh new file mode 100644 index 00000000..c9250e08 --- /dev/null +++ b/au/code/au/units/seconds_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Seconds; + +} // namespace au diff --git a/au/code/au/units/siemens.hh b/au/code/au/units/siemens.hh index 808528f0..d3777889 100644 --- a/au/code/au/units/siemens.hh +++ b/au/code/au/units/siemens.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/siemens_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/ohms.hh" diff --git a/au/code/au/units/siemens_fwd.hh b/au/code/au/units/siemens_fwd.hh new file mode 100644 index 00000000..4c24aa67 --- /dev/null +++ b/au/code/au/units/siemens_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Siemens; + +} // namespace au diff --git a/au/code/au/units/slugs.hh b/au/code/au/units/slugs.hh index f5066e0a..19a2cd85 100644 --- a/au/code/au/units/slugs.hh +++ b/au/code/au/units/slugs.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/slugs_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/feet.hh" diff --git a/au/code/au/units/slugs_fwd.hh b/au/code/au/units/slugs_fwd.hh new file mode 100644 index 00000000..87760071 --- /dev/null +++ b/au/code/au/units/slugs_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Slugs; + +} // namespace au diff --git a/au/code/au/units/standard_gravity.hh b/au/code/au/units/standard_gravity.hh index 8a5c3f0f..60317fdf 100644 --- a/au/code/au/units/standard_gravity.hh +++ b/au/code/au/units/standard_gravity.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/standard_gravity_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/meters.hh" diff --git a/au/code/au/units/standard_gravity_fwd.hh b/au/code/au/units/standard_gravity_fwd.hh new file mode 100644 index 00000000..1aa17b90 --- /dev/null +++ b/au/code/au/units/standard_gravity_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct StandardGravity; + +} // namespace au diff --git a/au/code/au/units/steradians.hh b/au/code/au/units/steradians.hh index 51986c7c..83c3e229 100644 --- a/au/code/au/units/steradians.hh +++ b/au/code/au/units/steradians.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/steradians_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/radians.hh" diff --git a/au/code/au/units/steradians_fwd.hh b/au/code/au/units/steradians_fwd.hh new file mode 100644 index 00000000..313ac96b --- /dev/null +++ b/au/code/au/units/steradians_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Steradians; + +} // namespace au diff --git a/au/code/au/units/tesla.hh b/au/code/au/units/tesla.hh index 70df8aba..9bbf69f8 100644 --- a/au/code/au/units/tesla.hh +++ b/au/code/au/units/tesla.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/tesla_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/meters.hh" diff --git a/au/code/au/units/tesla_fwd.hh b/au/code/au/units/tesla_fwd.hh new file mode 100644 index 00000000..68dd9385 --- /dev/null +++ b/au/code/au/units/tesla_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Tesla; + +} // namespace au diff --git a/au/code/au/units/unos.hh b/au/code/au/units/unos.hh index 04ce1e65..9fbe87dc 100644 --- a/au/code/au/units/unos.hh +++ b/au/code/au/units/unos.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/unos_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" namespace au { diff --git a/au/code/au/units/unos_fwd.hh b/au/code/au/units/unos_fwd.hh new file mode 100644 index 00000000..21fd38a7 --- /dev/null +++ b/au/code/au/units/unos_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Unos; + +} // namespace au diff --git a/au/code/au/units/us_gallons.hh b/au/code/au/units/us_gallons.hh index 8c821098..145ccfc7 100644 --- a/au/code/au/units/us_gallons.hh +++ b/au/code/au/units/us_gallons.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/us_gallons_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/units/inches.hh" namespace au { diff --git a/au/code/au/units/us_gallons_fwd.hh b/au/code/au/units/us_gallons_fwd.hh new file mode 100644 index 00000000..7d06fb13 --- /dev/null +++ b/au/code/au/units/us_gallons_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct USGallons; + +} // namespace au diff --git a/au/code/au/units/us_pints.hh b/au/code/au/units/us_pints.hh index d440304e..5f8cccae 100644 --- a/au/code/au/units/us_pints.hh +++ b/au/code/au/units/us_pints.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/us_pints_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/units/inches.hh" namespace au { diff --git a/au/code/au/units/us_pints_fwd.hh b/au/code/au/units/us_pints_fwd.hh new file mode 100644 index 00000000..5746a59c --- /dev/null +++ b/au/code/au/units/us_pints_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct USPints; + +} // namespace au diff --git a/au/code/au/units/us_quarts.hh b/au/code/au/units/us_quarts.hh index 25420801..4123431d 100644 --- a/au/code/au/units/us_quarts.hh +++ b/au/code/au/units/us_quarts.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/us_quarts_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/units/inches.hh" namespace au { diff --git a/au/code/au/units/us_quarts_fwd.hh b/au/code/au/units/us_quarts_fwd.hh new file mode 100644 index 00000000..7dcd2d74 --- /dev/null +++ b/au/code/au/units/us_quarts_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct USQuarts; + +} // namespace au diff --git a/au/code/au/units/volts.hh b/au/code/au/units/volts.hh index af375c6b..13614904 100644 --- a/au/code/au/units/volts.hh +++ b/au/code/au/units/volts.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/volts_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/amperes.hh" diff --git a/au/code/au/units/volts_fwd.hh b/au/code/au/units/volts_fwd.hh new file mode 100644 index 00000000..fc06b53c --- /dev/null +++ b/au/code/au/units/volts_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Volts; + +} // namespace au diff --git a/au/code/au/units/watts.hh b/au/code/au/units/watts.hh index ebd27fae..c82fecf5 100644 --- a/au/code/au/units/watts.hh +++ b/au/code/au/units/watts.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/watts_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/joules.hh" diff --git a/au/code/au/units/watts_fwd.hh b/au/code/au/units/watts_fwd.hh new file mode 100644 index 00000000..eeaefa24 --- /dev/null +++ b/au/code/au/units/watts_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Watts; + +} // namespace au diff --git a/au/code/au/units/webers.hh b/au/code/au/units/webers.hh index 032697a3..31716ce8 100644 --- a/au/code/au/units/webers.hh +++ b/au/code/au/units/webers.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/webers_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/seconds.hh" diff --git a/au/code/au/units/webers_fwd.hh b/au/code/au/units/webers_fwd.hh new file mode 100644 index 00000000..0a0a3ca3 --- /dev/null +++ b/au/code/au/units/webers_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Webers; + +} // namespace au diff --git a/au/code/au/units/yards.hh b/au/code/au/units/yards.hh index c196d57d..fd199b94 100644 --- a/au/code/au/units/yards.hh +++ b/au/code/au/units/yards.hh @@ -14,6 +14,9 @@ #pragma once +#include "au/units/yards_fwd.hh" +// Keep corresponding `_fwd.hh` file on top. + #include "au/quantity.hh" #include "au/unit_symbol.hh" #include "au/units/feet.hh" diff --git a/au/code/au/units/yards_fwd.hh b/au/code/au/units/yards_fwd.hh new file mode 100644 index 00000000..70eb4a8a --- /dev/null +++ b/au/code/au/units/yards_fwd.hh @@ -0,0 +1,21 @@ +// Copyright 2024 Aurora Operations, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +namespace au { + +struct Yards; + +} // namespace au diff --git a/docs/alternatives/index.md b/docs/alternatives/index.md index f860511d..5badf78e 100644 --- a/docs/alternatives/index.md +++ b/docs/alternatives/index.md @@ -201,7 +201,12 @@ These costs can bring significant benefits, but we still want them to be as smal Very slow, but can be greatly improved by removing I/O support and most units - Possibly "best", but will need to assess all libraries on the same code + +
    +
  • Includes `fwd.hh` headers
  • +
  • Possibly "best" overall, but will need to assess all libraries on the same code
  • +
+ diff --git a/docs/install.md b/docs/install.md index 59833520..d14fe1ad 100644 --- a/docs/install.md +++ b/docs/install.md @@ -120,7 +120,7 @@ to your `deps` attribute, and include the appropriate files. | Dependency | Headers provided | Notes | |------------|------------------|-------| -| `@au//au` | `"au/au.hh"`
`"au/units/*.hh"` | Core library functionality. See [all available units](https://github.com/aurora-opensource/au/tree/main/au/units) | +| `@au//au` | `"au/au.hh"`
`"au/fwd.hh"`
`"au/units/*.hh"`
`"au/units/*_fwd.hh"` | Core library functionality. See [all available units](https://github.com/aurora-opensource/au/tree/main/au/units) | | `@au//au:io` | `"au/io.hh"` | `operator<<` support | | `@au//au:testing` | `"au/testing.hh"` | Utilities for writing googletest tests
_Note:_ `testonly = True` | @@ -141,7 +141,7 @@ In either case, here are the main targets and include files provided by the Au l | Target | Headers provided | Notes | |--------|------------------|-------| -| `Au::au` | `"au/au.hh"`
`"au/io.hh"`
`"au/units/*.hh"` | Core library functionality. See [all available units](https://github.com/aurora-opensource/au/tree/main/au/units) | +| `Au::au` | `"au/au.hh"`
`"au/fwd.hh"`
`"au/io.hh"`
`"au/units/*.hh"`
`"au/units/*_fwd.hh"` | Core library functionality. See [all available units](https://github.com/aurora-opensource/au/tree/main/au/units) | | `Au::testing` | `"au/testing.hh"` | Utilities for writing googletest tests | !!! note