From 33a3f3cde81476838a9b5d7ff2922bcca2d7473c Mon Sep 17 00:00:00 2001 From: Stuart Bowman Date: Mon, 8 Jun 2026 12:18:14 -0400 Subject: [PATCH 1/7] chore: switch over to external repo for cppuom --- AircraftDynamicsTestFramework/CMakeLists.txt | 2 ++ CMakeLists.txt | 7 ++++++- Loader/CMakeLists.txt | 6 ++++-- Public/CMakeLists.txt | 10 ++++++---- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/AircraftDynamicsTestFramework/CMakeLists.txt b/AircraftDynamicsTestFramework/CMakeLists.txt index a3c98af..e0b5ed2 100644 --- a/AircraftDynamicsTestFramework/CMakeLists.txt +++ b/AircraftDynamicsTestFramework/CMakeLists.txt @@ -50,6 +50,8 @@ target_include_directories(framework PUBLIC ${geolib_idealab_INCLUDE_DIRS} ${LOG4CPLUS_DIRS}) target_link_libraries(framework + PUBLIC + mitre::cppuom ${BADA_LIBRARY} ${SAMPLE_ALGORITHM_LIBRARY} log4cplusS diff --git a/CMakeLists.txt b/CMakeLists.txt index a824a6b..99ece1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,12 @@ if (log4cplus_ADDED) ${log4cplus_SOURCE_DIR}/include) endif () -set (unitslib_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/unitsLib/units-2.1) +CPMAddPackage( + NAME cppuom + GIT_REPOSITORY https://github.com/mitre/cppuom.git + GIT_TAG 2.2 +) + set (LOADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Loader) set (PUBLIC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Public) set (FRAMEWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/AircraftDynamicsTestFramework) diff --git a/Loader/CMakeLists.txt b/Loader/CMakeLists.txt index 413883d..57a7f0f 100644 --- a/Loader/CMakeLists.txt +++ b/Loader/CMakeLists.txt @@ -16,9 +16,11 @@ add_library(loader STATIC LoggingLoadable.cpp RunFileArchiveDirector.cpp TokenStream.cpp) -target_link_libraries(loader log4cplusS) +target_link_libraries(loader + PUBLIC + log4cplusS + mitre::cppuom) target_include_directories(loader PUBLIC - ${unitslib_INCLUDE_DIRS} ${aaesim_INCLUDE_DIRS} ${LOG4CPLUS_DIRS} ) diff --git a/Public/CMakeLists.txt b/Public/CMakeLists.txt index 425319b..dbf111b 100644 --- a/Public/CMakeLists.txt +++ b/Public/CMakeLists.txt @@ -109,8 +109,10 @@ target_include_directories(pub PUBLIC ${aaesim_INCLUDE_DIRS} ${minicsv_INCLUDE_DIR}) target_link_libraries(pub - loader - geolib - log4cplusS - nlohmann_json::nlohmann_json + PUBLIC + loader + mitre::cppuom + geolib + log4cplusS + nlohmann_json::nlohmann_json "$<$,$,9.1>>:-lstdc++fs>") From ee27d97161fec043163687cab2288f75a3e12f18 Mon Sep 17 00:00:00 2001 From: Stuart Bowman Date: Mon, 8 Jun 2026 12:19:02 -0400 Subject: [PATCH 2/7] chore: fully remove old cppuom local source --- unitsLib/.gitignore | 10 - unitsLib/CMakeLists.txt | 50 -- unitsLib/README | 2 - unitsLib/units-2.1/scalar/Acceleration.h | 63 --- unitsLib/units-2.1/scalar/Angle.h | 105 ----- unitsLib/units-2.1/scalar/Angle.i | 96 ---- .../units-2.1/scalar/AngularAcceleration.h | 64 --- unitsLib/units-2.1/scalar/AngularSpeed.h | 39 -- unitsLib/units-2.1/scalar/Area.h | 74 --- unitsLib/units-2.1/scalar/Current.h | 32 -- unitsLib/units-2.1/scalar/Density.h | 61 --- unitsLib/units-2.1/scalar/Force.h | 30 -- unitsLib/units-2.1/scalar/Format.h | 224 --------- unitsLib/units-2.1/scalar/Format.i | 235 ---------- unitsLib/units-2.1/scalar/Frequency.h | 33 -- unitsLib/units-2.1/scalar/Inertia.h | 56 --- unitsLib/units-2.1/scalar/Length.h | 36 -- unitsLib/units-2.1/scalar/MagneticField.h | 36 -- unitsLib/units-2.1/scalar/MagneticFlux.h | 34 -- .../units-2.1/scalar/MagneticFluxDensity.h | 35 -- unitsLib/units-2.1/scalar/Makefile | 70 --- unitsLib/units-2.1/scalar/Mass.h | 31 -- unitsLib/units-2.1/scalar/MassFlowRate.h | 42 -- unitsLib/units-2.1/scalar/Power.h | 34 -- unitsLib/units-2.1/scalar/Pressure.h | 48 -- unitsLib/units-2.1/scalar/ProductUnitFormat.h | 55 --- unitsLib/units-2.1/scalar/ProductUnitFormat.i | 45 -- unitsLib/units-2.1/scalar/RatioUnitFormat.h | 55 --- unitsLib/units-2.1/scalar/RatioUnitFormat.i | 43 -- unitsLib/units-2.1/scalar/SignedAngle.h | 129 ------ unitsLib/units-2.1/scalar/SignedAngle.i | 167 ------- unitsLib/units-2.1/scalar/SpecificUnit.h | 113 ----- unitsLib/units-2.1/scalar/SpecificUnit.i | 78 ---- unitsLib/units-2.1/scalar/Speed.h | 43 -- unitsLib/units-2.1/scalar/Temperature.h | 180 -------- unitsLib/units-2.1/scalar/Temperature.i | 218 --------- unitsLib/units-2.1/scalar/Time.h | 34 -- unitsLib/units-2.1/scalar/Torque.h | 34 -- unitsLib/units-2.1/scalar/Unit.h | 428 ------------------ unitsLib/units-2.1/scalar/Unit.i | 394 ---------------- unitsLib/units-2.1/scalar/UnsignedAngle.h | 126 ------ unitsLib/units-2.1/scalar/UnsignedAngle.i | 161 ------- unitsLib/units-2.1/scalar/Voltage.h | 32 -- unitsLib/units-2.1/scalar/Volume.h | 79 ---- unitsLib/units-2.1/scalar/makeUnitList | 66 --- unitsLib/units-2.1/system/units_config.h | 29 -- 46 files changed, 4049 deletions(-) delete mode 100755 unitsLib/.gitignore delete mode 100644 unitsLib/CMakeLists.txt delete mode 100755 unitsLib/README delete mode 100755 unitsLib/units-2.1/scalar/Acceleration.h delete mode 100755 unitsLib/units-2.1/scalar/Angle.h delete mode 100755 unitsLib/units-2.1/scalar/Angle.i delete mode 100755 unitsLib/units-2.1/scalar/AngularAcceleration.h delete mode 100755 unitsLib/units-2.1/scalar/AngularSpeed.h delete mode 100755 unitsLib/units-2.1/scalar/Area.h delete mode 100755 unitsLib/units-2.1/scalar/Current.h delete mode 100755 unitsLib/units-2.1/scalar/Density.h delete mode 100755 unitsLib/units-2.1/scalar/Force.h delete mode 100755 unitsLib/units-2.1/scalar/Format.h delete mode 100755 unitsLib/units-2.1/scalar/Format.i delete mode 100755 unitsLib/units-2.1/scalar/Frequency.h delete mode 100755 unitsLib/units-2.1/scalar/Inertia.h delete mode 100755 unitsLib/units-2.1/scalar/Length.h delete mode 100755 unitsLib/units-2.1/scalar/MagneticField.h delete mode 100755 unitsLib/units-2.1/scalar/MagneticFlux.h delete mode 100755 unitsLib/units-2.1/scalar/MagneticFluxDensity.h delete mode 100755 unitsLib/units-2.1/scalar/Makefile delete mode 100755 unitsLib/units-2.1/scalar/Mass.h delete mode 100755 unitsLib/units-2.1/scalar/MassFlowRate.h delete mode 100755 unitsLib/units-2.1/scalar/Power.h delete mode 100755 unitsLib/units-2.1/scalar/Pressure.h delete mode 100755 unitsLib/units-2.1/scalar/ProductUnitFormat.h delete mode 100755 unitsLib/units-2.1/scalar/ProductUnitFormat.i delete mode 100755 unitsLib/units-2.1/scalar/RatioUnitFormat.h delete mode 100755 unitsLib/units-2.1/scalar/RatioUnitFormat.i delete mode 100755 unitsLib/units-2.1/scalar/SignedAngle.h delete mode 100755 unitsLib/units-2.1/scalar/SignedAngle.i delete mode 100755 unitsLib/units-2.1/scalar/SpecificUnit.h delete mode 100755 unitsLib/units-2.1/scalar/SpecificUnit.i delete mode 100755 unitsLib/units-2.1/scalar/Speed.h delete mode 100755 unitsLib/units-2.1/scalar/Temperature.h delete mode 100755 unitsLib/units-2.1/scalar/Temperature.i delete mode 100755 unitsLib/units-2.1/scalar/Time.h delete mode 100755 unitsLib/units-2.1/scalar/Torque.h delete mode 100755 unitsLib/units-2.1/scalar/Unit.h delete mode 100755 unitsLib/units-2.1/scalar/Unit.i delete mode 100755 unitsLib/units-2.1/scalar/UnsignedAngle.h delete mode 100755 unitsLib/units-2.1/scalar/UnsignedAngle.i delete mode 100755 unitsLib/units-2.1/scalar/Voltage.h delete mode 100755 unitsLib/units-2.1/scalar/Volume.h delete mode 100755 unitsLib/units-2.1/scalar/makeUnitList delete mode 100755 unitsLib/units-2.1/system/units_config.h diff --git a/unitsLib/.gitignore b/unitsLib/.gitignore deleted file mode 100755 index fddcb0d..0000000 --- a/unitsLib/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -*.so -*.exe -*.o -.settings/ -/Release -.project -.cproject -.autotools -.depend -/Debug diff --git a/unitsLib/CMakeLists.txt b/unitsLib/CMakeLists.txt deleted file mode 100644 index e113817..0000000 --- a/unitsLib/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -cmake_minimum_required(VERSION 3.0) - -set(SOURCE_FILES - units-2.1/scalar/Acceleration.h - units-2.1/scalar/Angle.h - units-2.1/scalar/Angle.i - units-2.1/scalar/AngularAcceleration.h - units-2.1/scalar/AngularSpeed.h - units-2.1/scalar/Area.h - units-2.1/scalar/Current.h - units-2.1/scalar/Density.h - units-2.1/scalar/Force.h - units-2.1/scalar/Format.h - units-2.1/scalar/Format.i - units-2.1/scalar/Frequency.h - units-2.1/scalar/Inertia.h - units-2.1/scalar/Length.h - units-2.1/scalar/MagneticField.h - units-2.1/scalar/MagneticFlux.h - units-2.1/scalar/MagneticFluxDensity.h - units-2.1/scalar/Mass.h - units-2.1/scalar/MassFlowRate.h - units-2.1/scalar/Power.h - units-2.1/scalar/Pressure.h - units-2.1/scalar/ProductUnitFormat.h - units-2.1/scalar/ProductUnitFormat.i - units-2.1/scalar/RatioUnitFormat.h - units-2.1/scalar/RatioUnitFormat.i - units-2.1/scalar/SignedAngle.h - units-2.1/scalar/SignedAngle.i - units-2.1/scalar/SpecificUnit.h - units-2.1/scalar/SpecificUnit.i - units-2.1/scalar/Speed.h - units-2.1/scalar/Temperature.h - units-2.1/scalar/Temperature.i - units-2.1/scalar/Time.h - units-2.1/scalar/Torque.h - units-2.1/scalar/Unit.h - units-2.1/scalar/Unit.i - units-2.1/scalar/UnsignedAngle.h - units-2.1/scalar/UnsignedAngle.i - units-2.1/scalar/Voltage.h - units-2.1/scalar/Volume.h - units-2.1/system/units_config.h -) - -set (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) - -add_library(units-2.1 STATIC ${SOURCE_FILES}) -SET_TARGET_PROPERTIES(units-2.1 PROPERTIES LINKER_LANGUAGE C) diff --git a/unitsLib/README b/unitsLib/README deleted file mode 100755 index 75dae7d..0000000 --- a/unitsLib/README +++ /dev/null @@ -1,2 +0,0 @@ -The units library site is http://tuoml.sourceforge.net/ -The library has been made available under the LGPLv2 license. diff --git a/unitsLib/units-2.1/scalar/Acceleration.h b/unitsLib/units-2.1/scalar/Acceleration.h deleted file mode 100755 index b1985c8..0000000 --- a/unitsLib/units-2.1/scalar/Acceleration.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// $Id: Acceleration.h,v 1.7.4.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of acceleration. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Acceleration_h -#define Units_Acceleration_h - -#include "SpecificUnit.h" -#include "Format.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Acceleration, 0, 1, -2, 0, 0, 0, 0, 0); - - -template -class AccelerationFormat: public Format -{ -public: - AccelerationFormat(Acceleration const & acceleration): - Format(acceleration) - { - } -}; - - -UNITS_DECLARE_SPECIFIC_UNIT(Acceleration, MetersSecondAcceleration, - "m/s^2", 1); -UNITS_DECLARE_SPECIFIC_UNIT(Acceleration, FeetSecondAcceleration, - "ft/s^2", 0.3048); -UNITS_DECLARE_SPECIFIC_UNIT(Acceleration, GsAcceleration, - "g", 9.80665); - - -} // namespace Units - - -#endif // Units_Acceleration_h diff --git a/unitsLib/units-2.1/scalar/Angle.h b/unitsLib/units-2.1/scalar/Angle.h deleted file mode 100755 index cde953d..0000000 --- a/unitsLib/units-2.1/scalar/Angle.h +++ /dev/null @@ -1,105 +0,0 @@ -// -// $Id: Angle.h,v 1.6.4.2 2005-12-16 06:27:29 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of angle. -// -// This is *not* a circular angle -- it does not wrap around. -// That means DegreesAngle(370) != DegreesAngle(10). The rationale -// for this is that some applications may need to measure angular -// distances which are greater than 360 degrees, such as measuring -// how far a wheel has turned. -// -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Angle_h -#define Units_Angle_h - -#include -#include "SpecificUnit.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Angle, 0, 0, 0, 0, 0, 0, 0, 1); - -//TODO: -//UNITS_DECLARE_BASE_UNIT(SolidAngle, 0, 0, 0, 0, 0, 0, 0, 2); - - -// Shorthand -#define UNITS_ANGLE_TYPE(ValueType_) Unit - - -// -// Trigonometric functions. -// - -#define UNITS_DECLARE_TRIG_FUNCTION_FOR_TYPE(function, template_args, ValueType_) \ -template \ -ValueType_ function(UNITS_ANGLE_TYPE(ValueType_) const & angle); \ -\ -template \ -UNITS_ANGLE_TYPE(ValueType_) arc##function(ValueType_ const value) - - - -#define UNITS_DECLARE_TRIG_FUNCTION(function) \ -UNITS_DECLARE_TRIG_FUNCTION_FOR_TYPE(function, typename ValueType, ValueType); \ -UNITS_DECLARE_TRIG_FUNCTION_FOR_TYPE(function, , double); \ -UNITS_DECLARE_TRIG_FUNCTION_FOR_TYPE(function, , float) - - -UNITS_DECLARE_TRIG_FUNCTION(sin); -UNITS_DECLARE_TRIG_FUNCTION(cos); -UNITS_DECLARE_TRIG_FUNCTION(tan); - - -template -UNITS_ANGLE_TYPE(ValueType) arctan2(ValueType const value1, - ValueType const value2); -template <> -UNITS_ANGLE_TYPE(double) arctan2(double const value1, - double const value2); -template <> -UNITS_ANGLE_TYPE(float) arctan2(float const value1, - float const value2); - - -// -// Normalize internal representation to compensate for "drift". -// This keeps the angle in the range -360..360 degrees. -// You might want to use this after doing a lot of Angle arithmetic, -// but it shouldn't usually be necessary except for in extreme cases. -// -template -UNITS_ANGLE_TYPE(ValueType) & -normalize(UNITS_ANGLE_TYPE(ValueType) & angle); - -template <> -UNITS_ANGLE_TYPE(double) & -normalize(UNITS_ANGLE_TYPE(double) & angle); - -template <> -UNITS_ANGLE_TYPE(float) & -normalize(UNITS_ANGLE_TYPE(float) & angle); - - -UNITS_DECLARE_SPECIFIC_UNIT(Angle, RadiansAngle, "rad", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Angle, DegreesAngle, "deg", M_PI/180.0); - - -} // namespace Units - - -#include "Angle.i" - -#endif // Units_Angle_h diff --git a/unitsLib/units-2.1/scalar/Angle.i b/unitsLib/units-2.1/scalar/Angle.i deleted file mode 100755 index 5aeb850..0000000 --- a/unitsLib/units-2.1/scalar/Angle.i +++ /dev/null @@ -1,96 +0,0 @@ -// -// $Id: Angle.i,v 1.1.1.1.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the Angle class. -// - -#ifndef Units_Angle_i -#define Units_Angle_i - - -namespace Units -{ - - -// Trigonometric functions. - -#define UNITS_DEFINE_TRIG_FUNCTION(function) \ -template <> \ -inline \ -double function(UNITS_ANGLE_TYPE(double) const & angle) \ -{ \ - return ::function(dRadiansAngle(angle).value()); \ -} \ -\ -template <> \ -inline \ -UNITS_ANGLE_TYPE(double) arc##function(double const value) \ -{ \ - return dRadiansAngle(::a##function(value)); \ -} \ -\ -template <> \ -inline \ -float function(UNITS_ANGLE_TYPE(float) const & angle) \ -{ \ - return ::function##f(fRadiansAngle(angle).value()); \ -} \ -\ -template <> \ -inline \ -UNITS_ANGLE_TYPE(float) arc##function(float const value) \ -{ \ - return fRadiansAngle(::a##function##f(value)); \ -} - -UNITS_DEFINE_TRIG_FUNCTION(sin) -UNITS_DEFINE_TRIG_FUNCTION(cos) -UNITS_DEFINE_TRIG_FUNCTION(tan) - - -template <> -inline -UNITS_ANGLE_TYPE(double) arctan2(double const value1, - double const value2) -{ - return dRadiansAngle(atan2(value1, - value2)); -} - -template <> -inline -UNITS_ANGLE_TYPE(float) arctan2(float const value1, - float const value2) -{ - return fRadiansAngle(atan2f(value1, - value2)); -} - - -template <> -inline -UNITS_ANGLE_TYPE(double) & -normalize(UNITS_ANGLE_TYPE(double) & angle) -{ - angle = dRadiansAngle(fmod(dRadiansAngle(angle).value(), - 2.0*M_PI)); - return angle; -} - -template <> -inline -UNITS_ANGLE_TYPE(float) & -normalize(UNITS_ANGLE_TYPE(float) & angle) -{ - angle = fRadiansAngle(fmodf(fRadiansAngle(angle).value(), - 2.0*M_PI)); - return angle; -} - - -} // namespace Units - - -#endif // Units_Angle_i diff --git a/unitsLib/units-2.1/scalar/AngularAcceleration.h b/unitsLib/units-2.1/scalar/AngularAcceleration.h deleted file mode 100755 index 42d74a9..0000000 --- a/unitsLib/units-2.1/scalar/AngularAcceleration.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// $Id: AngularAcceleration.h,v 1.3.4.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of angular acceleration. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_AngularAcceleration_h -#define Units_AngularAcceleration_h - -#include "SpecificUnit.h" -#include "Format.h" -#include "Angle.h" // for M_PI - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(AngularAcceleration, 0, 0, -2, 0, 0, 0, 0, 1); - - -template -class AngularAccelerationFormat: public Format -{ -public: - AngularAccelerationFormat(AngularAcceleration const & acceleration): - Format(acceleration) - { - } -}; - - -UNITS_DECLARE_SPECIFIC_UNIT(AngularAcceleration, - RadiansSecondAngularAcceleration, - "rad/s^2", 1); -UNITS_DECLARE_SPECIFIC_UNIT(AngularAcceleration, - DegreesSecondAngularAcceleration, - "deg/s^2", M_PI/180); - - -} // namespace Units - - -#endif // Units_AngularAcceleration_h diff --git a/unitsLib/units-2.1/scalar/AngularSpeed.h b/unitsLib/units-2.1/scalar/AngularSpeed.h deleted file mode 100755 index edac8b4..0000000 --- a/unitsLib/units-2.1/scalar/AngularSpeed.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// $Id: AngularSpeed.h,v 1.7.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of angular speed. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_AngularSpeed_h -#define Units_AngularSpeed_h - -#include "SpecificUnit.h" -#include "RatioUnitFormat.h" -#include "Angle.h" // for M_PI - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(AngularSpeed, 0, 0, -1, 0, 0, 0, 0, 1); - - -#define AngularSpeedFormat RatioUnitFormat - - -UNITS_DECLARE_SPECIFIC_UNIT(AngularSpeed, - RadiansPerSecondAngularSpeed, "rad/s", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(AngularSpeed, - DegreesPerSecondAngularSpeed, "deg/s", M_PI/180.0); -UNITS_DECLARE_SPECIFIC_UNIT(AngularSpeed, - RpmAngularSpeed, "rpm", 2*M_PI/60.0); - - -} // namespace Units - - -#endif // Units_AngularSpeed_h diff --git a/unitsLib/units-2.1/scalar/Area.h b/unitsLib/units-2.1/scalar/Area.h deleted file mode 100755 index 9b18fae..0000000 --- a/unitsLib/units-2.1/scalar/Area.h +++ /dev/null @@ -1,74 +0,0 @@ -// -// $Id: Area.h,v 1.6.4.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of area. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Area_h -#define Units_Area_h - -#include "SpecificUnit.h" -#include "Format.h" -#include "Length.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Area, 0, 2, 0, 0, 0, 0, 0, 0); - - -template -class AreaFormat: public Format -{ -public: - AreaFormat(Area const & area): - Format(area) - { - } -}; - - - -#define UNITS_AREA_DECLARE_LENGTH_SUBCLASS(LengthName, LengthUnitString) \ -UNITS_DECLARE_SPECIFIC_UNIT(Area, LengthName##Area, LengthUnitString"^2", \ - (SpecificUnitTraits::internalsPerUnit* \ - SpecificUnitTraits::internalsPerUnit)) - -UNITS_AREA_DECLARE_LENGTH_SUBCLASS(Inches, "in"); -UNITS_AREA_DECLARE_LENGTH_SUBCLASS(Feet, "ft"); -UNITS_AREA_DECLARE_LENGTH_SUBCLASS(Meters, "m"); -UNITS_AREA_DECLARE_LENGTH_SUBCLASS(Kilometers, "km"); -UNITS_AREA_DECLARE_LENGTH_SUBCLASS(NauticalMiles, "nmi"); -UNITS_AREA_DECLARE_LENGTH_SUBCLASS(StatuteMiles, "mi"); - -// -// 1 acre = 43560 square ft -// -UNITS_DECLARE_SPECIFIC_UNIT(Area, AcresArea, "acres", 43560.0/10.76391042); - - -} // namespace Units - - -#endif // Units_Area_h diff --git a/unitsLib/units-2.1/scalar/Current.h b/unitsLib/units-2.1/scalar/Current.h deleted file mode 100755 index 7dfe74e..0000000 --- a/unitsLib/units-2.1/scalar/Current.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// $Id: Current.h,v 1.4.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of current. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Current_h -#define Units_Current_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Current, 0, 0, 0, 1, 0, 0, 0, 0); - - -UNITS_DECLARE_SPECIFIC_UNIT(Current, MicroampsCurrent, "uA", 1e-6); -UNITS_DECLARE_SPECIFIC_UNIT(Current, MilliampsCurrent, "mA", 1e-3); -UNITS_DECLARE_SPECIFIC_UNIT(Current, AmpsCurrent, "A", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Current, KiloampsCurrent, "kA", 1e3); - - -} // namespace Units - - -#endif // Units_Current_h diff --git a/unitsLib/units-2.1/scalar/Density.h b/unitsLib/units-2.1/scalar/Density.h deleted file mode 100755 index 524fc9e..0000000 --- a/unitsLib/units-2.1/scalar/Density.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// $Id: Density.h,v 1.5.4.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of density. -// The internal representation of the units is hidden from the user. -// -// NOTE: A Density can only be given a value indirectly; i.e. to -// specify 1 kg/m^3, do -// Density density = KilogramsMass(1)/MetersVolume(1) -// - -#ifndef Units_Density_h -#define Units_Density_h - -#include "SpecificUnit.h" -#include "Format.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Density, 1, -3, 0, 0, 0, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Density, KilogramsMeterDensity, "kg/m^3", 1); - - -template -class DensityFormat: public Format -{ -public: - DensityFormat(Density const & density): - Format(density) - { - } -}; - - -} // namespace Units - - -#endif // Units_Density_h diff --git a/unitsLib/units-2.1/scalar/Force.h b/unitsLib/units-2.1/scalar/Force.h deleted file mode 100755 index e32a316..0000000 --- a/unitsLib/units-2.1/scalar/Force.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// $Id: Force.h,v 1.7.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of force. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Force_h -#define Units_Force_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Force, 1, 1, -2, 0, 0, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Force, NewtonsForce, "N", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Force, PoundsForce, "lb", 4.4482216); -UNITS_DECLARE_SPECIFIC_UNIT(Force, OuncesForce, "oz", 0.2780); - - -} // namespace Units - - -#endif // Units_Force_h diff --git a/unitsLib/units-2.1/scalar/Format.h b/unitsLib/units-2.1/scalar/Format.h deleted file mode 100755 index 57e9841..0000000 --- a/unitsLib/units-2.1/scalar/Format.h +++ /dev/null @@ -1,224 +0,0 @@ -// -// $Id: Format.h,v 1.1.2.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Provide generic printing of any Unit<> class. -// - -#ifndef Units_Format_h -#define Units_Format_h - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#include -#endif -// These are only needed for the default Format typedefs. -#include "Time.h" -#include "Mass.h" -#include "Length.h" -#include "Current.h" -#include "Temperature.h" -#include "Angle.h" - - -namespace Units -{ - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -struct UnitsString -{ - static bool print(bool const havePrinted, - std::ostream & stream); -}; - -template -struct UnitsString -{ - static bool print(bool const havePrinted, - std::ostream & stream); -}; - -template -struct UnitsString -{ - static bool print(bool const havePrinted, - std::ostream & stream); -}; -#endif // UNITS_NO_IOSTREAM_OPERATORS - - -#define UNITS_FORMAT_TEMPLATE_DECL_ARGS \ - typename ValueType, \ - typename SpecificUnitMass, \ - typename SpecificUnitLength, \ - typename SpecificUnitTime, \ - typename SpecificUnitCurrent, \ - typename SpecificUnitTemperature, \ - typename SpecificUnitAmount, \ - typename SpecificUnitIntensity, \ - typename SpecificUnitAngle - -#define UNITS_FORMAT_TEMPLATE_ARGS \ - ValueType, \ - SpecificUnitMass, \ - SpecificUnitLength, \ - SpecificUnitTime, \ - SpecificUnitCurrent, \ - SpecificUnitTemperature, \ - SpecificUnitAmount, \ - SpecificUnitIntensity, \ - SpecificUnitAngle - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -struct UnitsStringFormatter -{ - static void print(std::ostream & stream); -}; -#endif - - -#define UNITS_POWER_TEMPLATE_ARGS \ - typename SpecificUnit::ValueType, \ - SpecificUnit::massExp * exponent, \ - SpecificUnit::lengthExp * exponent, \ - SpecificUnit::timeExp * exponent, \ - SpecificUnit::currentExp * exponent, \ - SpecificUnit::temperatureExp * exponent, \ - SpecificUnit::amountExp * exponent, \ - SpecificUnit::intensityExp * exponent, \ - SpecificUnit::angleExp * exponent - -/// -/// Raise a unit type to the given power. -/// -template -struct PositivePowerComputer -{ - static const Unit value; -}; - -template -struct PositivePowerComputer -{ - static const Unit value; -}; - - -template -struct PowerComputer -{ - static const Unit value; -}; - -template -struct PowerComputer -{ - static const Unit value; -}; - -template -struct PowerComputer -{ - static const Unit value; -}; - - -template -struct IntPower -{ - static const Unit value; -}; - - -template -struct ConversionFactor -{ - static const Unit value; -}; - - -template -class Format -{ -public: - template - Format(Unit const & unit); - - ValueType value() const; - -#ifndef UNITS_NO_IOSTREAM_OPERATORS - std::string const & unitsString() const; -#endif - -private: - ValueType _value; - -#ifndef UNITS_NO_IOSTREAM_OPERATORS - std::string _unitsString; -#endif -}; - - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & operator<< (std::ostream & stream, - Format const & format); -#endif - - -struct UnspecifiedUnit -{ - typedef UNITS_DEFAULT_VALUE_TYPE ValueType; - static const int massExp = 0; - static const int lengthExp = 0; - static const int timeExp = 0; - static const int currentExp = 0; - static const int temperatureExp = 0; - static const int amountExp = 0; - static const int intensityExp = 0; - static const int angleExp = 0; -}; - -typedef Format MksFormat; - -typedef Format CgsFormat; - - -} // namespace Units - - -#include "Format.i" - -#endif // Units_Format_h diff --git a/unitsLib/units-2.1/scalar/Format.i b/unitsLib/units-2.1/scalar/Format.i deleted file mode 100755 index 276d8c1..0000000 --- a/unitsLib/units-2.1/scalar/Format.i +++ /dev/null @@ -1,235 +0,0 @@ -// -// $Id: Format.i,v 1.1.2.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementation of the Format classes. -// - -#ifndef Units_Format_i -#define Units_Format_i - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#endif - - -namespace Units -{ - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -inline -bool UnitsString::print(bool const havePrinted, - std::ostream & stream) -{ - if (exponent < 0) - { - return havePrinted; - } - if (havePrinted) - { - stream << '-'; - } - stream << SpecificUnit::unitsString() << '^' << exponent; - return true; -} - -template -inline -bool UnitsString::print(bool const havePrinted, - std::ostream & stream) -{ - return havePrinted; -} - -template -inline -bool UnitsString::print(bool const havePrinted, - std::ostream & stream) -{ - if (havePrinted) - { - stream << '-'; - } - stream << SpecificUnit::unitsString(); - return true; -} - - -template -inline -void UnitsStringFormatter:: -print(std::ostream & stream) -{ - bool havePrinted = false; - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - if (!havePrinted) - { - stream << '1'; - } - if ((massExp_ >= 0) && - (lengthExp_ >= 0) && - (timeExp_ >= 0) && - (currentExp_ >= 0) && - (temperatureExp_ >= 0) && - (amountExp_ >= 0) && - (intensityExp_ >= 0) && - (angleExp_ >= 0)) - { - return; - } - stream << '/'; - havePrinted = false; - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); - havePrinted = UnitsString ::print(havePrinted, - stream); -} -#endif // UNITS_NO_IOSTREAM_OPERATORS - - -template -const Unit -PositivePowerComputer::value = -SpecificUnit(1.0)*PositivePowerComputer::value; - - -template -const Unit -PositivePowerComputer::value = 1.0; - - -template -const Unit -PowerComputer::value = -PositivePowerComputer::value; - -template -const Unit -PowerComputer::value = -(1.0/PositivePowerComputer::value); - -template -const Unit IntPower::value = -PowerComputer 0)>::value; - - -template -const Unit -ConversionFactor::value = -IntPower ::value* -IntPower ::value* -IntPower ::value* -IntPower ::value* -IntPower::value* -IntPower ::value* -IntPower ::value* -IntPower ::value; - - - -template -template -inline -Format:: -Format(Unit const & unit): - _value(unit/ConversionFactor::value) -{ -#ifndef UNITS_NO_IOSTREAM_OPERATORS - std::ostringstream unitsStringStream; - UnitsStringFormatter::print(unitsStringStream); - _unitsString = unitsStringStream.str(); -#endif -} - -template -inline -ValueType Format::value() const -{ - return _value; -} - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -inline -std::string const & Format::unitsString() const -{ - return _unitsString; -} - - -template -inline -std::ostream & operator<< (std::ostream & stream, - Format const & format) -{ - return stream << format.value() << ' ' << format.unitsString(); -} -#endif - - -} // namespace Units - - -#endif // Units_Format_i diff --git a/unitsLib/units-2.1/scalar/Frequency.h b/unitsLib/units-2.1/scalar/Frequency.h deleted file mode 100755 index c847fd1..0000000 --- a/unitsLib/units-2.1/scalar/Frequency.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// $Id: Frequency.h,v 1.6.4.2 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of frequency. Subclasses allow -// interpretation in specified units. The internal representation of -// the units is hidden from the user. -// - -#ifndef Units_Frequency_h -#define Units_Frequency_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Frequency, 0, 0, -1, 0, 0, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Frequency, HertzFrequency, "Hz", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Frequency, KilohertzFrequency, "KHz", 1.0e3); -UNITS_DECLARE_SPECIFIC_UNIT(Frequency, MegahertzFrequency, "MHz", 1.0e6); -UNITS_DECLARE_SPECIFIC_UNIT(Frequency, GigahertzFrequency, "GHz", 1.0e9); -UNITS_DECLARE_SPECIFIC_UNIT(Frequency, TerahertzFrequency, "THz", 1.0e12); - - -} // namespace Units - - -#endif // Units_Frequency_h diff --git a/unitsLib/units-2.1/scalar/Inertia.h b/unitsLib/units-2.1/scalar/Inertia.h deleted file mode 100755 index aa2ece0..0000000 --- a/unitsLib/units-2.1/scalar/Inertia.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// $Id: Inertia.h,v 1.4.4.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of inertia. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Inertia_h -#define Units_Inertia_h - -#include "SpecificUnit.h" -#include "Format.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Inertia, 1, 2, 0, 0, 0, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Inertia, KilogramsMeterInertia, "kg-m^2", 1); - -template -class InertiaFormat: public Format -{ -public: - InertiaFormat(Inertia const & inertia): - Format(inertia) - { - } -}; - - -} // namespace Units - - -#endif // Units_Inertia_h diff --git a/unitsLib/units-2.1/scalar/Length.h b/unitsLib/units-2.1/scalar/Length.h deleted file mode 100755 index 250bec8..0000000 --- a/unitsLib/units-2.1/scalar/Length.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// $Id: Length.h,v 1.6.4.2 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of length. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Length_h -#define Units_Length_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Length, 0, 1, 0, 0, 0, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Length, MicrometersLength, "um", 0.000001); -UNITS_DECLARE_SPECIFIC_UNIT(Length, MillimetersLength, "mm", 0.001); -UNITS_DECLARE_SPECIFIC_UNIT(Length, CentimetersLength, "cm", 0.01); -UNITS_DECLARE_SPECIFIC_UNIT(Length, MetersLength, "m", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Length, KilometersLength, "km", 1000.0); -UNITS_DECLARE_SPECIFIC_UNIT(Length, InchesLength, "in", 0.3048/12); -UNITS_DECLARE_SPECIFIC_UNIT(Length, FeetLength, "ft", 0.3048); -UNITS_DECLARE_SPECIFIC_UNIT(Length, NauticalMilesLength, "nmi", 1852.0); -UNITS_DECLARE_SPECIFIC_UNIT(Length, StatuteMilesLength, "mi", 1609.344); - - -} // namespace Units - - -#endif // Units_Length_h diff --git a/unitsLib/units-2.1/scalar/MagneticField.h b/unitsLib/units-2.1/scalar/MagneticField.h deleted file mode 100755 index 39f3454..0000000 --- a/unitsLib/units-2.1/scalar/MagneticField.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// $Id: MagneticField.h,v 1.1.2.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of magnetic field -// (current per units length). The internal representation of the -// units is hidden from the user. -// - -#ifndef Units_MagneticField_h -#define Units_MagneticField_h - -#include "SpecificUnit.h" -#include "RatioUnitFormat.h" - - -namespace Units -{ - -UNITS_DECLARE_BASE_UNIT(MagneticField, 0, -1, 0, 1, 0, 0, 0, 0); - -#define MagneticFieldFormat RatioUnitFormat - - -UNITS_DECLARE_SPECIFIC_UNIT(MagneticField, - AmpsPerMeterMagneticField, "A/m", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(MagneticField, - OerstedsMagneticField, "Oe", - 1000.0/(4*3.14159265358979323846)); - - -} // namespace Units - - -#endif // Units_MagneticField_h diff --git a/unitsLib/units-2.1/scalar/MagneticFlux.h b/unitsLib/units-2.1/scalar/MagneticFlux.h deleted file mode 100755 index bfa02db..0000000 --- a/unitsLib/units-2.1/scalar/MagneticFlux.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// $Id: MagneticFlux.h,v 1.1.2.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of magnetic flux -// (magnetic field density applied over an area). The internal -// representation of the units is hidden from the user. -// - -#ifndef Units_MagneticFlux_h -#define Units_MagneticFlux_h - -#include "SpecificUnit.h" -#include "ProductUnitFormat.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(MagneticFlux, 1, 4, -2, -1, 0, 0, 0, 0); - -#define MagneticFluxFormat ProductUnitFormat - - -UNITS_DECLARE_SPECIFIC_UNIT(MagneticFlux, WebersMagneticFlux, "Wb", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(MagneticFlux, MaxwellsMagneticFlux, "Mx", 1e8); - - -} // namespace Units - - -#endif // Units_MagneticFlux_h diff --git a/unitsLib/units-2.1/scalar/MagneticFluxDensity.h b/unitsLib/units-2.1/scalar/MagneticFluxDensity.h deleted file mode 100755 index a543e03..0000000 --- a/unitsLib/units-2.1/scalar/MagneticFluxDensity.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// $Id: MagneticFluxDensity.h,v 1.1.2.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of magnetic flux (force -// per magnetic field). The internal representation of the units is -// hidden from the user. -// - -#ifndef Units_MagneticFluxDensity_h -#define Units_MagneticFluxDensity_h - -#include "SpecificUnit.h" -#include "RatioUnitFormat.h" - - -namespace Units -{ - -UNITS_DECLARE_BASE_UNIT(MagneticFluxDensity, 1, 2, -2, -1, 0, 0, 0, 0); - -#define MagneticFluxDensityFormat RatioUnitFormat - - -UNITS_DECLARE_SPECIFIC_UNIT(MagneticFluxDensity, - TeslaMagneticFluxDensity, "T", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(MagneticFluxDensity, - GaussMagneticFluxDensity, "G", 1e-4); - - -} // namespace Units - - -#endif // Units_MagneticFluxDensity_h diff --git a/unitsLib/units-2.1/scalar/Makefile b/unitsLib/units-2.1/scalar/Makefile deleted file mode 100755 index a650d72..0000000 --- a/unitsLib/units-2.1/scalar/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# -# $Id: Makefile,v 1.7.2.3 2007-10-01 05:44:30 knicewar Exp $ -# -# Copyright Keith Nicewarner. All rights reserved. -# -# Build the scalar units library. -# - -SUBDIRS = test - - -INSTALL_HTML_DIR = scalar -INSTALL_HTML = scalar.html unitList.html \ - Time.html \ - Frequency.html \ - Mass.html \ - MassFlowRate.html \ - Length.html \ - Area.html \ - Volume.html \ - Speed.html \ - Acceleration.html \ - Force.html \ - Power.html \ - Angle.html \ - SignedAngle.html \ - UnsignedAngle.html \ - AngularSpeed.html \ - Temperature.html \ - Pressure.html \ - Density.html - -INSTALL_HEADER_DIR = scalar -INSTALL_HEADERS = Unit.h Unit.i \ - ProductUnitFormat.h ProductUnitFormat.i \ - RatioUnitFormat.h RatioUnitFormat.i \ - SpecificUnit.h SpecificUnit.i \ - Time.h \ - Frequency.h \ - Mass.h \ - MassFlowRate.h \ - Length.h \ - Area.h \ - Volume.h \ - Speed.h \ - Acceleration.h \ - Force.h \ - Inertia.h \ - Angle.h \ - SignedAngle.h SignedAngle.i \ - UnsignedAngle.h UnsignedAngle.i \ - AngularSpeed.h \ - AngularAcceleration.h \ - Torque.h \ - Voltage.h \ - Current.h \ - Power.h \ - MagneticField.h \ - MagneticFluxDensity.h \ - MagneticFlux.h \ - Pressure.h \ - Density.h \ - Temperature.h Temperature.i - - -# -# Must define TARGETS, SOURCE, LIB_OBJS before including this. -# -UNITS_ROOT = .. -include ../make_rules/common.rules diff --git a/unitsLib/units-2.1/scalar/Mass.h b/unitsLib/units-2.1/scalar/Mass.h deleted file mode 100755 index e2e7b2c..0000000 --- a/unitsLib/units-2.1/scalar/Mass.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// $Id: Mass.h,v 1.7.4.2 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of mass. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Mass_h -#define Units_Mass_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Mass, 1, 0, 0, 0, 0, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Mass, GramsMass, "g", 1e-3); -UNITS_DECLARE_SPECIFIC_UNIT(Mass, KilogramsMass, "kg", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Mass, PoundsMass, "lb", 1/2.204622622); -UNITS_DECLARE_SPECIFIC_UNIT(Mass, OuncesMass, "oz", 1/35.27); - - -} // namespace Units - - -#endif // Units_Mass_h diff --git a/unitsLib/units-2.1/scalar/MassFlowRate.h b/unitsLib/units-2.1/scalar/MassFlowRate.h deleted file mode 100755 index ae55f92..0000000 --- a/unitsLib/units-2.1/scalar/MassFlowRate.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// $Id: MassFlowRate.h,v 1.6.4.2 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of mass flow rate. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_MassFlowRate_h -#define Units_MassFlowRate_h - -#include "SpecificUnit.h" -#include "RatioUnitFormat.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(MassFlowRate, 1, 0, -1, 0, 0, 0, 0, 0); - - -#define MassFlowRateFormat RatioUnitFormat - - -// -// 1 kg = 2.204622622 lb -// -UNITS_DECLARE_SPECIFIC_UNIT(MassFlowRate, - PoundsPerHourMassFlowRate, - "lb/hr", 1.0/(2.204622622*3600)); - -UNITS_DECLARE_SPECIFIC_UNIT(MassFlowRate, - KilogramsPerHourMassFlowRate, - "kg/hr", 1.0/3600); - - -} // namespace Units - - -#endif // Units_MassFlowRate_h diff --git a/unitsLib/units-2.1/scalar/Power.h b/unitsLib/units-2.1/scalar/Power.h deleted file mode 100755 index a4bcdaa..0000000 --- a/unitsLib/units-2.1/scalar/Power.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// $Id: Power.h,v 1.7.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of power. Subclasses allow interpretation -// in specified units. The internal representation of the units is hidden -// from the user. -// - -#ifndef Units_Power_h -#define Units_Power_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Power, 1, 2, -3, 0, 0, 0, 0, 0); - - -UNITS_DECLARE_SPECIFIC_UNIT(Power, MilliwattsPower, "mW", 1e-3); -UNITS_DECLARE_SPECIFIC_UNIT(Power, WattsPower, "W", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Power, KilowattsPower, "kW", 1e3); -UNITS_DECLARE_SPECIFIC_UNIT(Power, MegawattsPower, "MW", 1e6); -UNITS_DECLARE_SPECIFIC_UNIT(Power, GigawattsPower, "GW", 1e9); - - -} // namespace Units - - -#endif // Units_Power_h diff --git a/unitsLib/units-2.1/scalar/Pressure.h b/unitsLib/units-2.1/scalar/Pressure.h deleted file mode 100755 index eeccef6..0000000 --- a/unitsLib/units-2.1/scalar/Pressure.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// $Id: Pressure.h,v 1.7.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of pressure. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Pressure_h -#define Units_Pressure_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Pressure, 1, -1, -2, 0, 0, 0, 0, 0); - - -// -// 1 psi = 6894.757 Pa -// 1 atm = 101325 Pa -// 1 inches Hg = 3386.38 Pa -// 1 bar = 0.1 MPa -// 1 Torr = 1 mm Hg -// -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, MillipascalsPressure, "mPa", 1e-3); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, PascalsPressure, "Pa", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, KilopascalsPressure, "kPa", 1e3); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, MegapascalsPressure, "MPa", 1e6); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, AtmospheresPressure, "atm", - 101325.0); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, InchesHgPressure, "inches Hg", - 3386.38); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, PsiPressure, "psi", - 6894.75726951454); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, MillibarPressure, "mbar", 100.0); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, BarPressure, "bar", 1e5); -UNITS_DECLARE_SPECIFIC_UNIT(Pressure, TorrPressure, "Torr", 133.3); - - -} // namespace Units - - -#endif // Units_Pressure_h diff --git a/unitsLib/units-2.1/scalar/ProductUnitFormat.h b/unitsLib/units-2.1/scalar/ProductUnitFormat.h deleted file mode 100755 index 502acac..0000000 --- a/unitsLib/units-2.1/scalar/ProductUnitFormat.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// $Id: ProductUnitFormat.h,v 1.4.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Template class for converting or formating a product of two units of -// measure. -// - -#ifndef Units_ProductUnitFormat_h -#define Units_ProductUnitFormat_h - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#endif - - -namespace Units -{ - -template -class ProductUnitFormat -{ -public: - template - ProductUnitFormat(ProductUnit const & product): - _unit(product/UnitB(1)) - // - // MSVC++ 6.0 won't let me put this in the inline file! - // - { - } - - typename UnitA::ValueType value() const; - -private: - UnitA _unit; -}; - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & operator<< (std::ostream & stream, - ProductUnitFormat const & format); -#endif - - -} // namespace Units - - -#include "ProductUnitFormat.i" - -#endif // Units_ProductUnitFormat_h diff --git a/unitsLib/units-2.1/scalar/ProductUnitFormat.i b/unitsLib/units-2.1/scalar/ProductUnitFormat.i deleted file mode 100755 index da7479e..0000000 --- a/unitsLib/units-2.1/scalar/ProductUnitFormat.i +++ /dev/null @@ -1,45 +0,0 @@ -// -// $Id: ProductUnitFormat.i,v 1.4.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the ProductUnitFormat class. -// - -#ifndef Units_ProductUnitFormat_i -#define Units_ProductUnitFormat_i - - -namespace Units -{ - - -// -// ProductUnitFormat inlines -// - -template -inline -typename UnitA::ValueType ProductUnitFormat::value() const -{ - return _unit.value(); -} - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -inline -std::ostream & operator<< (std::ostream & stream, - ProductUnitFormat const & format) -{ - return stream << format.value() << ' ' - << UnitA::unitsString() << '-' - << UnitB::unitsString(); -} -#endif - - -} // namespace Units - - -#endif // Units_ProductUnitFormat_i diff --git a/unitsLib/units-2.1/scalar/RatioUnitFormat.h b/unitsLib/units-2.1/scalar/RatioUnitFormat.h deleted file mode 100755 index dae4af9..0000000 --- a/unitsLib/units-2.1/scalar/RatioUnitFormat.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// $Id: RatioUnitFormat.h,v 1.4.4.2 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Template class for converting or formating a ratio of two units of -// measure. -// - -#ifndef Units_RatioUnitFormat_h -#define Units_RatioUnitFormat_h - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#endif - - -namespace Units -{ - -template -class RatioUnitFormat -{ -public: - template - RatioUnitFormat(RatioUnit const & ratio): - _unit(ratio*UnitDen(1)) - // - // MSVC++ 6.0 won't let me put this in the inline file! - // - { - } - - typename UnitNum::ValueType value() const; - -private: - UnitNum _unit; -}; - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & operator<< (std::ostream & stream, - RatioUnitFormat const & format); -#endif - - -} // namespace Units - - -#include "RatioUnitFormat.i" - -#endif // Units_RatioUnitFormat_h diff --git a/unitsLib/units-2.1/scalar/RatioUnitFormat.i b/unitsLib/units-2.1/scalar/RatioUnitFormat.i deleted file mode 100755 index 57f0d27..0000000 --- a/unitsLib/units-2.1/scalar/RatioUnitFormat.i +++ /dev/null @@ -1,43 +0,0 @@ -// -// $Id: RatioUnitFormat.i,v 1.3.4.2 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the RatioUnitFormat class. -// - -#ifndef Units_RatioUnitFormat_i -#define Units_RatioUnitFormat_i - - -namespace Units -{ - - -// -// RatioUnitFormat inlines -// - -template -inline -typename UnitNum::ValueType RatioUnitFormat::value() const -{ - return _unit.value(); -} - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -inline -std::ostream & operator<< (std::ostream & stream, - RatioUnitFormat const & format) -{ - return stream << format.value() << ' ' - << UnitNum::unitsString() << '/' << UnitDen::unitsString(); -} -#endif - - -} // namespace Units - - -#endif // Units_RatioUnitFormat_i diff --git a/unitsLib/units-2.1/scalar/SignedAngle.h b/unitsLib/units-2.1/scalar/SignedAngle.h deleted file mode 100755 index 56b79cc..0000000 --- a/unitsLib/units-2.1/scalar/SignedAngle.h +++ /dev/null @@ -1,129 +0,0 @@ -// -// $Id: SignedAngle.h,v 1.10.4.2 2007-10-01 05:44:30 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent a signed circular angle (-180..180 degrees). -// (A circular angle wraps around; a regular Angle does not.) -// - -#ifndef Units_SignedAngle_h -#define Units_SignedAngle_h - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#endif - -#include "Angle.h" - - -namespace Units -{ - - -template -class SignedAngleType: public UNITS_ANGLE_TYPE(ValueType) -{ -public: - // - // Default constructor gives uninitialized value! - // - SignedAngleType(); - - // - // Allow implicit conversion because it's still just an angle. - // - SignedAngleType(UNITS_ANGLE_TYPE(ValueType) const & angle); - - SignedAngleType & operator+= (UNITS_ANGLE_TYPE(ValueType) const & angle); - SignedAngleType & operator-= (UNITS_ANGLE_TYPE(ValueType) const & angle); - - // - // Return the smallest difference between the two angles. - // - SignedAngleType operator- (SignedAngleType const & angle) const; - - // - // Make sure internal value is in range -180..180. - // - SignedAngleType & normalize(); - - - /// - /// Test the proper operation of the public API. WARNING: This is - /// for library testing only and not exported. - /// - static - bool test(); -}; - -// -// Comparison operators (with wrap-around) -// -template -bool similar(SignedAngleType const & a, - SignedAngleType const & b, - UNITS_ANGLE_TYPE(ValueType) const & tol -#ifndef _MSC_VER - = UNITS_ANGLE_TYPE(ValueType)::defaultTolerance() -#endif - ); - -#ifdef _MSC_VER -// -// MSVC++ doesn't appear to handle default args to template functions. -// -template -bool similar(SignedAngleType const & a, - SignedAngleType const & b); -#endif - -typedef SignedAngleType dSignedAngle; -typedef SignedAngleType fSignedAngle; -typedef SignedAngleType SignedAngle; - - -template -class SpecificSignedAngle: - public SignedAngleType -{ -public: - typedef typename SpecificAngleUnits::ValueType ValueType; - - // - // Default constructor gives uninitialized value! - // - SpecificSignedAngle(); - SpecificSignedAngle(UNITS_ANGLE_TYPE(ValueType) const & angle); - - explicit - SpecificSignedAngle(ValueType const value); - - // - // Return this angle in -180..180 degrees. - // - ValueType value() const; -}; - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & -operator<< (std::ostream & stream, - SpecificSignedAngle const & angle); -#endif - -typedef SpecificSignedAngle dSignedDegreesAngle; -typedef SpecificSignedAngle fSignedDegreesAngle; -typedef SpecificSignedAngle SignedDegreesAngle; - -typedef SpecificSignedAngle dSignedRadiansAngle; -typedef SpecificSignedAngle fSignedRadiansAngle; -typedef SpecificSignedAngle SignedRadiansAngle; - - -} // namespace Units - - -#include "SignedAngle.i" - -#endif // Units_SignedAngle_h diff --git a/unitsLib/units-2.1/scalar/SignedAngle.i b/unitsLib/units-2.1/scalar/SignedAngle.i deleted file mode 100755 index c354c14..0000000 --- a/unitsLib/units-2.1/scalar/SignedAngle.i +++ /dev/null @@ -1,167 +0,0 @@ -// -// $Id: SignedAngle.i,v 1.8.4.3 2009-05-14 02:53:55 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the SignedAngle class. -// - -#ifndef Units_SignedAngle_i -#define Units_SignedAngle_i - - -namespace Units -{ - - -template -inline -SignedAngleType::SignedAngleType() -{ -} - -template -inline -SignedAngleType:: -SignedAngleType(UNITS_ANGLE_TYPE(ValueType) const & angle): - UNITS_ANGLE_TYPE(ValueType)(angle) -{ - normalize(); -} - -template -inline -SignedAngleType & -SignedAngleType:: -operator+= (UNITS_ANGLE_TYPE(ValueType) const & angle) -{ - return *this = *this + angle; -} - -template -inline -SignedAngleType & -SignedAngleType:: -operator-= (UNITS_ANGLE_TYPE(ValueType) const & angle) -{ - return *this = *this - angle; -} - - -template -inline -SignedAngleType & SignedAngleType::normalize() -{ - // First make sure delta is between -360..360. - Units::normalize(*this); - - typedef SpecificUnit > - SpecificAngleType; - - // Now wrap to -180..180. - if (*this < SpecificAngleType(-180.0)) - { - UNITS_ANGLE_TYPE(ValueType):: - operator+=(SpecificAngleType(360.0)); - } - else if (*this > SpecificAngleType(180.0)) - { - UNITS_ANGLE_TYPE(ValueType):: - operator-=(SpecificAngleType(360.0)); - } - return *this; -} - - -template -inline -SignedAngleType -SignedAngleType::operator- (SignedAngleType const & angle) const -{ - // Get the mathematical difference. - SignedAngleType delta = UNITS_ANGLE_TYPE(ValueType)::operator-(angle); - - // Wrap to -180..180. - delta.normalize(); - - return delta; -} - - -template -inline -bool similar (SignedAngleType const & a, - SignedAngleType const & b, - UNITS_ANGLE_TYPE(ValueType) const & tol) -{ - return similar(UNITS_ANGLE_TYPE(ValueType)(a - b), - UNITS_ANGLE_TYPE(ValueType)(zero()), - tol); -} - -#if defined (_MSC_VER) && (_MSC_VER < 1300) -template -inline -bool similar (SignedAngleType const & a, - SignedAngleType const & b) -{ - return similar(UNITS_ANGLE_TYPE(ValueType)(a - b), - UNITS_ANGLE_TYPE(ValueType)(zero()), - UNITS_ANGLE_TYPE(ValueType)::defaultTolerance()); -} -#endif - - -// -// Inline functions for SpecificSignedAngle. -// - -template -inline -SpecificSignedAngle::SpecificSignedAngle() -{ -} - -template -inline -SpecificSignedAngle:: -SpecificSignedAngle(UNITS_ANGLE_TYPE(ValueType) const & angle): - SignedAngleType(angle) -{ -} - -template -inline -SpecificSignedAngle:: -SpecificSignedAngle(ValueType const value): - SignedAngleType(SpecificAngleUnits(value)) -{ -} - -template -inline -typename SpecificSignedAngle::ValueType -SpecificSignedAngle::value() const -{ - SpecificSignedAngle temp = *this; - return SpecificAngleUnits(temp.normalize()).value(); -} - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -inline -std::ostream & -operator<<(std::ostream & stream, - SpecificSignedAngle const & angle) -{ - return stream << SpecificAngleUnits(angle); -} -#endif - - -} // namespace Units - - -#endif // Units_SignedAngle_i diff --git a/unitsLib/units-2.1/scalar/SpecificUnit.h b/unitsLib/units-2.1/scalar/SpecificUnit.h deleted file mode 100755 index 1dc7093..0000000 --- a/unitsLib/units-2.1/scalar/SpecificUnit.h +++ /dev/null @@ -1,113 +0,0 @@ -// -// $Id: SpecificUnit.h,v 1.7.2.4 2007-09-28 04:54:01 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// This template allows subclassing for a specific unit of measure. -// - -#ifndef Units_SpecificUnit_h -#define Units_SpecificUnit_h - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#endif - -#include "Unit.h" - - -namespace Units -{ - - -/// -/// This is a bit hokey because neither template parameter are used. -/// But the first parameter allows us to create a unique type for each -/// specific unit, and the second allows us to do a partial -/// specialization which prevents the memory for the traits from being -/// allocated unless it's actually being used somewhere. -/// -template -struct SpecificUnitTraits -{ - static const char * const unitsString; - static const double internalsPerUnit; -}; - -template -class SpecificUnit: public SpecificUnitTraits::BaseUnitType -{ -public: - typedef SpecificUnitTraits Traits; - typedef typename SpecificUnitTraits::BaseUnitType BaseUnitType; - - /// - /// Default constructor gives uninitialized value! - /// - SpecificUnit(); - - explicit - SpecificUnit(ValueType const value); - - SpecificUnit(BaseUnitType const & unit); - - ValueType value() const; - - static - char const * const & unitsString(); -}; - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & operator<< (std::ostream & stream, - SpecificUnit const & units); -#endif - - -// -// Macro to allow declaration of subclasses. -// -// Notes: No comments are allowed in the macro definition. -// No blanks can follow the backslashes (\). -// -#define UNITS_DECLARE_SPECIFIC_UNIT(Base, Name, unitsString_, internalsPerUnit_) \ -struct Name##Traits \ -{ \ -}; \ -\ -template \ -struct SpecificUnitTraits \ -{ \ - typedef typename Base##Traits::BaseUnitType BaseUnitType; \ - static char const * const unitsString; \ - static double const internalsPerUnit; \ -}; \ -\ -template \ -char const * const \ -SpecificUnitTraits::unitsString = unitsString_; \ -\ -template \ -double const \ -SpecificUnitTraits::internalsPerUnit = \ - internalsPerUnit_; \ -\ -typedef SpecificUnit > d##Name; \ -typedef SpecificUnit > f##Name; \ -typedef SpecificUnit > Name - - -} // namespace Units - - -#include "SpecificUnit.i" - -#endif // Units_SpecificUnit_h diff --git a/unitsLib/units-2.1/scalar/SpecificUnit.i b/unitsLib/units-2.1/scalar/SpecificUnit.i deleted file mode 100755 index 5c95406..0000000 --- a/unitsLib/units-2.1/scalar/SpecificUnit.i +++ /dev/null @@ -1,78 +0,0 @@ -// -// $Id: SpecificUnit.i,v 1.6.2.2 2005-12-22 04:31:39 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the SpecificUnit class. -// - -#ifndef Units_SpecificUnit_i -#define Units_SpecificUnit_i - - - -namespace Units -{ - - -template -inline -SpecificUnit::SpecificUnit() -{ -} - -template -inline -SpecificUnit::SpecificUnit(ValueType const value): - BaseUnitType(value*SpecificUnitTraits::internalsPerUnit) -{} - -template -inline -SpecificUnit::SpecificUnit(BaseUnitType const & unit): - BaseUnitType(unit) -{} - - -template -inline -char const * const & SpecificUnit::unitsString() -{ - return SpecificUnitTraits::unitsString; -} - - -template -inline -ValueType SpecificUnit::value() const -{ - return BaseUnitType::_value/SpecificUnitTraits::internalsPerUnit; -} - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & operator<< (std::ostream & stream, - SpecificUnit const & units) -{ - return stream << units.value() << ' ' << units.unitsString(); -} -#endif - - -} // namespace Units - - -#endif // Units_SpecificUnit_i diff --git a/unitsLib/units-2.1/scalar/Speed.h b/unitsLib/units-2.1/scalar/Speed.h deleted file mode 100755 index b41fea9..0000000 --- a/unitsLib/units-2.1/scalar/Speed.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// $Id: Speed.h,v 1.6.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of speed. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Speed_h -#define Units_Speed_h - -#include "SpecificUnit.h" -#include "RatioUnitFormat.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Speed, 0, 1, -1, 0, 0, 0, 0, 0); - - -#define SpeedFormat RatioUnitFormat - - -// -// 1 m/s = 3.280839895 ft/s = 2.236936292 mi/hr -// 1 knot = 1 nmi/hr = 1852 m/h -// -UNITS_DECLARE_SPECIFIC_UNIT(Speed, MetersPerSecondSpeed, "m/s", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Speed, FeetPerSecondSpeed, "fps", 0.3048); -UNITS_DECLARE_SPECIFIC_UNIT(Speed, KilometersPerHourSpeed, "kph", 1/3.6); -// Statute miles per hour -UNITS_DECLARE_SPECIFIC_UNIT(Speed, MilesPerHourSpeed, "mph", 1/2.236936292); -// Nautical miles per hour -UNITS_DECLARE_SPECIFIC_UNIT(Speed, KnotsSpeed, "kts", 1852/3600.0); - - -} // namespace Units - - -#endif // Units_Speed_h diff --git a/unitsLib/units-2.1/scalar/Temperature.h b/unitsLib/units-2.1/scalar/Temperature.h deleted file mode 100755 index 6e2c678..0000000 --- a/unitsLib/units-2.1/scalar/Temperature.h +++ /dev/null @@ -1,180 +0,0 @@ -// -// $Id: Temperature.h,v 1.8.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of temperature. -// The internal representation of the units is hidden from the user. -// -// NOTE: There are two types of temperatures: relative and absolute. -// The generic Temperature class is relative and can be used in -// arbitrary arithmetic and combined with other units of measure -// (i.e., Temperature/Voltage). AbsoluteTemperature has an offset and -// therefore cannot be scaled or combined with other units of measure. -// - -#ifndef Units_Temperature_h -#define Units_Temperature_h - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#endif - -#include "SpecificUnit.h" - - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Temperature, 0, 0, 0, 0, 1, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Temperature, CelsiusTemperature, "C", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Temperature, KelvinTemperature, "K", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Temperature, FahrenheitTemperature, "F", 5.0/9.0); -UNITS_DECLARE_SPECIFIC_UNIT(Temperature, RankineTemperature, "R", 5.0/9.0); - - -/// -/// Represents an absolute temperature. -/// -template -class AbsTemperature_ -{ -public: - typedef AbsTemperature_ BaseUnitType; - - // access the template parameters - typedef ValueType_ ValueType; - - - /// - /// Default constructor gives uninitialized value! - /// - AbsTemperature_(); - - - // Comparison operators - - bool similarTo (AbsTemperature_ const & b, - Temperature const & tol = - Temperature::defaultTolerance()) const; - - bool operator== (AbsTemperature_ const & unit) const; - bool operator!= (AbsTemperature_ const & unit) const; - bool operator< (AbsTemperature_ const & unit) const; - bool operator> (AbsTemperature_ const & unit) const; - bool operator<= (AbsTemperature_ const & unit) const; - bool operator>= (AbsTemperature_ const & unit) const; - - - // Arithmetic operators - - Temperature operator- (AbsTemperature_ const & unit) const; - AbsTemperature_ operator+ (Temperature const & unit) const; - AbsTemperature_ operator- (Temperature const & unit) const; - - AbsTemperature_ & operator+= (Temperature const & unit); - AbsTemperature_ & operator-= (Temperature const & unit); - -protected: - ValueType _value; - - explicit - AbsTemperature_(ValueType const value); -}; - - -template -bool similar (AbsTemperature_ const & a, - AbsTemperature_ const & b, - Temperature const & tol = - Temperature::defaultTolerance()); - - -typedef AbsTemperature_ dAbsTemperature; -typedef AbsTemperature_ fAbsTemperature; -typedef AbsTemperature_ AbsTemperature; - - -template -struct SpecificAbsTemperatureTraits -{ - typedef SpecificTemperature RelativeTemperature; - static const double celsiusOffset; -}; - -template -class SpecificAbsTemperature: public AbsTemperature_ -{ -public: - typedef AbsTemperature_ BaseUnitType; - - /// - /// Default constructor gives uninitialized value! - /// - SpecificAbsTemperature(); - - explicit - SpecificAbsTemperature(ValueType const value); - - SpecificAbsTemperature(BaseUnitType const & temperature); - - static - char const * const & unitsString(); - - ValueType value() const; -}; - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & -operator<< (std::ostream & stream, - SpecificAbsTemperature const & temperature); -#endif - - -// -// Macro to allow declaration of subclasses. -// -// Notes: No comments are allowed in the macro definition. -// No blanks can follow the backslashes (\). -// -#define UNITS_DECLARE_SPECIFIC_TEMPERATURE(TemperatureType, celsiusOffset_) \ -template \ -struct SpecificAbsTemperatureTraits \ -{ \ - typedef TemperatureType RelativeTemperature; \ - static double const celsiusOffset; \ -}; \ -\ -template \ -double const \ -SpecificAbsTemperatureTraits::celsiusOffset = celsiusOffset_; \ -\ -typedef SpecificAbsTemperature > dAbs##TemperatureType; \ -typedef SpecificAbsTemperature > fAbs##TemperatureType; \ -typedef SpecificAbsTemperature > Abs##TemperatureType - - -UNITS_DECLARE_SPECIFIC_TEMPERATURE(CelsiusTemperature, 0); -UNITS_DECLARE_SPECIFIC_TEMPERATURE(KelvinTemperature, -273.15); -UNITS_DECLARE_SPECIFIC_TEMPERATURE(FahrenheitTemperature, -32*5/9.0); -UNITS_DECLARE_SPECIFIC_TEMPERATURE(RankineTemperature, -(459.67 + 32)*5/9.0); - - -} // namespace Units - - -#include "Temperature.i" - -#endif // Units_Temperature_h diff --git a/unitsLib/units-2.1/scalar/Temperature.i b/unitsLib/units-2.1/scalar/Temperature.i deleted file mode 100755 index 3953bca..0000000 --- a/unitsLib/units-2.1/scalar/Temperature.i +++ /dev/null @@ -1,218 +0,0 @@ -// -// $Id: Temperature.i,v 1.4.4.2 2009-05-14 02:53:55 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the Temperature class. -// - -#ifndef Units_Temperature_i -#define Units_Temperature_i - - -namespace Units -{ - - -template -inline -AbsTemperature_::AbsTemperature_() -{ -} - -template -inline -AbsTemperature_::AbsTemperature_(ValueType_ const value): - _value(value) -{ -} - - -// Comparison operators - -template -inline -bool AbsTemperature_:: -similarTo(AbsTemperature_ const & b, - Temperature const & tol) const -{ - return (*this - b).similarTo(Temperature(zero()), - tol); -} - -template -bool similar (AbsTemperature_ const & a, - AbsTemperature_ const & b, - Temperature const & tol) -{ - return a.similarTo(b, tol); -} - -template -inline -bool AbsTemperature_::operator== (AbsTemperature_ const & unit) const -{ - return (_value == unit._value); -} - -template -inline -bool AbsTemperature_::operator!= (AbsTemperature_ const & unit) const -{ - return (_value != unit._value); -} - -template -inline -bool AbsTemperature_::operator< (AbsTemperature_ const & unit) const -{ - return (_value < unit._value); -} - -template -inline -bool AbsTemperature_::operator> (AbsTemperature_ const & unit) const -{ - return (_value > unit._value); -} - -template -inline -bool AbsTemperature_::operator<= (AbsTemperature_ const & unit) const -{ - return (_value <= unit._value); -} - -template -inline -bool AbsTemperature_::operator>= (AbsTemperature_ const & unit) const -{ - return (_value >= unit._value); -} - - - -// Arithmetic operators - -template -inline -AbsTemperature_ AbsTemperature_:: -operator+ (Temperature const & temperature) const -{ - return AbsTemperature_(_value + CelsiusTemperature(temperature).value()); -} - -template -inline -AbsTemperature_ AbsTemperature_:: -operator- (Temperature const & temperature) const -{ - return AbsTemperature_(_value - CelsiusTemperature(temperature).value()); -} - -template -inline -Temperature AbsTemperature_:: -operator- (AbsTemperature_ const & temperature) const -{ - return (CelsiusTemperature(_value) - - CelsiusTemperature(temperature._value)); -} - - -template -inline -AbsTemperature_ & -AbsTemperature_::operator+=(Temperature const & temperature) -{ - // _value += temperature._value; - // return *this; - throw std::runtime_error("Cannot use the + operator with Temperature"); -} - -template -inline -AbsTemperature_ & -AbsTemperature_::operator-=(Temperature const & temperature) -{ - // _value -= temperature._value; - // return *this; - throw std::runtime_error("Cannot use the + operator with Temperature"); -} - - - -template -inline -SpecificAbsTemperature:: -SpecificAbsTemperature() -{ -} - -template -inline -SpecificAbsTemperature:: -SpecificAbsTemperature(ValueType const value): - AbsTemperature_(value*SpecificTemperatureTraits:: - RelativeTemperature::Traits::internalsPerUnit + - SpecificTemperatureTraits::celsiusOffset) -{ -} - -template -inline -SpecificAbsTemperature:: -SpecificAbsTemperature(AbsTemperature_ const & temperature): - AbsTemperature_(temperature) -{ -} - - -template -inline -char const * const & -SpecificAbsTemperature::unitsString() -{ - return SpecificTemperatureTraits::RelativeTemperature::unitsString(); -} - - -template -inline -ValueType SpecificAbsTemperature::value() const -{ - return ((BaseUnitType::_value - - SpecificTemperatureTraits::celsiusOffset)/ - SpecificTemperatureTraits::RelativeTemperature:: - Traits::internalsPerUnit); -} - - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -inline -std::ostream & -operator<< (std::ostream & stream, - SpecificAbsTemperature const & temperature) -{ - return stream << temperature.value() << ' ' << temperature.unitsString(); -} -#endif - - -} // namespace Units - - -#endif // Units_Temperature_i diff --git a/unitsLib/units-2.1/scalar/Time.h b/unitsLib/units-2.1/scalar/Time.h deleted file mode 100755 index c6fcf26..0000000 --- a/unitsLib/units-2.1/scalar/Time.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// $Id: Time.h,v 1.7.4.2 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of time. Subclasses allow interpretation -// in specified units. The internal representation of the units is hidden -// from the user. -// - -#ifndef Units_Time_h -#define Units_Time_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Time, 0, 0, 1, 0, 0, 0, 0, 0); - -UNITS_DECLARE_SPECIFIC_UNIT(Time, MicrosecondsTime, "us", 0.000001); -UNITS_DECLARE_SPECIFIC_UNIT(Time, MillisecondsTime, "ms", 0.001); -UNITS_DECLARE_SPECIFIC_UNIT(Time, SecondsTime, "s", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Time, MinutesTime, "min", 60.0); -UNITS_DECLARE_SPECIFIC_UNIT(Time, HoursTime, "hr", 3600.0); -UNITS_DECLARE_SPECIFIC_UNIT(Time, DaysTime, "days", 24*3600.0); - - -} // namespace Units - - -#endif // Units_Time_h diff --git a/unitsLib/units-2.1/scalar/Torque.h b/unitsLib/units-2.1/scalar/Torque.h deleted file mode 100755 index f26fb86..0000000 --- a/unitsLib/units-2.1/scalar/Torque.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// $Id: Torque.h,v 1.7.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of torque. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Torque_h -#define Units_Torque_h - -#include "SpecificUnit.h" -#include "ProductUnitFormat.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Torque, 1, 2, -2, 0, 0, 0, 0, 0); - -#define TorqueFormat ProductUnitFormat - - -UNITS_DECLARE_SPECIFIC_UNIT(Torque, NewtonMeterTorque, "N-m", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Torque, FootPoundTorque, - "ft-lb", 0.3048*4.4482216); - - -} // namespace Units - - -#endif // Units_Torque_h diff --git a/unitsLib/units-2.1/scalar/Unit.h b/unitsLib/units-2.1/scalar/Unit.h deleted file mode 100755 index ec13800..0000000 --- a/unitsLib/units-2.1/scalar/Unit.h +++ /dev/null @@ -1,428 +0,0 @@ -// -// $Id: Unit.h,v 1.11.2.9 2009-05-14 02:53:55 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of an arbitrary unit of measure. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Unit_h -#define Units_Unit_h - -#include "system/units_config.h" - - - -namespace Units -{ - -// -// Call me lazy, but typing this for each template gets really old ... -// -#define UNITS_UNIT_TEMPLATE_EXP_DECL_ARGS(suffix) int massExp##suffix, \ - int lengthExp##suffix, \ - int timeExp##suffix, \ - int currentExp##suffix, \ - int temperatureExp##suffix, \ - int amountExp##suffix, \ - int intensityExp##suffix, \ - int angleExp##suffix - -#define UNITS_UNIT_TEMPLATE_DECL_ARGS typename ValueType_, \ - UNITS_UNIT_TEMPLATE_EXP_DECL_ARGS(_) - -#define UNITS_UNIT_TEMPLATE_DECL_ARGS2 typename ValueType1, \ - UNITS_UNIT_TEMPLATE_EXP_DECL_ARGS(1), \ - UNITS_UNIT_TEMPLATE_EXP_DECL_ARGS(2) - -#define UNITS_UNIT_TEMPLATE_ARGS ValueType_, \ - massExp_, \ - lengthExp_, \ - timeExp_, \ - currentExp_, \ - temperatureExp_, \ - amountExp_, \ - intensityExp_, \ - angleExp_ - -#define UNITS_UNIT_TEMPLATE_ARGS1 \ - ValueType1, \ - massExp1, \ - lengthExp1, \ - timeExp1, \ - currentExp1, \ - temperatureExp1, \ - amountExp1, \ - intensityExp1, \ - angleExp1 - -#define UNITS_UNIT_TEMPLATE_ARGS2 \ - ValueType1, \ - massExp2, \ - lengthExp2, \ - timeExp2, \ - currentExp2, \ - temperatureExp2, \ - amountExp2, \ - intensityExp2, \ - angleExp2 - -#define UNITS_UNIT_TEMPLATE_ARGS_SQR_RESULT \ - ValueType_, \ - 2*massExp_, \ - 2*lengthExp_, \ - 2*timeExp_, \ - 2*currentExp_, \ - 2*temperatureExp_, \ - 2*amountExp_, \ - 2*intensityExp_, \ - AngleExponent<2*angleExp_, \ - 2*lengthExp_>::value - -#define UNITS_UNIT_TEMPLATE_ARGS_MUL_RESULT \ - ValueType1, \ - massExp1 + massExp2, \ - lengthExp1 + lengthExp2, \ - timeExp1 + timeExp2, \ - currentExp1 + currentExp2, \ - temperatureExp1 + temperatureExp2, \ - amountExp1 + amountExp2, \ - intensityExp1 + intensityExp2, \ - AngleExponent::value - -#define UNITS_UNIT_TEMPLATE_ARGS_DIV_RESULT \ - ValueType1, \ - massExp1 - massExp2, \ - lengthExp1 - lengthExp2, \ - timeExp1 - timeExp2, \ - currentExp1 - currentExp2, \ - temperatureExp1 - temperatureExp2, \ - amountExp1 - amountExp2, \ - intensityExp1 - intensityExp2, \ - AngleExponent::value - -#define UNITS_UNIT_TEMPLATE_ARGS_INV_RESULT \ - ValueType1, \ - -massExp1, \ - -lengthExp1, \ - -timeExp1, \ - -currentExp1, \ - -temperatureExp1, \ - -amountExp1, \ - -intensityExp1, \ - -angleExp1 - -#define UNITS_UNIT_TEMPLATE_ARGS_SQRT_RESULT \ - ValueType1, \ - massExp1/2, \ - lengthExp1/2, \ - timeExp1/2, \ - currentExp1/2, \ - temperatureExp1/2, \ - amountExp1/2, \ - intensityExp1/2, \ - angleExp1/2 - - -/// -/// These types allow us to do handy things like Length x = zero and -/// have it magically to the Right Thing, rather than Length x = -/// Length::zero(). -/// -struct Zero {}; -struct NegInfinity; -struct Infinity -{ - NegInfinity operator- () const; -}; -struct NegInfinity -{ - Infinity operator- () const; -}; - -Zero zero(); -Infinity infinity(); -NegInfinity negInfinity(); - - -/// -/// NOTE: Technically, angular units of measure are Length/Length, so -/// any angle exponents will cancel with any number of length -/// exponents. This awkward template struct is just so we can get the -/// exponents to cancel right. The logic it's implementing at compile -/// time is this: if lengthExp != 0, then angleExp = 0. -/// -template -struct AngleExponentComputer -{ - static int const result = 0; -}; - -template -struct AngleExponentComputer -{ - static int const result = angleExp; -}; - -template -struct AngleExponent -{ - static int const value = AngleExponentComputer::result; -}; - - -/// -/// These help distinguish Unit and non-Unit types. -/// -template -struct UnitlessType -{ - typedef ValueType Result; -}; - -template -class Unit; - -template -struct UnitlessType > -{ - typedef ValueType_ Result; -}; - - - -/// -/// Represents an arbitrary combination of basic units of measure. -/// -template -class Unit -{ -public: - typedef Unit BaseUnitType; - - // access the template parameters - typedef ValueType_ ValueType; - static const int massExp = massExp_; - static const int lengthExp = lengthExp_; - static const int timeExp = timeExp_; - static const int currentExp = currentExp_; - static const int temperatureExp = temperatureExp_; - static const int amountExp = amountExp_; - static const int intensityExp = intensityExp_; - static const int angleExp = angleExp_; - - - /// - /// Default constructor gives uninitialized value! - /// - Unit(); - - /// - /// Construct special values. Note the value of the argument is - /// ignored -- just the type matters. - /// - Unit(Zero const &); - Unit(Infinity const &); - Unit(NegInfinity const &); - - - // Comparison operators - - bool similarTo (Unit const & b, - Unit const & tol = - defaultTolerance()) const; - - bool operator== (Unit const & unit) const; - bool operator!= (Unit const & unit) const; - bool operator< (Unit const & unit) const; - bool operator> (Unit const & unit) const; - bool operator<= (Unit const & unit) const; - bool operator>= (Unit const & unit) const; - - - // Arithmetic operators - - template - friend - Unit - operator* (Unit const & lhs, - Unit const & rhs); - - template - friend - Unit - operator/ (Unit const & lhs, - Unit const & rhs); - - template - friend - Unit - operator/ (ValueType1 const lhs, - Unit const & rhs); - - // - // Note: A divide by zero will result in a value of Infinity - // - - Unit operator* (ValueType const scale) const; - Unit operator/ (ValueType const scale) const; - - Unit & operator*= (ValueType const scale); - Unit & operator/= (ValueType const scale); - - Unit operator- () const; - - Unit operator+ (Unit const & unit) const; - Unit operator- (Unit const & unit) const; - - Unit & operator+= (Unit const & unit); - Unit & operator-= (Unit const & unit); - - - template - friend - Unit - sqrt(Unit const & value); - - template - friend - Unit - abs(Unit const & value); - - - static - Unit const & defaultTolerance(); - - -protected: - ValueType _value; - - static - Unit const _defaultTolerance; - - explicit - Unit(ValueType const value); -}; - - -template -Unit -min(Unit const & a, - Unit const & b); - -template -Unit -max(Unit const & a, - Unit const & b); - - -/// -/// Specialization for unitless types to make them type-compatible with -/// the ValueType. -/// -template -class Unit -{ -public: - /// - /// Default constructor gives uninitialized value! - /// - Unit(); - - /// - /// Allow implicit conversion. - /// - Unit(ValueType const value); - - /// - /// Type cast to values of type ValueType. - /// - operator ValueType() const; - - /// - /// Allow assignments from values of type ValueType. - /// - Unit & operator= (ValueType const value); - - template - friend - Unit - operator* (Unit const & lhs, - Unit const & rhs); - - template - friend - Unit - operator/ (Unit const & lhs, - Unit const & rhs); - - template - friend - Unit - operator/ (ValueType1 const lhs, - Unit const & rhs); - -private: - ValueType _value; -}; - - -template -bool similar (Unit const & a, - Unit const & b, - Unit const & tol = - Unit::defaultTolerance()); - - -template -Unit -operator* (ValueType_ const scale, - Unit const & unit); - - -#define UNITS_DECLARE_BASE_UNIT(Name, \ - massExp, \ - lengthExp, \ - timeExp, \ - currentExp, \ - temperatureExp, \ - amountExp, \ - intensityExp, \ - angleExp) \ -template \ -struct Name##Traits \ -{ \ - typedef Unit BaseUnitType; \ -}; \ - \ -typedef Name##Traits::BaseUnitType d##Name; \ -typedef Name##Traits::BaseUnitType f##Name; \ -typedef Name##Traits::BaseUnitType Name - - - -} // namespace Units - - -#include "Unit.i" - -#endif // Units_Unit_h diff --git a/unitsLib/units-2.1/scalar/Unit.i b/unitsLib/units-2.1/scalar/Unit.i deleted file mode 100755 index ac19e09..0000000 --- a/unitsLib/units-2.1/scalar/Unit.i +++ /dev/null @@ -1,394 +0,0 @@ -// -// $Id: Unit.i,v 1.3.4.6 2009-05-14 02:53:55 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the Unit class. -// - -#ifndef Units_Unit_i -#define Units_Unit_i - -#include - - - -namespace Units -{ - - -inline -Zero zero() -{ - return Zero(); -} -inline -Infinity infinity() -{ - return Infinity(); -} -inline -NegInfinity negInfinity() -{ - return NegInfinity(); -} - -inline -NegInfinity Infinity::operator- () const -{ - return negInfinity(); -} - -inline -Infinity NegInfinity::operator- () const -{ - return infinity(); -} - - -template -Unit const -Unit::_defaultTolerance(1e-6); - - -// Constructors - -template -inline -Unit::Unit() -{ -} - - -template -inline -Unit::Unit(Zero const &): - _value(0) -{ -} - -template -inline -Unit::Unit(Infinity const &): - _value(HUGE_VAL) -{ -} - -template -inline -Unit::Unit(NegInfinity const &): - _value(-HUGE_VAL) -{ -} - - -template -inline -Unit::Unit(ValueType const value): - _value(value) -{ -} - - -// Comparison operators - -template -inline -bool Unit::similarTo(Unit const & b, - Unit const & tol) const -{ - return (abs(*this - b)._value < tol._value); -} - -template -inline -bool similar(Unit const & a, - Unit const & b, - Unit const & tol) -{ - return a.similarTo(b, tol); -} - -#ifdef _MSC_VER -template -inline -bool similar(Unit const & a, - Unit const & b) -{ - return a.similarTo(b, Unit::defaultTolerance()); -} -#endif - - -template -inline -bool Unit::operator==(Unit const & unit) const -{ - return (_value == unit._value); -} - -template -inline -bool Unit::operator!=(Unit const & unit) const -{ - return (_value != unit._value); -} - -template -inline -bool Unit::operator< (Unit const & unit) const -{ - return (_value < unit._value); -} - -template -inline -bool Unit::operator> (Unit const & unit) const -{ - return (_value > unit._value); -} - -template -inline -bool Unit::operator<=(Unit const & unit) const -{ - return (_value <= unit._value); -} - -template -inline -bool Unit::operator>=(Unit const & unit) const -{ - return (_value >= unit._value); -} - - -// Arithmetic operators - -template -inline -Unit -Unit::operator* (ValueType_ const scale) const -{ - return Unit(_value*scale); -} - -template -inline -Unit -operator* (ValueType_ const scale, - Unit const & unit) -{ - return unit*scale; -} - -template -inline -Unit -Unit::operator/ (ValueType_ const scale) const -{ - return Unit(_value/scale); -} - -template -inline -Unit & Unit::operator*=(ValueType_ const scale) -{ - return *this = *this*scale; -} - -template -inline -Unit & Unit::operator/=(ValueType_ const scale) -{ - return *this = *this/scale; -} - - -template -inline -Unit -Unit::operator- () const -{ - return Unit(-_value); -} - -template -inline -Unit -Unit::operator+ (Unit const & unit) const -{ - return Unit(_value + unit._value); -} - -template -inline -Unit -Unit::operator- (Unit const & unit) const -{ - return Unit(_value - unit._value); -} - - -template -inline -Unit & -Unit::operator+= (Unit const & unit) -{ - return *this = *this + unit; -} - -template -inline -Unit & -Unit::operator-= (Unit const & unit) -{ - return *this = *this - unit; -} - - -template -inline -Unit const & -Unit::defaultTolerance() -{ - return _defaultTolerance; -} - - -template -inline -Unit -operator* (Unit const & lhs, - Unit const & rhs) -{ - return Unit(lhs._value * - rhs._value); -} - -template -inline -Unit -operator/ (Unit const & lhs, - Unit const & rhs) -{ - return Unit(lhs._value / - rhs._value); -} - -template -inline -Unit -operator/ (ValueType1 const lhs, - Unit const & rhs) -{ - return Unit(lhs/rhs._value); -} - - -template -ValueType sqrtComputer(ValueType x); - -template <> -inline -double sqrtComputer(double x) -{ - return ::sqrt(x); -} - -template <> -inline -float sqrtComputer(float x) -{ - return ::sqrtf(x); -} - -template -inline -Unit -sqrt(Unit const & value) -{ - return Unit(sqrtComputer(value._value)); -} - - -template -ValueType absComputer(ValueType x); - -template <> -inline -double absComputer(double x) -{ - return ::fabs(x); -} - -template <> -inline -float absComputer(float x) -{ - return ::fabsf(x); -} - -template -inline -Unit -abs(Unit const & value) -{ - return Unit(absComputer(value._value)); -} - - -template -Unit -min(Unit const & a, - Unit const & b) -{ - return ((a < b) ? a : b); -} - -template -Unit -max(Unit const & a, - Unit const & b) -{ - return ((a > b) ? a : b); -} - - -template -inline -Unit::Unit() -{ -} - -template -inline -Unit::Unit(ValueType const value): - _value(value) -{ -} - -template -inline -Unit::operator ValueType() const -{ - return _value; -} - -template -inline -Unit & -Unit::operator= (ValueType const value) -{ - _value = value; - return *this; -} - - -} // namespace Units - - -#endif // Units_Unit_i diff --git a/unitsLib/units-2.1/scalar/UnsignedAngle.h b/unitsLib/units-2.1/scalar/UnsignedAngle.h deleted file mode 100755 index be62039..0000000 --- a/unitsLib/units-2.1/scalar/UnsignedAngle.h +++ /dev/null @@ -1,126 +0,0 @@ -// -// $Id: UnsignedAngle.h,v 1.10.4.2 2007-10-01 05:44:30 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent an unsigned circular angle (0..360 degrees). -// (A circular angle wraps around; a regular Angle does not.) -// - -#ifndef Units_UnsignedAngle_h -#define Units_UnsignedAngle_h - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -#include -#endif - -#include "SignedAngle.h" - - -namespace Units -{ - - -template -class UnsignedAngleType: public UNITS_ANGLE_TYPE(ValueType) -{ -public: - // - // Default constructor gives uninitialized value! - // - UnsignedAngleType(); - - // - // Allow implicit conversion because it's still just an angle. - // - UnsignedAngleType(UNITS_ANGLE_TYPE(ValueType) const & angle); - - UnsignedAngleType & operator+= (UNITS_ANGLE_TYPE(ValueType) const & angle); - UnsignedAngleType & operator-= (UNITS_ANGLE_TYPE(ValueType) const & angle); - - // Return the smallest difference between the two angles. - SignedAngleType operator- (UnsignedAngleType const & angle) const; - - // Make sure internal value is in range 0..360. - UnsignedAngleType & normalize(); - - - /// - /// Test the proper operation of the public API. WARNING: This is - /// for library testing only and not exported. - /// - static - bool test(); -}; - - -// -// Comparison operators (with wrap-around) -// -template -bool similar(UnsignedAngleType const & a, - UnsignedAngleType const & b, - UNITS_ANGLE_TYPE(ValueType) const & tol -#ifndef _MSC_VER - = UNITS_ANGLE_TYPE(ValueType)::defaultTolerance() -#endif - ); - -#ifdef _MSC_VER -// -// MSVC++ doesn't appear to handle default args to template functions. -// -template -bool similar(UnsignedAngleType const & a, - UnsignedAngleType const & b); -#endif - -typedef UnsignedAngleType dUnsignedAngle; -typedef UnsignedAngleType fUnsignedAngle; -typedef UnsignedAngleType UnsignedAngle; - - -template -class SpecificUnsignedAngle: - public UnsignedAngleType -{ -public: - typedef typename SpecificAngleUnits::ValueType ValueType; - - // - // Default constructor gives uninitialized value! - // - SpecificUnsignedAngle(); - SpecificUnsignedAngle(UNITS_ANGLE_TYPE(ValueType) const & angle); - - explicit - SpecificUnsignedAngle(ValueType const value); - - // - // Return this angle in 0..360 degrees. - // - ValueType value() const; -}; - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -std::ostream & -operator<< (std::ostream & stream, - SpecificUnsignedAngle const & angle); -#endif - -typedef SpecificUnsignedAngle dUnsignedDegreesAngle; -typedef SpecificUnsignedAngle fUnsignedDegreesAngle; -typedef SpecificUnsignedAngle UnsignedDegreesAngle; - -typedef SpecificUnsignedAngle dUnsignedRadiansAngle; -typedef SpecificUnsignedAngle fUnsignedRadiansAngle; -typedef SpecificUnsignedAngle UnsignedRadiansAngle; - - -} // namespace Units - - -#include "UnsignedAngle.i" - -#endif // Units_UnsignedAngle_h diff --git a/unitsLib/units-2.1/scalar/UnsignedAngle.i b/unitsLib/units-2.1/scalar/UnsignedAngle.i deleted file mode 100755 index addabb3..0000000 --- a/unitsLib/units-2.1/scalar/UnsignedAngle.i +++ /dev/null @@ -1,161 +0,0 @@ -// -// $Id: UnsignedAngle.i,v 1.8.4.3 2009-05-14 02:53:55 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Inline implementations for the UnsignedAngle class. -// - -#ifndef Units_UnsignedAngle_i -#define Units_UnsignedAngle_i - - -namespace Units -{ - - -template -inline -UnsignedAngleType::UnsignedAngleType() -{ -} - -template -inline -UnsignedAngleType:: -UnsignedAngleType(UNITS_ANGLE_TYPE(ValueType) const & angle): - UNITS_ANGLE_TYPE(ValueType)(angle) -{ - normalize(); -} - -template -inline -UnsignedAngleType & -UnsignedAngleType:: -operator+= (UNITS_ANGLE_TYPE(ValueType) const & angle) -{ - return *this = *this + angle; -} - -template -inline -UnsignedAngleType & -UnsignedAngleType:: -operator-= (UNITS_ANGLE_TYPE(ValueType) const & angle) -{ - return *this = *this - angle; -} - - -template -inline -UnsignedAngleType & UnsignedAngleType::normalize() -{ - // First make sure delta is between -360..360. - Units::normalize(*this); - - typedef SpecificUnit > - SpecificAngleType; - - // Now wrap to 0..360. - if (*this < UNITS_ANGLE_TYPE(ValueType)(zero())) - { - UNITS_ANGLE_TYPE(ValueType)::operator+=(SpecificAngleType(360.0)); - } - return *this; -} - - -template -inline -SignedAngleType -UnsignedAngleType::operator- (UnsignedAngleType const & angle) const -{ - // Get the mathematical difference. - UnsignedAngleType delta = UNITS_ANGLE_TYPE(ValueType)::operator-(angle); - - // Wrap to -180..180. - delta.normalize(); - - return delta; -} - - -template -inline -bool similar (UnsignedAngleType const & a, - UnsignedAngleType const & b, - UNITS_ANGLE_TYPE(ValueType) const & tol) -{ - return similar(UNITS_ANGLE_TYPE(ValueType)(a - b), - UNITS_ANGLE_TYPE(ValueType)(zero()), - tol); -} - -#if defined (_MSC_VER) && (_MSC_VER < 1300) -template -inline -bool similar (UnsignedAngleType const & a, - UnsignedAngleType const & b) -{ - return similar(UNITS_ANGLE_TYPE(ValueType)(a - b), - UNITS_ANGLE_TYPE(ValueType)(zero()), - UNITS_ANGLE_TYPE(ValueType)::defaultTolerance()); -} -#endif - - -// -// Inline functions for SpecificUnsignedAngle. -// - -template -inline -SpecificUnsignedAngle::SpecificUnsignedAngle() -{ -} - -template -inline -SpecificUnsignedAngle:: -SpecificUnsignedAngle(UNITS_ANGLE_TYPE(ValueType) const & angle): - UnsignedAngleType(angle) -{ -} - -template -inline -SpecificUnsignedAngle:: -SpecificUnsignedAngle(ValueType const value): - UnsignedAngleType(SpecificAngleUnits(value)) -{ -} - -template -inline -typename SpecificUnsignedAngle::ValueType -SpecificUnsignedAngle::value() const -{ - SpecificUnsignedAngle temp = *this; - return SpecificAngleUnits(temp.normalize()).value(); -} - -#ifndef UNITS_NO_IOSTREAM_OPERATORS -template -inline -std::ostream & -operator<<(std::ostream & stream, - SpecificUnsignedAngle const & angle) -{ - return stream << SpecificAngleUnits(angle); -} -#endif - - -} // namespace Units - - -#endif // Units_UnsignedAngle_i diff --git a/unitsLib/units-2.1/scalar/Voltage.h b/unitsLib/units-2.1/scalar/Voltage.h deleted file mode 100755 index 86dbce4..0000000 --- a/unitsLib/units-2.1/scalar/Voltage.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// $Id: Voltage.h,v 1.4.4.1 2005-12-16 06:22:31 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of voltage. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Voltage_h -#define Units_Voltage_h - -#include "SpecificUnit.h" - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Voltage, 1, 2, -3, -1, 0, 0, 0, 0); - - -UNITS_DECLARE_SPECIFIC_UNIT(Voltage, MicrovoltsVoltage, "uV", 1e-6); -UNITS_DECLARE_SPECIFIC_UNIT(Voltage, MillivoltsVoltage, "mV", 1e-3); -UNITS_DECLARE_SPECIFIC_UNIT(Voltage, VoltsVoltage, "V", 1.0); -UNITS_DECLARE_SPECIFIC_UNIT(Voltage, KilovoltsVoltage, "kV", 1e3); - - -} // namespace Units - - -#endif // Units_Voltage_h diff --git a/unitsLib/units-2.1/scalar/Volume.h b/unitsLib/units-2.1/scalar/Volume.h deleted file mode 100755 index cc09546..0000000 --- a/unitsLib/units-2.1/scalar/Volume.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// $Id: Volume.h,v 1.6.4.2 2005-12-22 06:15:56 knicewar Exp $ -// -// Copyright Keith Nicewarner. All rights reserved. -// -// Represent the abstract concept of a measure of volume. -// The internal representation of the units is hidden from the user. -// - -#ifndef Units_Volume_h -#define Units_Volume_h - -#include "SpecificUnit.h" -#include "Format.h" -#include "Length.h" - - - -namespace Units -{ - - -UNITS_DECLARE_BASE_UNIT(Volume, 0, 3, 0, 0, 0, 0, 0, 0); - - -template -class VolumeFormat: public Format -{ -public: - VolumeFormat(Volume const & volume): - Format(volume) - { - } -}; - - -#define UNITS_VOLUME_DECLARE_LENGTH_SUBCLASS(LengthName, LengthUnitString) \ -UNITS_DECLARE_SPECIFIC_UNIT(Volume, LengthName##Volume, LengthUnitString"^3", \ - (SpecificUnitTraits::internalsPerUnit* \ - SpecificUnitTraits::internalsPerUnit* \ - SpecificUnitTraits::internalsPerUnit)) - -UNITS_VOLUME_DECLARE_LENGTH_SUBCLASS(Inches, "in"); -UNITS_VOLUME_DECLARE_LENGTH_SUBCLASS(Feet, "ft"); -UNITS_VOLUME_DECLARE_LENGTH_SUBCLASS(Meters, "m"); - -// -// 1 US gal = 231 cubic inches -// 1 BI gal = 277.4 cubic inches -// -UNITS_DECLARE_SPECIFIC_UNIT(Volume, LitersVolume, "L", 1e-3); -// United States Gallon -UNITS_DECLARE_SPECIFIC_UNIT(Volume, USGallonsVolume, "US gal", (231.0/ - 61023.74409)); -// British Imperial Gallon -UNITS_DECLARE_SPECIFIC_UNIT(Volume, BIGallonsVolume, "BI gal", (277.4/ - 61023.74409)); - - -} // namespace Units - - -#endif // Units_Volume_h diff --git a/unitsLib/units-2.1/scalar/makeUnitList b/unitsLib/units-2.1/scalar/makeUnitList deleted file mode 100755 index 9bee1b7..0000000 --- a/unitsLib/units-2.1/scalar/makeUnitList +++ /dev/null @@ -1,66 +0,0 @@ -#! /usr/local/bin/perl - -# -# Scan all header files and generate an HTML file with the list -# of classes and subclasses. -# -$outputFile = "unitList.html"; - - -$command = "fgrep \"class SCALAR_API\" *.h |"; - -open(CLASSES, $command) || - die "`$command' failed: $!\n"; - -while () -{ - if (/(.*)\.h:class SCALAR_API/ && ($1 ne "Unit")) - { - $number{$1} = 0; - } -} - -close(CLASSES); - - -$command = "fgrep DECLARE_SUBCLASS *.h |"; - -open(SUBCLASSES, $command) || - die "`$command' failed: $!\n"; - -while () -{ - if (/(.*)\.h:.*\((.*)\);/) - { - $subclass{$1}[$number{$1}++] = $2; - } -} - -close(SUBCLASSES); - - -open(OUTPUT, "> $outputFile") || - die "Could not open $outputFile\n"; - -print OUTPUT "\n"; -print OUTPUT "List of Currently Supported Scalar Units\n"; -print OUTPUT "\n"; -print OUTPUT "

List of Currently Supported Scalar Units

\n"; - -foreach $class (sort keys(%number)) -{ - print OUTPUT "

$class

\n"; - for ($i = 0; $i < $number{$class}; $i++) - { - print OUTPUT " $subclass{$class}[$i]
\n"; - } - if ($class =~ /(.*)dAngle/) - { - print OUTPUT " $1dDegreesAngle
\n"; - print OUTPUT " $1dRadiansAngle
\n"; - } -} - -print OUTPUT "\n"; - -close(OUTPUT); diff --git a/unitsLib/units-2.1/system/units_config.h b/unitsLib/units-2.1/system/units_config.h deleted file mode 100755 index 8efa13c..0000000 --- a/unitsLib/units-2.1/system/units_config.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// $Id: units_config.h,v 1.1.2.2 2008-06-17 19:55:45 knicewar Exp $ -// -// Copyright SRI. All rights reserved. -// -// This file contains everything needed to make the code compile -// uniformly on all platforms. -// - -#ifndef Units_config_h -#define Units_config_h - -#if defined(_MSC_VER) -# pragma warning(disable:4661) -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) -# pragma warning(disable:4290) -#endif - -#define UNITS_TEMPLATES_REQUIRE_SOURCE - - -#ifndef UNITS_DEFAULT_VALUE_TYPE -#define UNITS_DEFAULT_VALUE_TYPE double -#endif - - -#endif // Units_config_h From 4e3e31fd34121f45650011f3ff6256908de31f9d Mon Sep 17 00:00:00 2001 From: Stuart Bowman Date: Mon, 8 Jun 2026 12:34:26 -0400 Subject: [PATCH 3/7] chore: move header around a bit --- include/loader/FormatDifferentiatorStreamEcho.h | 8 +++++--- include/{utility => loader}/MoreStringFunctions.h | 0 2 files changed, 5 insertions(+), 3 deletions(-) rename include/{utility => loader}/MoreStringFunctions.h (100%) diff --git a/include/loader/FormatDifferentiatorStreamEcho.h b/include/loader/FormatDifferentiatorStreamEcho.h index 011c633..2df853c 100644 --- a/include/loader/FormatDifferentiatorStreamEcho.h +++ b/include/loader/FormatDifferentiatorStreamEcho.h @@ -19,10 +19,12 @@ #pragma once -#include "loader/Token.h" -#include "utility/MoreStringFunctions.h" -#include "loader/HTMLDump.h" #include +#include + +#include "loader/MoreStringFunctions.h" +#include "loader/HTMLDump.h" +#include "loader/Token.h" template diff --git a/include/utility/MoreStringFunctions.h b/include/loader/MoreStringFunctions.h similarity index 100% rename from include/utility/MoreStringFunctions.h rename to include/loader/MoreStringFunctions.h From b50b2e76feddc5b7a86a1aba7129c0e02bc45297 Mon Sep 17 00:00:00 2001 From: Stuart Bowman Date: Mon, 8 Jun 2026 13:22:38 -0400 Subject: [PATCH 4/7] chore: make the loader code not depend on CustomUnits.h --- Loader/DecodedStream.cpp | 60 ------------------------- Loader/Loadable.cpp | 7 --- include/loader/DecodedStream.h | 29 ++++-------- include/loader/Loadable.h | 2 - include/public/Waypoint.h | 1 + unittest/src/Public/windstack_tests.cpp | 1 + 6 files changed, 10 insertions(+), 90 deletions(-) diff --git a/Loader/DecodedStream.cpp b/Loader/DecodedStream.cpp index 6fa4670..cf95d06 100644 --- a/Loader/DecodedStream.cpp +++ b/Loader/DecodedStream.cpp @@ -453,26 +453,6 @@ bool DecodedStream::get_datum(Units::PoundsMass &s) { return true; } -bool DecodedStream::get_datum(Units::KilogramsPerHourMassFlowRate &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::KilogramsPerHourMassFlowRate(d); - return true; -} - -bool DecodedStream::get_datum(Units::PoundsPerHourMassFlowRate &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::PoundsPerHourMassFlowRate(d); - return true; -} - bool DecodedStream::get_datum(Units::FeetArea &s) { double d = 0; bool getDouble = get_datum(d); @@ -492,43 +472,3 @@ bool DecodedStream::get_datum(Units::MetersArea &s) { s = Units::MetersArea(d); return true; } - -bool DecodedStream::get_datum(Units::FeetPerMinuteSpeed &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::FeetPerMinuteSpeed(d); - return true; -} - -bool DecodedStream::get_datum(Units::SecondsPerNauticalMileInvertedSpeed &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::SecondsPerNauticalMileInvertedSpeed(d); - return true; -} - -bool DecodedStream::get_datum(Units::HertzFrequency &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::HertzFrequency(d); - return true; -} - -bool DecodedStream::get_datum(Units::MetersPerSecondSquaredLengthGain &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::MetersPerSecondSquaredLengthGain(d); - return true; -} diff --git a/Loader/Loadable.cpp b/Loader/Loadable.cpp index fbe7825..848bfbc 100644 --- a/Loader/Loadable.cpp +++ b/Loader/Loadable.cpp @@ -205,13 +205,6 @@ bool Loadable::loadSpeedKnots(Units::Speed &speed) { return result; } -bool Loadable::loadAccelerationKnotsPerSecond(Units::Acceleration &acceleration) { - double value; - bool result = stream->get_datum(value); - acceleration = Units::KnotsPerSecondAcceleration(value); - return result; -} - shared_ptr Loadable::getLoaderLink(const string &name) { string varnameclean = clean_token(name); map >::iterator it = lookup_table.find(varnameclean); diff --git a/include/loader/DecodedStream.h b/include/loader/DecodedStream.h index 348402f..ebaf06e 100644 --- a/include/loader/DecodedStream.h +++ b/include/loader/DecodedStream.h @@ -19,22 +19,21 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include - #include +#include "scalar/Acceleration.h" +#include "scalar/Angle.h" +#include "scalar/Area.h" +#include "scalar/Length.h" +#include "scalar/Mass.h" +#include "scalar/MassFlowRate.h" +#include "scalar/Speed.h" +#include "scalar/Time.h" #include "loader/ArchiveStreamEcho.h" #include "loader/CommentStream.h" #include "loader/IncludeStream.h" #include "loader/SinglePushBackStream.h" #include "loader/TokenStream.h" -#include "utility/CustomUnits.h" class DecodedStream : public SinglePushBackStream > > > { public: @@ -88,19 +87,7 @@ class DecodedStream : public SinglePushBackStream #include +#include "utility/CustomUnits.h" #include "loader/LoggingLoadable.h" class Waypoint : public LoggingLoadable { diff --git a/unittest/src/Public/windstack_tests.cpp b/unittest/src/Public/windstack_tests.cpp index 1a5ae10..b17cb3c 100644 --- a/unittest/src/Public/windstack_tests.cpp +++ b/unittest/src/Public/windstack_tests.cpp @@ -26,6 +26,7 @@ #include "loader/DecodedStream.h" #include "public/WindStack.h" +#include "utility/CustomUnits.h" using namespace aaesim::open_source; From 3b1e63b6d3402f00937b70f193193f5f39be1867 Mon Sep 17 00:00:00 2001 From: Stuart Bowman Date: Mon, 8 Jun 2026 15:46:12 -0400 Subject: [PATCH 5/7] refactor: now using mitre::fsloader dependency; removed loader code --- .cmake/aaesim-config.cmake.in | 16 - .cmake/aaesim.cmake | 328 ------------ AircraftDynamicsTestFramework/CMakeLists.txt | 7 +- AircraftDynamicsTestFramework/framework.cmake | 3 +- CMakeLists.txt | 22 +- Loader/.gitignore | 3 - Loader/CMakeLists.txt | 26 - Loader/DecodedStream.cpp | 474 ------------------ Loader/FilePath.cpp | 226 --------- Loader/HTMLDump.cpp | 76 --- Loader/LoadError.cpp | 26 - Loader/Loadable.cpp | 215 -------- Loader/Loader to do.docx | Bin 33590 -> 0 bytes Loader/LoaderLink.cpp | 61 --- Loader/LoaderSupport.cpp | 47 -- Loader/Logging.cpp | 49 -- Loader/LoggingLoadable.cpp | 173 ------- Loader/README | 22 - Loader/RunFileArchiveDirector.cpp | 82 --- Loader/TokenStream.cpp | 196 -------- Public/CMakeLists.txt | 9 +- include/loader/ArchiveStreamEcho.h | 80 --- include/loader/CommentStream.h | 110 ---- include/loader/DecodedStream.h | 93 ---- include/loader/EchoStream.h | 113 ----- include/loader/FilePath.h | 79 --- .../loader/FormatDifferentiatorStreamEcho.h | 110 ---- include/loader/HTMLDump.h | 48 -- include/loader/IncludeStream.h | 273 ---------- include/loader/IndentManagement.h | 58 --- include/loader/ListLoaderLink.h | 85 ---- include/loader/LoadError.h | 37 -- include/loader/Loadable.h | 425 ---------------- include/loader/LoadableLoaderLink.h | 43 -- .../loader/LoadableLoaderLinkWithBrackets.h | 84 ---- include/loader/LoaderLink.h | 84 ---- include/loader/LoaderSupport.h | 31 -- include/loader/Logging.h | 27 - include/loader/LoggingLoadable.h | 55 -- include/loader/MoreStringFunctions.h | 45 -- include/loader/NamedElementLoaderLink.h | 108 ---- include/loader/NativeLoaderLink.h | 44 -- include/loader/NullLoader.h | 30 -- include/loader/RunFileArchiveDirector.h | 82 --- include/loader/SinglePushBackStream.h | 49 -- include/loader/Token.h | 66 --- include/loader/TokenStream.h | 130 ----- .../framework.cmake | 2 - unittest/src/Public/public.cmake | 1 - 49 files changed, 12 insertions(+), 4441 deletions(-) delete mode 100644 .cmake/aaesim-config.cmake.in delete mode 100644 .cmake/aaesim.cmake delete mode 100644 Loader/.gitignore delete mode 100644 Loader/CMakeLists.txt delete mode 100644 Loader/DecodedStream.cpp delete mode 100644 Loader/FilePath.cpp delete mode 100644 Loader/HTMLDump.cpp delete mode 100644 Loader/LoadError.cpp delete mode 100644 Loader/Loadable.cpp delete mode 100644 Loader/Loader to do.docx delete mode 100644 Loader/LoaderLink.cpp delete mode 100644 Loader/LoaderSupport.cpp delete mode 100644 Loader/Logging.cpp delete mode 100644 Loader/LoggingLoadable.cpp delete mode 100644 Loader/README delete mode 100644 Loader/RunFileArchiveDirector.cpp delete mode 100644 Loader/TokenStream.cpp delete mode 100644 include/loader/ArchiveStreamEcho.h delete mode 100644 include/loader/CommentStream.h delete mode 100644 include/loader/DecodedStream.h delete mode 100644 include/loader/EchoStream.h delete mode 100644 include/loader/FilePath.h delete mode 100644 include/loader/FormatDifferentiatorStreamEcho.h delete mode 100644 include/loader/HTMLDump.h delete mode 100644 include/loader/IncludeStream.h delete mode 100644 include/loader/IndentManagement.h delete mode 100644 include/loader/ListLoaderLink.h delete mode 100644 include/loader/LoadError.h delete mode 100644 include/loader/Loadable.h delete mode 100644 include/loader/LoadableLoaderLink.h delete mode 100644 include/loader/LoadableLoaderLinkWithBrackets.h delete mode 100644 include/loader/LoaderLink.h delete mode 100644 include/loader/LoaderSupport.h delete mode 100644 include/loader/Logging.h delete mode 100644 include/loader/LoggingLoadable.h delete mode 100644 include/loader/MoreStringFunctions.h delete mode 100644 include/loader/NamedElementLoaderLink.h delete mode 100644 include/loader/NativeLoaderLink.h delete mode 100644 include/loader/NullLoader.h delete mode 100644 include/loader/RunFileArchiveDirector.h delete mode 100644 include/loader/SinglePushBackStream.h delete mode 100644 include/loader/Token.h delete mode 100644 include/loader/TokenStream.h diff --git a/.cmake/aaesim-config.cmake.in b/.cmake/aaesim-config.cmake.in deleted file mode 100644 index 7aa23ea..0000000 --- a/.cmake/aaesim-config.cmake.in +++ /dev/null @@ -1,16 +0,0 @@ -@PACKAGE_INIT@ - -set(aaesim_INCLUDE_DIRS - "@PROJECT_SOURCE_DIR@/include" - "@PROJECT_SOURCE_DIR@/unitsLib/units-2.1/scalar" -) - -set(aaesim_LIBRARIES - "@PROJECT_SOURCE_DIR@/unitsLib/lib/libunits-2.1.a" - "@PROJECT_SOURCE_DIR@/Loader/lib/libloader.a" - "@PROJECT_SOURCE_DIR@/Utility/lib/libutility.a" - "@PROJECT_SOURCE_DIR@/Core/lib/libcore.a" - "@PROJECT_SOURCE_DIR@/IntervalManagement/lib/libimalgs.a" - "@PROJECT_SOURCE_DIR@/Math/lib/libmath.a" - "@PROJECT_SOURCE_DIR@/PairedApproach/lib/libpaalgs.a" -) diff --git a/.cmake/aaesim.cmake b/.cmake/aaesim.cmake deleted file mode 100644 index 5ec6dd5..0000000 --- a/.cmake/aaesim.cmake +++ /dev/null @@ -1,328 +0,0 @@ -# This file is included by both AAESim and AAESimTest. Therefore, only -# common cmake descriptions should go in this file. -ENABLE_LANGUAGE(CXX) - -# Force libraries to be linked as STATIC -SET(BUILD_SHARED_LIBS false) - -# Create some common paths -SET(LOADER_DIR ./Loader) -SET(UTILITY_DIR ./Utility) -SET(MATH_DIR ./Math/) -SET(CORE_DIR ./Core) -SET(IM_DIR ./IntervalManagement) -SET(GROUND_DIR ./GroundSystems) -SET(PA_DIR ./PairedApproach) -SET(FRAMEWORK_DIR ./AircraftDynamicsTestFramework) -SET(CAASD_WIND_DIR /devel/caasdwind/release/v1.2.1/local/) - -set (CAASD_WIND_LIBS - ${CAASD_WIND_DIR}/lib/libwind.so - ${CAASD_WIND_DIR}/lib/libgrib_api.so - ${CAASD_WIND_DIR}/lib/libopenjpeg.so -) - - -# Add subdirectories that will become libraries -add_subdirectory(${LOADER_DIR}) # this will also build the utility library -# add_subdirectory(${IM_DIR}) -add_subdirectory(${UTILITY_DIR}) - - -LINK_LIBRARIES(${CAASD_WIND_LIBS}) -ADD_DEFINITIONS(-D_LINUX_ -Dunix) - -SET(FRAMEWORK_SRC - ${FRAMEWORK_DIR}/AircraftIntentFromFile.cpp - ${FRAMEWORK_DIR}/AircraftIntentFromFile.h - ${FRAMEWORK_DIR}/IMSpeedCommandFile.cpp - ${FRAMEWORK_DIR}/IMSpeedCommandFile.h - ${FRAMEWORK_DIR}/TestFrameworkAircraft.cpp - ${FRAMEWORK_DIR}/TestFrameworkAircraft.h - ${FRAMEWORK_DIR}/TestFrameworkApplication.cpp - ${FRAMEWORK_DIR}/TestFrameworkApplication.h - ${FRAMEWORK_DIR}/TestFrameworkDynamics.cpp - ${FRAMEWORK_DIR}/TestFrameworkDynamics.h - ${FRAMEWORK_DIR}/TestFrameworkFMS.cpp - ${FRAMEWORK_DIR}/TestFrameworkFMS.h - ${FRAMEWORK_DIR}/TestFrameworkScenario.cpp - ${FRAMEWORK_DIR}/TestFrameworkScenario.h - ${FRAMEWORK_DIR}/TrajectoryFromFile.cpp - ${FRAMEWORK_DIR}/TrajectoryFromFile.h -) - -# Create some SRC containers -SET(MATH_SRC - ${MATH_DIR}CustomMath.cpp - ${MATH_DIR}CustomMath.h - ${MATH_DIR}Statistics.cpp - ${MATH_DIR}Statistics.h - ${MATH_DIR}RandomGenerator.cpp - ${MATH_DIR}RandomGenerator.h -) - -set(CORE_SRC - ${CORE_DIR}/FlightManagementSystem.cpp - ${CORE_DIR}/FlightManagementSystem.h - ${CORE_DIR}/FmsWithNavigationNoise.cpp - ${CORE_DIR}/FmsWithNavigationNoise.h - ${CORE_DIR}/FmsLoader.cpp - ${CORE_DIR}/FmsLoader.h - ${CORE_DIR}/AircraftSensors/ADSBDevice.cpp - ${CORE_DIR}/AircraftSensors/ADSBDevice.h - ${CORE_DIR}/Aircraft.cpp - ${CORE_DIR}/Aircraft.h - ${CORE_DIR}/AircraftIntent.cpp - ${CORE_DIR}/AircraftIntent.h - ${CORE_DIR}/AircraftState.cpp - ${CORE_DIR}/AircraftState.h - ${CORE_DIR}/ADSBEther.h - ${CORE_DIR}/ADSBEther.cpp - ${CORE_DIR}/AircraftCalculations.h - ${CORE_DIR}/AircraftCalculations.cpp - ${CORE_DIR}/AircraftSensors/ADSBReceiver.h - ${CORE_DIR}/AircraftSensors/ADSBReceiver.cpp - ${CORE_DIR}/AircraftSensors/ADSBSVReport.h - ${CORE_DIR}/AircraftSensors/ADSBSVReport.cpp - ${CORE_DIR}/AircraftSensors/ADSBTransmitter.h - ${CORE_DIR}/AircraftSensors/ADSBTransmitter.cpp - ${CORE_DIR}/ASSAPExtrapolate1Hz.h - ${CORE_DIR}/ASSAPExtrapolate1Hz.cpp - ${CORE_DIR}/ASSAP.h - ${CORE_DIR}/ASSAP.cpp - ${CORE_DIR}/ASSAPImpl.h - ${CORE_DIR}/ASSAPImpl.cpp - ${CORE_DIR}/ASSAPLegacy.h - ${CORE_DIR}/ASSAPLegacy.cpp - ${CORE_DIR}/ASSAPNone.h - ${CORE_DIR}/ASSAPNone.cpp - ${CORE_DIR}/Atmosphere.h - ${CORE_DIR}/Atmosphere.cpp - ${CORE_DIR}/Bada.cpp - ${CORE_DIR}/Bada.h - ${CORE_DIR}/BadaWithCalc.cpp - ${CORE_DIR}/BadaWithCalc.h - ${CORE_DIR}/CalcWindGradControl.cpp - ${CORE_DIR}/CalcWindGradControl.h - $(CORE_DIR)/ClimbPrecalcConstraint.cpp - $(CORE_DIR)/ClimbPrecalcConstraint.h - ${CORE_DIR}/constants.cpp - ${CORE_DIR}/constants.h - ${CORE_DIR}/ClosestPointMetric.h - ${CORE_DIR}/ClosestPointMetric.cpp - ${CORE_DIR}/CrossTrackObserver.h - ${CORE_DIR}/CrossTrackObserver.cpp - ${CORE_DIR}/DMatrix.cpp - ${CORE_DIR}/DMatrix.h - ${CORE_DIR}/DVector.cpp - ${CORE_DIR}/DVector.h - ${CORE_DIR}/DelayBuffer.h - ${CORE_DIR}/DelayBuffer.cpp - ${CORE_DIR}/DistanceObserver.h - ${CORE_DIR}/DistanceObserver.cpp - ${CORE_DIR}/DiveDescent4DPredictor.h - ${CORE_DIR}/DiveDescent4DPredictor.cpp - ${CORE_DIR}/DriveDescent4DPredictor.h - ${CORE_DIR}/DriveDescent4DPredictor.cpp - ${CORE_DIR}/DynamicsObserver.h - ${CORE_DIR}/DynamicsObserver.cpp - ${CORE_DIR}/EarthModel.cpp - ${CORE_DIR}/EarthModel.h - ${CORE_DIR}/EllipsoidalEarthModel.h - ${CORE_DIR}/EllipsoidalEarthModel.cpp - ${CORE_DIR}/Environment.h - ${CORE_DIR}/Environment.cpp - ${CORE_DIR}/GeometricDescent4DPredictor.h - ${CORE_DIR}/GeometricDescent4DPredictor.cpp - ${CORE_DIR}/Guidance.cpp - ${CORE_DIR}/Guidance.h - ${CORE_DIR}/HorizontalPath.cpp - ${CORE_DIR}/HorizontalPath.h - ${CORE_DIR}/HorizontalPathObserver.cpp - ${CORE_DIR}/HorizontalPathObserver.h - ${CORE_DIR}/HorizontalTurnPath.cpp - ${CORE_DIR}/HorizontalTurnPath.h - ${CORE_DIR}/IMCommandObserver.h - ${CORE_DIR}/IMCommandObserver.cpp - ${CORE_DIR}/IMUtils.cpp - ${CORE_DIR}/IMUtils.h - ${CORE_DIR}/InternalObserver.cpp - ${CORE_DIR}/InternalObserver.h - ${CORE_DIR}/InvalidIndexException.cpp - ${CORE_DIR}/InvalidIndexException.h - ${CORE_DIR}/KineticDescent4DPredictor.cpp - ${CORE_DIR}/KineticDescent4DPredictor.h - ${CORE_DIR}/KineticTrajectoryPredictor.cpp - ${CORE_DIR}/KineticTrajectoryPredictor.h - ${CORE_DIR}/LocalTangentPlane.cpp - ${CORE_DIR}/LocalTangentPlane.h - ${CORE_DIR}/Logging.cpp - ${CORE_DIR}/Logging.h - ${CORE_DIR}/LoggingLoadable.cpp - ${CORE_DIR}/LoggingLoadable.h - ${CORE_DIR}/micros.h - ${CORE_DIR}/MaintainMetric.cpp - ${CORE_DIR}/MaintainMetric.h - ${CORE_DIR}/MergePointMetric.cpp - ${CORE_DIR}/MergePointMetric.h - ${CORE_DIR}/NAC.cpp - ${CORE_DIR}/NAC.h - ${CORE_DIR}/NIC.h - ${CORE_DIR}/NIC.cpp - ${CORE_DIR}/NavigationSensor.cpp - ${CORE_DIR}/NavigationSensor.h - ${CORE_DIR}/NMObserver.cpp - ${CORE_DIR}/NMObserverEntry.cpp - ${CORE_DIR}/NMObserver.h - ${CORE_DIR}/NMObserverEntry.h - ${CORE_DIR}/PilotDelay.cpp - ${CORE_DIR}/PilotDelay.h - ${CORE_DIR}/PrecalcConstraint.cpp - ${CORE_DIR}/PrecalcConstraint.h - ${CORE_DIR}/PrecalcWaypoint.cpp - ${CORE_DIR}/PrecalcWaypoint.h - ${CORE_DIR}/PredictedWindEvaluator.h - ${CORE_DIR}/RunFile.cpp - ${CORE_DIR}/RunFile.h - ${CORE_DIR}/Scenario.cpp - ${CORE_DIR}/Scenario.h - ${CORE_DIR}/ExternalSensors.cpp - ${CORE_DIR}/ExternalSensors.h - ${CORE_DIR}/SimpleAircraft.cpp - ${CORE_DIR}/SimpleAircraft.h - ${CORE_DIR}/SimulationTime.cpp - ${CORE_DIR}/SimulationTime.h - ${CORE_DIR}/SpeedProfile.cpp - ${CORE_DIR}/SpeedProfile.h - ${CORE_DIR}/State.cpp - ${CORE_DIR}/State.h - ${CORE_DIR}/SSRTracker.cpp - ${CORE_DIR}/SSRTracker.h - ${CORE_DIR}/SSRTracks.cpp - ${CORE_DIR}/SSRTracks.h - ${CORE_DIR}/StereographicProjection.cpp - ${CORE_DIR}/FirstOrderGaussMarkovProcess.cpp - ${CORE_DIR}/StereographicProjection.h - ${CORE_DIR}/FirstOrderGaussMarkovProcess.h - ${CORE_DIR}/AchieveObserver.cpp - ${CORE_DIR}/AchieveObserver.h - ${CORE_DIR}/TangentPlaneSequence.cpp - ${CORE_DIR}/TangentPlaneSequence.h - ${CORE_DIR}/ThreeDOFDynamics.cpp - ${CORE_DIR}/ThreeDOFDynamics.h - ${CORE_DIR}/Track.cpp - ${CORE_DIR}/Track.h - ${CORE_DIR}/TrajectoryPredictor.cpp - ${CORE_DIR}/TrajectoryPredictor.h - ${CORE_DIR}/TrueDistances.cpp - ${CORE_DIR}/TrueDistances.h - ${CORE_DIR}/TSE.cpp - ${CORE_DIR}/TSE.h - ${CORE_DIR}/TSENoise.cpp - ${CORE_DIR}/TSENoise.h - ${CORE_DIR}/UVector.h - ${CORE_DIR}/VectorDifferenceWindEvaluator.cpp - ${CORE_DIR}/VectorDifferenceWindEvaluator.h - ${CORE_DIR}/VerticalPath.h - ${CORE_DIR}/VerticalPath.cpp - ${CORE_DIR}/VerticalPathObserver.cpp - ${CORE_DIR}/VerticalPathObserver.h - ${CORE_DIR}/VerticalPredictor.cpp - ${CORE_DIR}/VerticalPredictor.h - ${CORE_DIR}/Waypoint.cpp - ${CORE_DIR}/Waypoint.h - ${CORE_DIR}/WeatherPrediction.cpp - ${CORE_DIR}/WeatherPrediction.h - $(CORE_DIR)/Wgs84Climb4DPredictor.cpp - $(CORE_DIR)/Wgs84Climb4DPredictor.h - ${CORE_DIR}/Wgs84DiveDescent4DPredictor.h - ${CORE_DIR}/Wgs84DiveDescent4DPredictor.cpp - ${CORE_DIR}/Wgs84DriveDescent4DPredictor.h - ${CORE_DIR}/Wgs84DriveDescent4DPredictor.cpp - ${CORE_DIR}/Wgs84GeometricDescent4DPredictor.h - ${CORE_DIR}/Wgs84GeometricDescent4DPredictor.cpp - ${CORE_DIR}/Wgs84HorizontalPath.cpp - ${CORE_DIR}/Wgs84HorizontalPath.h - ${CORE_DIR}/Wgs84HorizontalPathTracker.cpp - ${CORE_DIR}/Wgs84HorizontalPathTracker.h - ${CORE_DIR}/Wgs84DirectionOfFlightCourseCalculator.cpp - ${CORE_DIR}/Wgs84DirectionOfFlightCourseCalculator.h - ${CORE_DIR}/Wgs84HorizontalTurnPath.cpp - ${CORE_DIR}/Wgs84HorizontalTurnPath.h - ${CORE_DIR}/Wgs84KineticDescent4DPredictor.cpp - ${CORE_DIR}/Wgs84KineticDescent4DPredictor.h - ${CORE_DIR}/Wgs84KineticTrajectoryPredictor.cpp - ${CORE_DIR}/Wgs84KineticTrajectoryPredictor.h - ${CORE_DIR}/Wgs84PrecalcWaypoint.cpp - ${CORE_DIR}/Wgs84PrecalcWaypoint.h - ${CORE_DIR}/Wind.h - ${CORE_DIR}/Wind.cpp - ${CORE_DIR}/WindAltitudes.h - ${CORE_DIR}/WindAltitudes.cpp - ${CORE_DIR}/WindCaasd.h - ${CORE_DIR}/WindCaasd.cpp - ${CORE_DIR}/WindLegacy.h - ${CORE_DIR}/WindLegacy.cpp - ${CORE_DIR}/WindStack.h - ${CORE_DIR}/WindStack.cpp - ${CORE_DIR}/WindZero.h - ${CORE_DIR}/WindZero.cpp - ${CORE_DIR}/ControlCommands.cpp - ${CORE_DIR}/ControlCommands.h - ${CORE_DIR}/AircraftControl.cpp - ${CORE_DIR}/AircraftControl.h - ${CORE_DIR}/SpeedOnThrustControl.cpp - ${CORE_DIR}/SpeedOnThrustControl.h - ${CORE_DIR}/EquationsOfMotionStateDeriv.h - ${CORE_DIR}/EquationsOfMotionState.h - ${CORE_DIR}/SpeedOnPitchControl.cpp - ${CORE_DIR}/SpeedOnPitchControl.h - ${CORE_DIR}/SingleTangentPlaneSequence.cpp - ${CORE_DIR}/SingleTangentPlaneSequence.h - ${CORE_DIR}/version.h - ${CORE_DIR}/cppmanifest.h - ${CORE_DIR}/build_info.h - ) - -SET(IM_BUILD_SRC - ${IM_DIR}/IMAircraft.cpp - ${IM_DIR}/IMAircraft.h - ${IM_DIR}/IMAlgorithmLoader.cpp - ${IM_DIR}/IMAlgorithmLoader.h - ${IM_DIR}/IMAlgorithmFile.h - ${IM_DIR}/IMClearanceLoader.cpp - ${IM_DIR}/IMClearanceLoader.h - ${IM_DIR}/IMScenario.cpp - ${IM_DIR}/IMScenario.h - ${IM_DIR}/MOPSPredictedWindEvaluator.cpp - ${IM_DIR}/MOPSPredictedWindEvaluator.h - ${IM_DIR}/PredictionFile.cpp - ${IM_DIR}/PredictionFile.h - ${IM_DIR}/TrajectoryFile.cpp - ${IM_DIR}/TrajectoryFile.h - ${IM_DIR}/IMKinematicDistBasedMaintain.cpp - ${IM_DIR}/IMKinematicDistBasedMaintain.h - ${IM_DIR}/WaypointFile.cpp - ${IM_DIR}/WaypointFile.h - ) - -SET(GROUND_SRC - ${GROUND_DIR}/TISBTransmitter.cpp - ${GROUND_DIR}/TISBTransmitter.h - ) - -set(SOURCE_FILES ${MATH_SRC} ${PA_SRC} ${CORE_SRC} ${GROUND_SRC} ) - -# include folders -INCLUDE_DIRECTORIES( - ${CORE_DIR}/ - ${CORE_DIR}/AircraftSensors/ - ${MATH_DIR} - ${LOADER_DIR}/ - ${UTILITY_DIR}/ - ${IM_DIR}/ - ${GROUND_DIR}/ - ${PA_DIR}/ - ${FRAMEWORK_DIR}/ - ${CAASD_WIND_DIR}/include/ -) diff --git a/AircraftDynamicsTestFramework/CMakeLists.txt b/AircraftDynamicsTestFramework/CMakeLists.txt index e0b5ed2..d844172 100644 --- a/AircraftDynamicsTestFramework/CMakeLists.txt +++ b/AircraftDynamicsTestFramework/CMakeLists.txt @@ -47,14 +47,13 @@ include(sample_algorithm_library.cmake OPTIONAL) add_library(framework STATIC ${SOURCE_FILES} ${DATA_READER_FILES} ${DATA_LOADER_FILES} ${DATA_WRITER_FILES}) target_include_directories(framework PUBLIC ${aaesim_INCLUDE_DIRS} - ${geolib_idealab_INCLUDE_DIRS} - ${LOG4CPLUS_DIRS}) + ${geolib_idealab_INCLUDE_DIRS}) target_link_libraries(framework PUBLIC - mitre::cppuom + mitre::fsloader ${BADA_LIBRARY} ${SAMPLE_ALGORITHM_LIBRARY} - log4cplusS + log4cplus::log4cplus pub) if (DEFINED BADA_LIBRARY) # Add a compile definition to the build diff --git a/AircraftDynamicsTestFramework/framework.cmake b/AircraftDynamicsTestFramework/framework.cmake index d7644a1..d93fda2 100644 --- a/AircraftDynamicsTestFramework/framework.cmake +++ b/AircraftDynamicsTestFramework/framework.cmake @@ -27,7 +27,6 @@ if(NOT ${BUILD_LIBARIES_ONLY}) $ $ $ - ${LOG4CPLUS_DIRS} ) set_target_properties(FMACM PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin @@ -35,4 +34,4 @@ if(NOT ${BUILD_LIBARIES_ONLY}) else() # Ensure framework library is a build target even though nothing depends on it set_target_properties(framework PROPERTIES EXCLUDE_FROM_ALL FALSE) -endif() \ No newline at end of file +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 99ece1c..cdc83d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,33 +55,19 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unused-function - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-unused-function -Wno-sign-compare -O3 -g3") CPMAddPackage( - NAME log4cplus - GITHUB_REPOSITORY log4cplus/log4cplus - GIT_TAG REL_2_1_2 + NAME fsloader + GIT_REPOSITORY https://github.com/mitre/fsloader.git + GIT_TAG 1.0rc1 OPTIONS + "FSLOADER_BUILD_EXAMPLE OFF" "BUILD_SHARED_LIBS FALSE" - "LOG4CPLUS_BUILD_TESTING FALSE" - "LOG4CPLUS_BUILD_LOGGINGSERVER FALSE" ) -if (log4cplus_ADDED) - set (LOG4CPLUS_DIRS - ${log4cplus_BINARY_DIR}/include - ${log4cplus_SOURCE_DIR}/include) -endif () -CPMAddPackage( - NAME cppuom - GIT_REPOSITORY https://github.com/mitre/cppuom.git - GIT_TAG 2.2 -) - -set (LOADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Loader) set (PUBLIC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Public) set (FRAMEWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/AircraftDynamicsTestFramework) set (aaesim_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ) set (UNITTEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/unittest) -add_subdirectory(${LOADER_DIR}) add_subdirectory(${PUBLIC_DIR}) include(${UNITTEST_DIR}/unittest.cmake OPTIONAL) diff --git a/Loader/.gitignore b/Loader/.gitignore deleted file mode 100644 index 3cce9f9..0000000 --- a/Loader/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.cbp -*.so -*.o diff --git a/Loader/CMakeLists.txt b/Loader/CMakeLists.txt deleted file mode 100644 index 57a7f0f..0000000 --- a/Loader/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.14) - - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - -set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) - -add_library(loader STATIC - DecodedStream.cpp - FilePath.cpp - LoadError.cpp - Loadable.cpp - LoaderLink.cpp - LoaderSupport.cpp - Logging.cpp - LoggingLoadable.cpp - RunFileArchiveDirector.cpp - TokenStream.cpp) -target_link_libraries(loader - PUBLIC - log4cplusS - mitre::cppuom) -target_include_directories(loader PUBLIC - ${aaesim_INCLUDE_DIRS} - ${LOG4CPLUS_DIRS} -) diff --git a/Loader/DecodedStream.cpp b/Loader/DecodedStream.cpp deleted file mode 100644 index cf95d06..0000000 --- a/Loader/DecodedStream.cpp +++ /dev/null @@ -1,474 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/DecodedStream.h" - -#include -#include -#include - -using namespace std; - -DecodedStream::DecodedStream(void) {} - -//---------------------------------------------------------------------------------- - -DecodedStream::~DecodedStream(void) {} - -//---------------------------------------------------------------------------------- - -bool find_num(const string &temp, int j) { - if (!(('0' <= temp[0] && temp[0] <= '9') || temp[0] == '-')) { - return false; - } - for (int i = 1; i <= int(temp.length() - 1); i++) { - if (j == 0) { - if (!(('0' <= temp[i] && temp[i] <= '9'))) { - return false; - } - } - if (j == 1) { - if (!(('0' <= temp[i] && temp[i] <= '9') || temp[i] == '.')) { - return false; - } - } - } - return true; -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(string &s) { - s = get_next().get_Data(); - - if (!DecodedStream::ok()) // if not ok return false - { - return false; - } - - return !s.empty(); -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(short &s) { - // WinDef fefines these macros which prevents us from these thinges elswhere which causes problems - // ADM jan 24 2011 -#undef max -#undef min - - string temp = get_next().get_Data(); - static const short big = numeric_limits::max(); - static const short small = numeric_limits::min(); - - if (temp.empty() || !DecodedStream::ok()) // if temp is empty or stream not ok - { - return false; - } - - if (!find_num(temp, 0)) { - return false; - } - - if (atoi(temp.c_str()) == big) // too big to be short - { - return false; - } - if (atoi(temp.c_str()) == small) // too small to be short - { - return false; - } - if (temp != "0") { - if (atoi(temp.c_str()) == 0) { - return false; - } - } - s = atoi(temp.c_str()); - - return true; -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(unsigned short &s) { - // WinDef fefines these macros which prevents us from these thinges elswhere which causes problems - // ADM jan 24 2011 -#undef max -#undef min - - string temp = get_next().get_Data(); - static const unsigned short big = numeric_limits::max(); - static const unsigned short small = numeric_limits::min(); - - if (temp.empty() || !DecodedStream::ok()) // if temp is empty or stream not ok - { - return false; - } - - if (!find_num(temp, 0)) { - return false; - } - - if (atoi(temp.c_str()) == big) // too big to be unsigned short - { - return false; - } - if (atoi(temp.c_str()) == small) // too small to be unsigned short - { - return false; - } - if (temp != "0") { - if (atoi(temp.c_str()) == 0) { - return false; - } - } - s = atoi(temp.c_str()); - - return true; -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(int &s) { - // WinDef fefines these macros which prevents us from these thinges elswhere which causes problems - // ADM jan 24 2011 -#undef max -#undef min - - string temp = get_next().get_Data(); - static const int big = numeric_limits::max(); - static const int small = numeric_limits::min(); - - if (temp.empty() || !DecodedStream::ok()) // if temp is empty or stream not ok - { - return false; - } - - if (!find_num(temp, 0)) { - return false; - } - - if (atoi(temp.c_str()) == big) // too big to be int - { - return false; - } - if (atoi(temp.c_str()) == small) // too small to be int - { - return false; - } - if (temp != "0") { - if (atoi(temp.c_str()) == 0) { - return false; - } - } - s = atoi(temp.c_str()); - - return true; -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(unsigned int &s) { - // WinDef fefines these macros which prevents us from these thinges elswhere which causes problems - // ADM jan 24 2011 -#undef max -#undef min - - string temp = get_next().get_Data(); - static const unsigned int big = numeric_limits::max(); - static const unsigned int small = numeric_limits::min(); - - if (temp.empty() || !DecodedStream::ok()) // if temp is empty or stream not ok - { - return false; - } - - if (!find_num(temp, 0)) { - return false; - } - - if (atoi(temp.c_str()) == big) // too big to be unsigned int - { - return false; - } - if (atoi(temp.c_str()) == small) // too small to be unsigned int - { - return false; - } - if (temp != "0") { - if (atoi(temp.c_str()) == 0) { - return false; - } - } - s = atoi(temp.c_str()); - - return true; -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(double &s) { - string temp = get_next().get_Data(); - - // wont be necessary- double goes out to 308 digits precision - // double big = numeric_limits::max(); - // double small = numeric_limits::min(); - - if (temp.empty() || !DecodedStream::ok()) // if temp is empty or stream not ok - { - return false; - } - - if (!find_num(temp, 1)) { - return false; - } - - if (temp != "0" && temp != "0.0" && temp != "-0" && temp != "-0.0") { - if (atof(temp.c_str()) == 0) { - return false; - } - } - s = atof(temp.c_str()); - return true; -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(bool &s) { - string temp = get_next().get_Data(); - vector testbool; - testbool.push_back("yes"); - testbool.push_back("no"); - testbool.push_back("true"); - testbool.push_back("false"); - testbool.push_back("0"); - testbool.push_back("1"); - - if (temp.empty() || !DecodedStream::ok()) // if temp is empty or stream not ok - { - return false; - } - - for (int i = 0; i <= int(testbool.size() - 1); i++) { - if (testbool[i] == temp) { - if (temp == "true" || temp == "yes" || temp == "1") { - s = true; - } - if (temp == "false" || temp == "no" || temp == "0") { - s = false; - } - break; - } - if (i == testbool.size() - 1) { - return false; - } - } - return true; -} - -//---------------------------------------------------------------------------------- - -bool DecodedStream::get_datum(long &s) { - string temp = get_next().get_Data(); - - if (temp.empty() || !DecodedStream::ok()) { - return false; - } - - if (!find_num(temp, 0)) { - return false; - } - - try { - size_t idx = 0; - long value = std::stol(temp, &idx, 10); - if (idx != temp.size()) { - // Not all characters were consumed, so not a valid number - return false; - } - s = value; - return true; - } catch (const std::invalid_argument &) { - return false; - } catch (const std::out_of_range &) { - return false; - } -} - -bool DecodedStream::get_datum(float &s) { - string temp = get_next().get_Data(); - static const float big = numeric_limits::max(); - static const float small = numeric_limits::min(); - - if (temp.empty() || !DecodedStream::ok()) // if temp is empty or stream not ok - { - return false; - } - - if (!find_num(temp, 0)) { - return false; - } - - if (atoi(temp.c_str()) == big) // too big to be int - { - return false; - } - if (atoi(temp.c_str()) == small) // too small to be int - { - return false; - } - if (temp != "0") { - if (atoi(temp.c_str()) == 0) { - return false; - } - } - s = atoi(temp.c_str()); - - return true; -} - -bool DecodedStream::get_datum(Units::MetersLength &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::MetersLength(d); - return true; -} - -bool DecodedStream::get_datum(Units::NauticalMilesLength &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::NauticalMilesLength(d); - return true; -} - -bool DecodedStream::get_datum(Units::FeetLength &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::FeetLength(d); - return true; -} - -bool DecodedStream::get_datum(Units::KilometersLength &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::KilometersLength(d); - return true; -} - -bool DecodedStream::get_datum(Units::MetersPerSecondSpeed &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::MetersPerSecondSpeed(d); - return true; -} - -bool DecodedStream::get_datum(Units::KnotsSpeed &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::KnotsSpeed(d); - return true; -} - -bool DecodedStream::get_datum(Units::SecondsTime &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::SecondsTime(d); - return true; -} - -bool DecodedStream::get_datum(Units::DegreesAngle &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::DegreesAngle(d); - return true; -} - -bool DecodedStream::get_datum(Units::RadiansAngle &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::RadiansAngle(d); - return true; -} - -bool DecodedStream::get_datum(Units::KilogramsMass &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::KilogramsMass(d); - return true; -} - -bool DecodedStream::get_datum(Units::PoundsMass &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::PoundsMass(d); - return true; -} - -bool DecodedStream::get_datum(Units::FeetArea &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::FeetArea(d); - return true; -} - -bool DecodedStream::get_datum(Units::MetersArea &s) { - double d = 0; - bool getDouble = get_datum(d); - if (!getDouble) { - return false; - } - s = Units::MetersArea(d); - return true; -} diff --git a/Loader/FilePath.cpp b/Loader/FilePath.cpp deleted file mode 100644 index c415e2a..0000000 --- a/Loader/FilePath.cpp +++ /dev/null @@ -1,226 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/FilePath.h" - -#include -#include - -using namespace std; - -FilePath::FilePath() {} - -FilePath::~FilePath() {} - -FilePath::FilePath(const string &name) { - m_error = false; - int end; - int index; - - if (name.length() == 0) { - m_error = true; - } - - m_full_path = name; - - ExtractPop(name); - end = ExtractType(name); - index = ExtractDisk(name); - - ExtractPath(name, index, end); - - m_number_of_wildcards = GetNumberOfWildCards(name); - - if (m_list_of_directories.size() == 0) { - m_file_name = ""; - } else { - m_file_name = m_list_of_directories.at(m_list_of_directories.size() - 1); - } - - size_t find_space; - find_space = name.find_last_of(" "); - if (find_space != string::npos) { - if (find_space == name.length() - 1) { - m_error = true; - } - } -} - -bool FilePath::operator==(const FilePath &rhs) const { - if (m_full_path == rhs.m_full_path) { - return true; - } - - if (m_number_of_wildcards > 0) { - size_t found = m_full_path.find("*"); - if (found == 0) { - std::string end = m_full_path.substr(1); - if (rhs.m_full_path.substr((rhs.m_full_path.length() - end.length())) == end) { - return true; - } - } else { - if (rhs.m_full_path.find(m_full_path.substr(0, found - 1)) != std::string::npos) { - return true; - } - } - } - - if (rhs.m_number_of_wildcards > 0) { - size_t found = rhs.m_full_path.find("*"); - if (found == 0) { - std::string end = rhs.m_full_path.substr(1); - if (m_full_path.substr((m_full_path.length() - end.length())) == end) { - return true; - } - } else { - if (rhs.m_full_path.find(m_full_path.substr(0, found - 1)) != std::string::npos) { - return true; - } - } - } - return false; -} - -const string &FilePath::GetFullPath() const { return m_full_path; } - -const string &FilePath::GetType() const { return m_type; } - -const string &FilePath::GetDisk() const { return m_drive; } - -const string &FilePath::RemoveLastDirectory() const { return m_last_directory; } - -int FilePath::GetNumberOfDirectories() const { return m_number_of_directories; } - -const vector &FilePath::ListDirectories() const { return m_list_of_directories; } - -FilePath FilePath::Pop() const { - FilePath out = FilePath(m_last_directory); - return out; -} - -FilePath FilePath::Push(const FilePath &more) const { - string pushed; - string last = m_full_path.substr(m_full_path.length() - 1, 1); - if (last == "\\" || last == "/") { - pushed = m_full_path + more.m_full_path; - } else { - pushed = m_full_path + "/" + more.m_full_path; - } - FilePath out = FilePath(pushed); - return out; -} - -FilePath FilePath::Cd(const FilePath &fp) const { - string full = fp.m_full_path; - string full1 = m_full_path; - FilePath temp = FilePath(full1); - FilePath out, temp2; - if (full.substr(0, 2) == "..") { - if (full == ".." || full == "../" || full == "..\\") { - out = temp.Pop(); - } else if (full.substr(0, 3) == "..\\" || full.substr(0, 3) == "../") { - temp2 = temp.Pop(); - out = temp2.Push(FilePath(full.substr(3))); - } else { - size_t col = full.find_first_of(":"); - int len = full.length(); - if (col != string::npos && col == len - 1) { - out = fp; - } else { - out = temp; - } - } - } else { - out = temp.Push(fp); - } - - return out; -} - -int FilePath::ExtractDisk(const string &name) { - if (name.find_first_of(":") != string::npos) { - m_drive = name.substr(0, name.find_first_of(":")); - if ((name.length() - 1) == name.find_first_of(":")) { - m_error = true; // return error if path is just C: - return -1; // added by ADM jan 24 2011 - } else { - return name.find_first_of(":") + 1; - } - } else { - m_drive = ""; - return 0; - } -} - -int FilePath::ExtractType(const string &name) { - size_t found; - found = name.find_last_of("."); - if (found == string::npos) { - m_type = ""; - return name.length(); - } else { - // a path cannot have a period at the end - if (found == name.length() - 1) { - m_error = true; - } - m_type = name.substr(found + 1); - return int(found); - } -} - -void FilePath::ExtractPath(const string &name, int &index, int end) { - m_number_of_directories = 0; - string temp = name; - while (index < end) { - size_t slash = temp.find_first_of("/"); - string directory; - if (slash != string::npos) { - directory = name.substr(index, slash + 1); - m_list_of_directories.push_back(directory); - m_number_of_directories++; - index += directory.size(); - temp = name.substr(index); - } else { - size_t dot = temp.find_first_of("."); - directory = name.substr(index, dot); - m_list_of_directories.push_back(directory); - m_number_of_directories++; - index += directory.size(); - temp = name.substr(index); - } - } -} - -void FilePath::ExtractPop(const string &rname) { - size_t slash = rname.find_last_of("/"); - m_last_directory = rname.substr(0, slash + 1); -} - -int FilePath::GetNumberOfWildCards(const string &name) { - int len = m_full_path.length(); - int index = 0; - int number = 0; - while (index < len) { - if (m_full_path.substr(index, 1) == "*") { - number++; - } - index++; - } - return number; -} diff --git a/Loader/HTMLDump.cpp b/Loader/HTMLDump.cpp deleted file mode 100644 index 45f2e19..0000000 --- a/Loader/HTMLDump.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/HTMLDump.h" -#include - -using namespace std; - -string HTMLDump::SoftwareVersion("unset"); - -void HTMLDump::SetSoftwareVersion(const string &softwareVersion) { SoftwareVersion = softwareVersion; } - -HTMLDump::HTMLDump(void) {} - -//----------------------------------------------------------- - -HTMLDump::~HTMLDump(void) { - if (dump_file_name.is_open()) { - close(); - } -} - -//----------------------------------------------------------- - -bool HTMLDump::open(const string &file_name) { - dump_file_name.open(file_name.c_str()); - - if (dump_file_name.is_open()) { - dump_file_name << "\n\n
\n";
-      dump_file_name << "running " << SoftwareVersion << endl;
-   }
-
-   return dump_file_name.is_open();
-}
-
-//-----------------------------------------------------------
-
-void HTMLDump::close() {
-   assert(dump_file_name.is_open());
-
-   dump_file_name << "\n
\n\n "; - - dump_file_name.close(); -} - -//----------------------------------------------------------- - -void HTMLDump::dump(const string &data) { dump_file_name << data; } - -//----------------------------------------------------------- - -void HTMLDump::highlight_on(const string &color) { - string first = ""; - dump_file_name << first + color + last; -} - -//----------------------------------------------------------- - -void HTMLDump::highlight_off() { dump_file_name << ""; } diff --git a/Loader/LoadError.cpp b/Loader/LoadError.cpp deleted file mode 100644 index 71184c1..0000000 --- a/Loader/LoadError.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/LoadError.h" - -#include - -#include "loader/Loadable.h" - -LoadError::LoadError(const std::string &text) : logic_error(text) {} diff --git a/Loader/Loadable.cpp b/Loader/Loadable.cpp deleted file mode 100644 index 848bfbc..0000000 --- a/Loader/Loadable.cpp +++ /dev/null @@ -1,215 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/Loadable.h" - -#include -#include - -#include "loader/LoadError.h" - -using namespace std; - -Loadable::Loadable() { - stream = NULL; - was_load_successful = false; -} - -Loadable::~Loadable(void) { cleanup(); } - -Loadable::Loadable(const Loadable &in) { - was_load_successful = in.was_load_successful; - stream = in.stream; -} - -void Loadable::operator=(const Loadable &in) { - was_load_successful = in.was_load_successful; - stream = in.stream; -} - -void Loadable::cleanup() { - lookup_table.clear(); - stream = nullptr; -} - -bool Loadable::test_load() { - string error_message; - bool good = true; - - for (map >::iterator it = lookup_table.begin(); it != lookup_table.end(); ++it) { - if (!(*it).second->ok()) { - error_message = "\nERROR: Did not load required tag '" + (*it).first + "'"; - stream->report_error(error_message + "\n"); - // LOG4CPLUS_FATAL(logger, error_message); - throw LoadError(error_message); - - } else { - // It was okay, but is it default - bool isdefault = - (!((*it).second->is_a_must_load())) && - (!(*it).second->get_loaded_status()); // NOT required && NOT loaded == must be using a default - bool isDeprecated = (*it).second->get_deprecated_info().isDeprecated; - if (isdefault && !isDeprecated) { - string msg = - "The optional tag \"" + (*it).first + - "\" was not found. Its default value will be used."; // unfortunately, the default value is unknown - // here and cannot be included in the message - stream->report_warning(msg + "\n"); - // LOG4CPLUS_INFO(logger, msg); - } - } - } - - return good; -} - -bool Loadable::complete() { - bool f; - string token; - string warning_message; - - while (true) { - // dump(); - f = stream->get_datum(token); // read a token - - if (!f) // if there are no more jump out - { - break; - } - - //------------------------------------------------------------------- - - token = clean_token(token); - - map >::iterator it = lookup_table.find(token); - - if (it == lookup_table.end()) { - // there was no match for the token in the lookup_table - if (token == "}") { - stream->push_back(); - was_load_successful = test_load(); - cleanup(); - return was_load_successful; - } else { - // Create warning statement since the token was not expected. - warning_message = "\nThe unexpected tag \"" + token + - "\" appeared in the run file. \nThis tag was not registered in the load function; it " - "will be ignored."; - stream->report_warning(warning_message + "\n"); - // LOG4CPLUS_WARN(logger, warning_message); - stream->get_next(); // skip over the next token also, assuming it is a value associated with the unknown - // tag - continue; - } - } - - // The token has been found in the lookup_table. Check its deprecated status. - if ((*it).second->get_deprecated_info().isDeprecated) { - // warn since this is a deprecated token - warning_message = " The tag \"" + token + "\" appeared in a loaded file, but is deprecated. "; - if (!((*it).second->get_deprecated_info().supersededByTagName.empty())) { - if ((*it).second->get_deprecated_info().supersededByTagName == "unused") { - warning_message += "This variable is unused. "; - } else if ((*it).second->get_deprecated_info().supersededByTagName == "hard coded") { - warning_message += "This variable is hard coded to the default value: input not used. "; - } else { - warning_message += - "It has been superseded by: " + (*it).second->get_deprecated_info().supersededByTagName; - warning_message += - "\nThe old tag will be used for now, but may be removed in the future. Please update your input " - "files.\n"; - } - } else { - warning_message += - "\nThe old tag will be used for now, but may be removed in the future. Please update your input " - "files.\n"; - } - - stream->report_warning(warning_message); - // LOG4CPLUS_WARN(logger, warning_message); - } - - bool f2 = (*it).second->load(stream); - if (!f2) { - string error_message = "\nERROR The tag \"" + token + "\" could not be loaded"; - stream->report_error(error_message); - // LOG4CPLUS_FATAL(logger, error_message); - throw LoadError(error_message); - } - } - - was_load_successful = test_load(); - cleanup(); - - return was_load_successful; -} - -//-------------------------------------------------------- - -bool Loadable::loaded_successfully() { return was_load_successful; } - -//-------------------------------------------------------- - -void Loadable::report_error(string error_message) { - stream->report_error(error_message); - // LOG4CPLUS_FATAL(logger, error_message); - throw LoadError(error_message); -} - -void Loadable::report_warning(string warning_message) { - stream->report_error(warning_message); - // LOG4CPLUS_WARN(logger, warning_message); -} - -bool Loadable::loadAngleDegrees(Units::Angle &angle) { - double value; - bool result = stream->get_datum(value); - angle = Units::DegreesAngle(value); - return result; -} - -bool Loadable::loadLengthFeet(Units::Length &length) { - double value; - bool result = stream->get_datum(value); - length = Units::FeetLength(value); - return result; -} - -bool Loadable::loadLengthNM(Units::Length &length) { - double value; - bool result = stream->get_datum(value); - length = Units::NauticalMilesLength(value); - return result; -} - -bool Loadable::loadSpeedKnots(Units::Speed &speed) { - double value; - bool result = stream->get_datum(value); - speed = Units::KnotsSpeed(value); - return result; -} - -shared_ptr Loadable::getLoaderLink(const string &name) { - string varnameclean = clean_token(name); - map >::iterator it = lookup_table.find(varnameclean); - if (it == lookup_table.end()) { - return shared_ptr((LoaderLink *)0); - } - return it->second; -} diff --git a/Loader/Loader to do.docx b/Loader/Loader to do.docx deleted file mode 100644 index d2b795b9d697f5ca827d974c27d5aa8574f837b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33590 zcmeEsV~;3MknGsDZQHhO-r*hFwr$(CZQHhO&%3)XFWHy<3A^XR`O=+}^hs5!)71*n zz#u39U;q#R004vl81H68(SQH|)nEVs$N&&P+QPOrP9`=^`YP^rCXTvvZq`-=1t35a zc>qBF^8fez5B`BB)k(QQ281r+d-(WT3j0Yw!lWW_Jn=G-cYxKMCbV$t_084YM#)VG z!i=yK9U{^BnW>o>n}zWfszTPcyz22a4$OLps3x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>>K$A1^`J5%p( z5uKWUiTEdP?|1m`WRJh$t@?k#f1`fEDHyQ{i#tjJQe;K*I!+*Ce{uUtN`B(M-vNV3j|NEZvHyQ}Y-s>OL|8)ma YkOl{gZXh58z@Hyrg5>_ezXAIH0A~HkBme*a diff --git a/Loader/LoaderLink.cpp b/Loader/LoaderLink.cpp deleted file mode 100644 index 1daba1e..0000000 --- a/Loader/LoaderLink.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/LoaderLink.h" - -#include - -#include "loader/LoadError.h" - -using namespace std; - -LoaderLink::LoaderLink(void) { - loaded = false; - must_load = false; - must_load_only_once = false; - is_a_list = false; -} - -LoaderLink::~LoaderLink(void) {} - -//--------------------------------------------------------- - -bool LoaderLink::load(DecodedStream *ds) { - if (must_load_only_once && loaded) { - string msg = "Attempted to load variable second time which is marked as load once"; - ds->report_error(string("\nERROR: ") + msg); - throw LoadError(msg); - } - - bool out = load_s(ds); - - if (!out) { - string msg = "Problem loading variable "; - ds->report_error(string("\nERROR: ") + msg); - throw LoadError(msg); - } - - if (loaded && !is_a_list) { - ds->report_warning("\nWarning: This variable was already loaded once \n"); - } - - loaded = true; - - return true; -} diff --git a/Loader/LoaderSupport.cpp b/Loader/LoaderSupport.cpp deleted file mode 100644 index f100120..0000000 --- a/Loader/LoaderSupport.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/LoaderSupport.h" - -#include - -using namespace std; - -LoaderSupport::LoaderSupport(void) {} - -LoaderSupport::~LoaderSupport(void) {} - -string LoaderSupport::clean_token(const string &token) { - string out = token; - - for (unsigned int i = 0; i < token.size(); i++) // turning string to lower case - { - out[i] = tolower(token[i]); - } - - int pos = out.find(":"); - int size = out.size(); - - if (pos == size - 1) // cut the : off the end of a token - { - out.resize(size - 1); - } - - return out; -} diff --git a/Loader/Logging.cpp b/Loader/Logging.cpp deleted file mode 100644 index 5063094..0000000 --- a/Loader/Logging.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/Logging.h" - -#include -#include - -#include - -static bool logging_initialized_ = false; - -void LoadLoggerProperties() { - if (logging_initialized_) return; - logging_initialized_ = true; - - auto logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("logging.init")); - auto prop_file = getenv("LOG4CPLUS_PROPERTIES"); - if (prop_file == NULL) { - // fall back to log4cplus.properties - prop_file = (char *)"log4cplus.properties"; - } - - if (access(prop_file, F_OK) == -1) { - log4cplus::BasicConfigurator config; - config.configure(); - return; - } - - log4cplus::PropertyConfigurator config(prop_file); - config.configure(); - LOG4CPLUS_TRACE(logger, "LOG4CPLUS_PROPERTIES file is " << LOG4CPLUS_TEXT(prop_file)); -} diff --git a/Loader/LoggingLoadable.cpp b/Loader/LoggingLoadable.cpp deleted file mode 100644 index 56ed48a..0000000 --- a/Loader/LoggingLoadable.cpp +++ /dev/null @@ -1,173 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/LoggingLoadable.h" - -#include -#include - -#include "loader/LoadError.h" - -using namespace std; - -log4cplus::Logger LoggingLoadable::m_logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("LoggingLoadable")); - -LoggingLoadable::LoggingLoadable(void) { - stream = NULL; - was_load_successful = false; -} - -LoggingLoadable::~LoggingLoadable(void) { cleanup(); } - -LoggingLoadable::LoggingLoadable(const LoggingLoadable &in) { - was_load_successful = in.was_load_successful; - stream = in.stream; -} - -void LoggingLoadable::operator=(const LoggingLoadable &in) { - was_load_successful = in.was_load_successful; - stream = in.stream; -} - -bool LoggingLoadable::test_load() { - string error_message; - bool good = true; - - for (map >::iterator it = lookup_table.begin(); it != lookup_table.end(); ++it) { - if (!(*it).second->ok()) { - error_message = "\nERROR: Did not load required tag '" + (*it).first + "'"; - stream->report_error(error_message + "\n"); - LOG4CPLUS_FATAL(m_logger, error_message); - throw LoadError(error_message); - - } else { - // It was okay, but is it default - bool isdefault = - (!((*it).second->is_a_must_load())) && - (!(*it).second->get_loaded_status()); // NOT required && NOT loaded == must be using a default - bool isDeprecated = (*it).second->get_deprecated_info().isDeprecated; - if (isdefault && !isDeprecated) { - string msg = - "The optional tag \"" + (*it).first + - "\" was not found. Its default value will be used."; // unfortunately, the default value is unknown - // here and cannot be included in the message - stream->report_warning(msg + "\n"); - // LOG4CPLUS_WARN(logger, msg); - } - } - } - - return good; -} - -bool LoggingLoadable::complete() { - bool f; - string token; - string warning_message; - - while (true) { - // dump(); - f = stream->get_datum(token); // read a token - - if (!f) // if there are no more jump out - { - break; - } - - //------------------------------------------------------------------- - - token = clean_token(token); - - map >::iterator it = lookup_table.find(token); - - if (it == lookup_table.end()) { - // there was no match for the token in the lookup_table - if (token == "}") { - stream->push_back(); - was_load_successful = test_load(); - cleanup(); - return was_load_successful; - } else { - if (token.size() > 1) { - // Create warning statement since the token was not expected. - warning_message = "\nThe unexpected tag \"" + token + - "\" appeared in the run file. \nThis tag was not registered in the load function; it " - "will be ignored."; - stream->report_warning(warning_message + "\n"); - LOG4CPLUS_INFO(m_logger, warning_message); - } - stream->get_next(); // skip over the next token also, assuming it is a value associated with the unknown - // tag - continue; - } - } - - // The token has been found in the lookup_table. Check its deprecated status. - if ((*it).second->get_deprecated_info().isDeprecated) { - // warn since this is a deprecated token - warning_message = " The tag \"" + token + "\" appeared in a loaded file, but is deprecated. "; - if (!((*it).second->get_deprecated_info().supersededByTagName.empty())) { - if ((*it).second->get_deprecated_info().supersededByTagName == "unused") { - warning_message += "This variable is unused. "; - } else if ((*it).second->get_deprecated_info().supersededByTagName == "hard coded") { - warning_message += "This variable is hard coded to the default value: input not used. "; - } else { - warning_message += - "It has been superseded by: " + (*it).second->get_deprecated_info().supersededByTagName; - warning_message += - "\nThe old tag will be used for now, but may be removed in the future. Please update your input " - "files.\n"; - } - } else { - warning_message += - "\nThe old tag will be used for now, but may be removed in the future. Please update your input " - "files.\n"; - } - - stream->report_warning(warning_message); - LOG4CPLUS_INFO(m_logger, warning_message); - } - - bool f2 = (*it).second->load(stream); - if (!f2) { - string error_message = "\nERROR The tag \"" + token + "\" could not be loaded"; - stream->report_error(error_message); - LOG4CPLUS_FATAL(m_logger, error_message); - throw LoadError(error_message); - } - } - - was_load_successful = test_load(); - cleanup(); - - return was_load_successful; -} - -//-------------------------------------------------------- - -void LoggingLoadable::report_error(string error_message) { - stream->report_error(error_message); - LOG4CPLUS_FATAL(m_logger, error_message); - throw LoadError(error_message); -} - -void LoggingLoadable::report_warning(string warning_message) { - stream->report_error(warning_message); - LOG4CPLUS_WARN(m_logger, warning_message); -} diff --git a/Loader/README b/Loader/README deleted file mode 100644 index 02696d3..0000000 --- a/Loader/README +++ /dev/null @@ -1,22 +0,0 @@ -======================================================================== - STATIC LIBRARY : Loader Project Overview -======================================================================== - -AppWizard has created this Loader library project for you. - -No source files were created as part of your project. - - -Loader.vcproj - This is the main project file for VC++ projects generated using an Application Wizard. - It contains information about the version of Visual C++ that generated the file, and - information about the platforms, configurations, and project features selected with the - Application Wizard. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" comments to indicate parts of the source code you -should add to or customize. - -///////////////////////////////////////////////////////////////////////////// diff --git a/Loader/RunFileArchiveDirector.cpp b/Loader/RunFileArchiveDirector.cpp deleted file mode 100644 index 042c0be..0000000 --- a/Loader/RunFileArchiveDirector.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/RunFileArchiveDirector.h" - -#include -#include -#include -#include - -using namespace std; - -RunFileArchiveDirector::RunFileArchiveDirector(void) {} - -RunFileArchiveDirector::~RunFileArchiveDirector(void) {} - -string RunFileArchiveDirector::get_New_Link_Name(const FilePath &source_file) { - static int i = 1; - - stringstream ss; - ss << i; - - string out; - bool not_in_while = false; - ; - string file = source_file.GetName(); // file of the source; so need to create a function in FilePath that returns - // the name of the file like foo.txt - string extension = source_file.GetType(); - while (true) { - if (!not_in_while) { - if (extension == "") { - out = file; - not_in_while = true; - } else { - out = file + "." + extension; - not_in_while = true; - } - } - if (!is_Name_in_Archive(out)) { - // add to the map - pair::iterator, bool> ret; - ret = mapper.insert(pair(source_file.GetFullPath(), out)); - if (!ret.second) { - return out; - } - break; - } else { - if (extension == "") { - out = file + "_" + ss.str(); - } else { - out = file + "_" + ss.str() + "." + extension; - } - i++; - } - } - return out; - -} //----------------------------------------------------------------------------------- - -bool RunFileArchiveDirector::is_new_File(const FilePath &source_file) const { - if (destination.GetFullPath() == "") { - return false; - } - - return !(mapper.find(source_file.GetFullPath()) == mapper.end()); -} diff --git a/Loader/TokenStream.cpp b/Loader/TokenStream.cpp deleted file mode 100644 index c3abcd9..0000000 --- a/Loader/TokenStream.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#include "loader/TokenStream.h" - -#include - -using namespace std; - -// log4cplus::Logger TokenStream::logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("TokenStream")); - -TokenStream::TokenStream(void) { - error = false; - indents = 0; - echo = false; - last_was_return = false; - // echo = false; - comment_not_end = false; -} - -TokenStream::~TokenStream(void) {} - -/////////////////////////////////////////////////////////////////////////////////// -// public functions -/////////////////////////////////////////////////////////////////////////////////// - -// returns the next token, while not the end of file, -// get each character and check to see if its a comment, -// a quote, or a delimiter. Dont return at all if come across -// a comment. Ensure you get end of quote if character -// is a quote. Return string if character is a delimiter -// otherwise keep getting characters - -Token TokenStream::get_next() { - Token out; - char c; - comment_not_end = false; - - assert(file.is_open()); - - while (!file.eof()) { - c = get_char(); - - if (is_comment(c)) { - while (true) { - out.add_Format(c); - c = get_char(); - if (c == '\n' || file.eof()) { - break; - } - } - } - - if (is_quote(c)) { - return get_quote(); - } - - if (!is_delimiter(c)) { - do { - out.add_Data(c); - c = get_char(); - if (is_delimiter(c) || is_comment(c)) { - file.putback(c); - break; - } - } while (!is_delimiter(c) && !file.eof()); - return out; - } - // must be a delimiter so add to format - out.add_Format(c); - } - - return out; -} - -void TokenStream::close() { file.close(); } - -void TokenStream::report_error(string message) {} - -void TokenStream::report_warning(string message) {} - -/////////////////////////////////////////////////////////////////////////////////// -// protected functions -/////////////////////////////////////////////////////////////////////////////////// - -// returns the next character and echos to -// dump file and command line if echo=true -char TokenStream::get_char() { - char out(0); - file.get(out); - if (file.eof() && comment_not_end) { - report_error("\n\nERROR: End of file was reached before comment ended."); - // LOG4CPLUS_ERROR(logger, "End of file was reached before comment ended."); - } - - if (!file.eof()) { - string out1; - out1 = add_indent(out); - } - return out; -} - -bool TokenStream::is_comment(char c) { - if (c == ';') { - return true; - } else { - return false; - } -} - -bool TokenStream::is_quote(char c) { - if (c == '\"') { - return true; - } else { - return false; - } -} - -bool TokenStream::is_char(char c) { - if (!is_delimiter(c)) { - return true; - } else { - return false; - } -} - -// a quote was found so the text inside the quote should -// be returned. Ensures that there is not a newline -// before the quote ends -Token TokenStream::get_quote() { - Token out; - char c; - - while (true) { - c = get_char(); - if (c == '\n') { - report_error("\n\nERROR: Newline before end of quote."); - // LOG4CPLUS_ERROR(logger, "Newline before end of quote."); - } - if (is_quote(c)) { - return out; - } - // out += c; - out.add_Data(c); - } -} - -// returns true if a delimiter is found -bool TokenStream::is_delimiter(char ch) { - switch (ch) { - case ' ': // space - case ',': // comma - case 9: // tab - case 10: // newline - case -52: - return true; - default: - return false; - } -} - -/////////////////////////////////////////////////////////////////////////////////// -// private functions -/////////////////////////////////////////////////////////////////////////////////// - -string TokenStream::add_indent(char c) { - string out; - if (c == '\n') { - last_was_return = true; - } else { - if (last_was_return) { - for (int i = 0; i < indents; i++) { - out = out + " "; - } - last_was_return = false; - } - } - out = out + c; - return out; -} diff --git a/Public/CMakeLists.txt b/Public/CMakeLists.txt index dbf111b..974bcc7 100644 --- a/Public/CMakeLists.txt +++ b/Public/CMakeLists.txt @@ -30,7 +30,7 @@ CPMAddPackage( VERSION 3.11.3 ) -set(SOURCE_FILES +set(LIBRARY_SOURCE_FILES ADSBSVReport.cpp AircraftCalculations.cpp AircraftControl.cpp @@ -103,16 +103,15 @@ set(SOURCE_FILES set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) -add_library(pub STATIC ${SOURCE_FILES}) +add_library(pub STATIC ${LIBRARY_SOURCE_FILES}) target_include_directories(pub PUBLIC ${geolib_idealab_INCLUDE_DIRS} ${aaesim_INCLUDE_DIRS} ${minicsv_INCLUDE_DIR}) target_link_libraries(pub PUBLIC - loader - mitre::cppuom + mitre::fsloader geolib - log4cplusS + log4cplus::log4cplus nlohmann_json::nlohmann_json "$<$,$,9.1>>:-lstdc++fs>") diff --git a/include/loader/ArchiveStreamEcho.h b/include/loader/ArchiveStreamEcho.h deleted file mode 100644 index 67447b5..0000000 --- a/include/loader/ArchiveStreamEcho.h +++ /dev/null @@ -1,80 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -#include "loader/Token.h" - -template - -class ArchiveStreamEcho : public PARENT { - public: - ArchiveStreamEcho(void) {} - - ~ArchiveStreamEcho(void) { - if (archive_file.is_open()) { - archive_file.close(); - } - } - - // opens the archive file and writes a header comment at the top - bool open_Archive(const std::string &new_file_name, const std::string &header_comment) { - archive_file.open(new_file_name.c_str()); - if (archive_file.is_open()) { - archive_file << ";"; - archive_file << header_comment; - archive_file << "\n"; - return true; - } - return false; - } - - // rewrites the include statement in the archive of the primary file - void rewrite_Last_in_Archive(const std::string &s) { old_token.set_data(s); } - - // writes the tokens into the archive file that is open and calls get next - Token get_next() { - if (archive_file.is_open()) { - archive_file << old_token.get_All(); - } - old_token = PARENT::get_next(); - return old_token; - } //-------------------------------------------- - - ArchiveStreamEcho &operator=(const ArchiveStreamEcho &rhs) { - PARENT::operator=(rhs); - - return *this; - } //-------------------------------------------- - - // makes sure that the old_token is still written into the secondary open archive file - // before it is closed - void write_Last_Token(const std::string &old_token) { - if (archive_file.is_open()) { - archive_file << old_token; - } - } - - protected: - std::ofstream archive_file; - Token old_token; -}; diff --git a/include/loader/CommentStream.h b/include/loader/CommentStream.h deleted file mode 100644 index 6c74b7f..0000000 --- a/include/loader/CommentStream.h +++ /dev/null @@ -1,110 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once -#include - -#include "loader/Token.h" - -template -class CommentStream : public PARENT { - public: - CommentStream(void) {} - - ~CommentStream(void) {} - - Token get_next() { - Token out; - char first; - std::string comm; - char next_ch; - bool maybe = false; - bool yes_comm = false; - - // iterate through characters to look for delimiters before a block comment - // add delimiters to the format part of token. if you find a / then check to see if the next is - // a *. If it is then you have a block comment and go through the comment stream, else put back - // the characters / and whatever was next and call get_next - first = PARENT::get_char(); - - if (PARENT::is_delimiter(first)) { - while (PARENT::is_delimiter(first)) { - if (PARENT::file.eof()) { - break; - } - out.add_Format(first); - first = PARENT::get_char(); - } - } - if (first == '/') { - char second = PARENT::get_char(); - if (second == '*') { - yes_comm = true; - } else { - PARENT::file.putback(second); - PARENT::file.putback(first); - } - } else if (!PARENT::file.eof()) { - PARENT::file.putback(first); - } - - if (!yes_comm) { - Token out1 = PARENT::get_next(); - out.add_Format(out1.get_Format()); - out.add_Data(out1.get_Data()); - - return out; - } else // look for long comment delimiter - { - PARENT::comment_not_end = true; - out.add_Format('/'); - out.add_Format('*'); - - while (true) { - next_ch = PARENT::get_char(); // get the next character - - if (maybe) // if the last character was a * then look for / to end comment - { - if (next_ch == '/') { - out.add_Format(next_ch); - break; - } else // no / was found so reset maybe to false and loop through again. - { - out.add_Format(next_ch); - maybe = false; - } - } - - if (next_ch == '*') // look for potential beginning of end comment delimiter - { - maybe = true; - } - out.add_Format(next_ch); - } - - Token out2 = PARENT::get_next(); - out.add_Format(out2.get_Format()); - out.add_Data(out2.get_Data()); - - return out; - } - - // not a comment so get next - } -}; diff --git a/include/loader/DecodedStream.h b/include/loader/DecodedStream.h deleted file mode 100644 index ebaf06e..0000000 --- a/include/loader/DecodedStream.h +++ /dev/null @@ -1,93 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -#include "scalar/Acceleration.h" -#include "scalar/Angle.h" -#include "scalar/Area.h" -#include "scalar/Length.h" -#include "scalar/Mass.h" -#include "scalar/MassFlowRate.h" -#include "scalar/Speed.h" -#include "scalar/Time.h" -#include "loader/ArchiveStreamEcho.h" -#include "loader/CommentStream.h" -#include "loader/IncludeStream.h" -#include "loader/SinglePushBackStream.h" -#include "loader/TokenStream.h" - -class DecodedStream : public SinglePushBackStream > > > { - public: - DecodedStream(void); - - ~DecodedStream(void); - - /* - * Primitive Declarations - */ - bool get_datum(std::string &s); - - bool get_datum(short &s); - - bool get_datum(unsigned short &s); - - bool get_datum(int &s); - - bool get_datum(unsigned int &s); - - bool get_datum(long &s); - - bool get_datum(double &s); - - bool get_datum(float &s); - - bool get_datum(bool &s); - - /* - * Unitized declarations - */ - bool get_datum(Units::MetersLength &s); - - bool get_datum(Units::NauticalMilesLength &s); - - bool get_datum(Units::FeetLength &s); - - bool get_datum(Units::KilometersLength &s); - - bool get_datum(Units::MetersPerSecondSpeed &s); - - bool get_datum(Units::KnotsSpeed &s); - - bool get_datum(Units::SecondsTime &s); - - bool get_datum(Units::DegreesAngle &s); - - bool get_datum(Units::RadiansAngle &s); - - bool get_datum(Units::KilogramsMass &s); - - bool get_datum(Units::PoundsMass &s); - - bool get_datum(Units::FeetArea &s); - - bool get_datum(Units::MetersArea &s); -}; diff --git a/include/loader/EchoStream.h b/include/loader/EchoStream.h deleted file mode 100644 index 0b9c2c7..0000000 --- a/include/loader/EchoStream.h +++ /dev/null @@ -1,113 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include "loader/Token.h" -#include "loader/HTMLDump.h" -#include - -template -class EchoStream : public PARENT { - public: - EchoStream(void) {} - - ~EchoStream(void) {} - - Token get_next() { - Token out; - - while (true) { - out = PARENT::get_next(); - - if (out.get_Data() == "#echo_on") { - PARENT::set_echo(true); - continue; - } - - if (out.get_Data() == "#echo_off") { - PARENT::set_echo(false); - continue; - } - if (out.get_Data() == "#echo_file") { - std::string echo_file_name = PARENT::get_next().get_Data(); - - // TODO fix this - - bool out1 = open_echo_file(echo_file_name); - if (!out1) { - std::string msg = "Could not open specified dump file: " + echo_file_name; - report_error(msg); - throw std::runtime_error(msg); - } - continue; - } - if (out.get_Data() == "#end_echo_file") { - close_echo_file(); - continue; - } - - break; - } - - // if echo is on and open write the echo - if (echo_file.is_open()) { - // logic for the output goes here. - echo_file.dump(out.get_All()); - } - - return out; - } - - bool open_echo_file(const std::string &my_echo_file) { - echo_file.open(my_echo_file.c_str()); - - if (echo_file.is_open()) { - return true; - } - return false; - } - - void close_echo_file() { echo_file.close(); } - - void report_error(std::string message) { - PARENT::report_error(message); // reports the error to the parent class - - if (echo_file.is_open()) { - // outputs the error to the echo_file if open - echo_file.highlight_on("yellow"); - echo_file.dump(message); - echo_file.highlight_off(); - } - } - - void report_warning(std::string message) { - PARENT::report_warning(message); // reports the warning to the parent class - - if (echo_file.is_open()) { - // outputs the error to the echo_file if open - echo_file.highlight_on("yellow"); - echo_file.dump(message); - echo_file.highlight_off(); - } - } - - private: - HTMLDump echo_file; -}; diff --git a/include/loader/FilePath.h b/include/loader/FilePath.h deleted file mode 100644 index 3188402..0000000 --- a/include/loader/FilePath.h +++ /dev/null @@ -1,79 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -class FilePath { - public: - FilePath(); - - virtual ~FilePath(); - - explicit FilePath(const std::string &name); - - const std::string &GetFullPath() const; - - const std::string &GetType() const; - - const std::string &GetDisk() const; - - const std::string &RemoveLastDirectory() const; - - int GetNumberOfDirectories() const; - - const std::vector &ListDirectories() const; - - const std::string &GetName() const; - - FilePath Pop() const; - - FilePath Push(const FilePath &more) const; - - FilePath Cd(const FilePath &fp) const; - - bool operator==(const FilePath &rhs) const; - - private: - int ExtractDisk(const std::string &name); - - int ExtractType(const std::string &name); - - void ExtractPath(const std::string &name, int &index, int end); - - void ExtractPop(const std::string &name); - - int GetNumberOfWildCards(const std::string &name); - - std::vector m_list_of_directories; - - std::string m_full_path; - std::string m_drive; - std::string m_type; - std::string m_last_directory; - std::string m_file_name; - - int m_number_of_directories; - int m_number_of_wildcards; - bool m_error; -}; - -inline const std::string &FilePath::GetName() const { return m_file_name; } diff --git a/include/loader/FormatDifferentiatorStreamEcho.h b/include/loader/FormatDifferentiatorStreamEcho.h deleted file mode 100644 index 2df853c..0000000 --- a/include/loader/FormatDifferentiatorStreamEcho.h +++ /dev/null @@ -1,110 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -#include "loader/MoreStringFunctions.h" -#include "loader/HTMLDump.h" -#include "loader/Token.h" - -template - -class FormatDifferentiatorStreamEcho : public PARENT { - public: - FormatDifferentiatorStreamEcho(void) {} //-------------------------------------------- - - ~FormatDifferentiatorStreamEcho(void) {} //-------------------------------------------- - - // highlight the format part in blue and the data part in yellow, mainly - // used for debug purposes - Token get_next() { - Token out; - out = PARENT::get_next(); - if (PARENT::get_echo()) { - std::string data = out.get_Data(); - std::string format = out.get_Format(); - - dump_file.highlight_on("blue"); - std::string enhanced_format = - MoreStringFunctions::FindAndReplace(format, "\n", std::string("\n") + PARENT::get_Space()); - dump_file.dump(enhanced_format); - dump_file.highlight_off(); - - dump_file.highlight_on("yellow"); - dump_file.dump(data); - dump_file.highlight_off(); - } - - return out; - - } //-------------------------------------------- - - void report_error(std::string message) { - dump_file.highlight_on("red"); - - dump_file.dump(message); - - dump_file.highlight_off(); - - PARENT::report_error(message); - - } //-------------------------------------------- - - void report_warning(std::string message) { - dump_file.highlight_on("green"); - - dump_file.dump(message); - - dump_file.highlight_off(); - - PARENT::report_warning(message); - - } //-------------------------------------------- - - void print_to_dumpfile(std::string dump) { - dump_file.dump(dump); - PARENT::print_to_dumpfile(dump); - } //-------------------------------------------- - - FormatDifferentiatorStreamEcho &operator=(const FormatDifferentiatorStreamEcho &rhs) { - PARENT::operator=(rhs); - - return *this; - } //-------------------------------------------- - - private: - HTMLDump dump_file; // the dump file - - protected: - bool set_output_file(const std::string &dump_file_name, int i) { - std::stringstream ss; - ss << i; - std::string html = ".html"; - if (i == 0) { - dump_file.open((dump_file_name + html).c_str()); - } else { - dump_file.open((dump_file_name + ss.str() + html).c_str()); - } - bool opened = dump_file.is_open(); - return opened && PARENT::set_output_file(dump_file_name, i + 1); - } //-------------------------------------------- -}; diff --git a/include/loader/HTMLDump.h b/include/loader/HTMLDump.h deleted file mode 100644 index 7480184..0000000 --- a/include/loader/HTMLDump.h +++ /dev/null @@ -1,48 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -class HTMLDump { - public: - static void SetSoftwareVersion(const std::string &version); - - HTMLDump(void); - - ~HTMLDump(void); - - bool open(const std::string &file_name); - - void close(); - - void dump(const std::string &data); - - void highlight_on(const std::string &color); - - void highlight_off(); - - bool is_open() { return dump_file_name.is_open(); } - - private: - static std::string SoftwareVersion; - std::ofstream dump_file_name; -}; diff --git a/include/loader/IncludeStream.h b/include/loader/IncludeStream.h deleted file mode 100644 index 202a981..0000000 --- a/include/loader/IncludeStream.h +++ /dev/null @@ -1,273 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -#include -#include - -#include "loader/FilePath.h" -#include "loader/RunFileArchiveDirector.h" -#include "loader/Token.h" - -template -class IncludeStream : public PARENT { - public: - IncludeStream(void) // constructor - { - secondary = NULL; - archive_director.reset(); - } //---------------------------------------------------------------------------------------------- - - ~IncludeStream(void) // destructor - { - if (secondary != NULL) { - delete secondary; - secondary = NULL; - } - } //---------------------------------------------------------------------------------------------- - - inline bool open_file(const std::string &file_name) // this over load is needed to track relative directory - // referance - { - FilePath temp = FilePath(file_name); - local_path = temp.Pop(); - return PARENT::open_file(file_name); - } //---------------------------------------------------------------------------------------------- - - inline const FilePath &get_file_path() const // TODO prototype this with a do nothing class in the root class - { - return local_path; - } //---------------------------------------------------------------------------------------------- - - Token get_next() // get next token from include file- calls get next from token stream - { - Token out; - Token temp; - - if (secondary == NULL) { - out = get_next_from_primary(); - } else { - temp = get_next_from_secondary(); - - if (temp.get_Data().size() != 0) { - return temp; - } else { - out = get_next_from_primary(); - - // bring over formatting at end of secondary - out.add_Format(temp.get_Format()); - - out.add_Format('\n'); // put in a new line - } - } - - return out; - } //---------------------------------------------------------------------------------------------- - - void set_Archive_Director(std::shared_ptr new_ad) { - assert(archive_director == NULL); - archive_director = new_ad; - } - - void set_Local_Path(const FilePath &fp) { local_path = fp; } - - //===================================================================================== - // overloading indent management functions - inline void tab_In() { - if (secondary == NULL) { - PARENT::tab_In(); - } else { - secondary->tab_In(); - } - } //-------------------------------------------------------- - - inline void tab_Out() { - if (secondary == NULL) { - PARENT::tab_Out(); - } else { - secondary->tab_Out(); - } - } //-------------------------------------------------------- - - inline int get_Tab() { - if (secondary == NULL) { - return PARENT::get_Tab(); - } else { - return secondary->get_Tab(); - } - } //-------------------------------------------------------- - - inline void set_Tab(int tab) { - if (secondary == NULL) { - PARENT::set_Tab(); - } else { - secondary->set_Tab(); - } - } //-------------------------------------------------------- - - inline std::string get_Space() { - if (secondary == NULL) { - return PARENT::get_Space(); - } else { - return secondary->get_Space(); - } - } - //===================================================================================== - private: - Token get_next_from_primary() { - Token out; - out = PARENT::get_next(); - - if (out.get_Data() == "#include") { - out.add_Format(out.get_Data()); - out.set_data(""); - Token out1 = PARENT::get_next(); - out.add_Format(out1.get_Format()); - out.add_Format(out1.get_Data()); - std::string new_file_name = out1.get_Data(); - FilePath included_file = FilePath(new_file_name); - - // sets the local_path variable based on what the include file name is because - // the include file name may be relative or absolute - while (true) { - // if((included_file.get_Full_Path().find("..")!=string::npos) || (included_file.get_Num_Dir()>1 && - // included_file.get_Disk()=="" && included_file.get_Type()!="")) - bool has_mult_dirs = included_file.GetNumberOfDirectories() > 1; - bool has_file_ext = included_file.GetType() != ""; -#ifdef _MSC_VER - bool has_dotdot = included_file.get_Full_Path().find("..") != string::npos; - bool has_drive = included_file.get_Disk() != ""; - if (has_dotdot || (has_mult_dirs && !has_drive && has_file_ext)) { - local_path = local_path.pop().cd(new_file_name); - // cd_to_path = true; - break; - } - - // if(included_file.get_Num_Dir()>1 && included_file.get_Disk()!="" && included_file.get_Type()!="") - if (has_mult_dirs && has_drive && has_file_ext) { - local_path = included_file; - abs_path_flag = true; - break; - } - - local_path = FilePath(local_path.get_Full_Path() + "\\" + included_file.get_Full_Path()); -#else - if (has_mult_dirs && has_file_ext) { - local_path = included_file; - break; - } - - local_path = FilePath(local_path.GetFullPath() + "/" + included_file.GetFullPath()); -#endif - break; - } - - new_file_name = local_path.GetFullPath(); - - bool r = open_secondary(new_file_name); - - if (!r) { - std::string e = "\n\nCould not open "; - std::string f = new_file_name; - std::string g = "\n"; - std::string h = e + f + g; - PARENT::report_error(h); - } else { - tab_In(); - Token out2 = get_next(); // we call it recursively so we can deal with an empty include file - out.add_Format("\n"); - out.add_Format(out2.get_Format()); - out.add_Data(out2.get_Data()); - } - } - - return out; - } //---------------------------------------------------------------------------------------------- - - Token get_next_from_secondary() { - Token out; - - out = secondary->get_next(); - - if (out.get_Data() == "") { - secondary->write_Last_Token(out.get_Format()); - close_secondary(); - } - - return out; - } //---------------------------------------------------------------------------------------------- - - bool open_secondary(const std::string &file_name) { - assert(secondary == NULL); - - secondary = new IncludeStream; - - *secondary = *this; // this should copy all the settings - - secondary->secondary = - NULL; // sets the original secondary to NULL so it doesn't point to itself and cause an infinite loop - - bool r = secondary->open_file(file_name); // open the file we will be getting data from - - if (!r) // we could not open the file - { - delete secondary; - return false; - } else { - FilePath fp = FilePath(file_name); - std::string name = fp.GetName(); - if (fp.GetType() != "") { - name = name + "." + fp.GetType(); - } - - // if(!archive_director->is_new_File(fp)) // need to make an archive copy - if (archive_director->is_new_File(fp)) // need to make an archive copy - { - std::string where_to_put_it = archive_director->get_Destination(); - FilePath loc = FilePath(where_to_put_it); - FilePath to_open = loc.Push(FilePath(archive_director->get_New_Link_Name(FilePath(file_name)))); - loc = loc.Push(FilePath(name)); - std::string comment = std::string("; This file is an archive copy of a file formerly called: \"") + - file_name + std::string("\"\n"); - - secondary->open_Archive(to_open.GetFullPath(), comment); - } - - // Now we need to rewrite the include statement in the archive of the primary - PARENT::rewrite_Last_in_Archive(file_name); - - return true; - } - - } //---------------------------------------------------------------------------------------------- - - void close_secondary() { - tab_Out(); - delete secondary; - secondary = NULL; - } //---------------------------------------------------------------------------------------------- - - IncludeStream *secondary; - std::shared_ptr archive_director; - - FilePath local_path; -}; diff --git a/include/loader/IndentManagement.h b/include/loader/IndentManagement.h deleted file mode 100644 index e5e4760..0000000 --- a/include/loader/IndentManagement.h +++ /dev/null @@ -1,58 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -class IndentManagement { - public: - IndentManagement(void) { i = 0; } //-------------------------------------------------------- - - ~IndentManagement(void) {} //-------------------------------------------------------- - - inline void tab_In() { - i++; - s = s + " "; - } //-------------------------------------------------------- - - inline void tab_Out() { - i--; - int tabs = get_Tab(); - if (tabs == 0) { - s = ""; - } else { - s = ""; - while (tabs > 0) { - s = s + " "; - tabs--; - } - } - } //-------------------------------------------------------- - - inline int get_Tab() { return i; } //-------------------------------------------------------- - - inline void set_Tab(int tab) { i = tab; } //-------------------------------------------------------- - - inline const std::string &get_Space() const { return s; } - - protected: //-------------------------------------------------------- - int i; - std::string s; -}; diff --git a/include/loader/ListLoaderLink.h b/include/loader/ListLoaderLink.h deleted file mode 100644 index 5313b8e..0000000 --- a/include/loader/ListLoaderLink.h +++ /dev/null @@ -1,85 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -#include "loader/LoaderLink.h" - -template -class ListLoaderLink : public LoaderLink { - public: - explicit ListLoaderLink(std::list *address) { - var_address = address; - must_load_only_once = false; - is_a_list = true; - } - - //------------------------------------------------- - - bool load_s(DecodedStream *ds) { - DATA temp; - std::string token; - bool f; - - f = ds->get_datum(token); - - if (!f) { - return false; - } - - if (token.compare("{") != 0) { - return false; - } - - while (true) { - f = ds->get_datum(token); - - if (!f) { - return false; - } - - if (token.compare("}") == 0) // look for the } at the end of the list - { - return true; // dun - } else { - ds->push_back(); // need to put the token back - } - - // load the entry - - f = temp.load(ds); - - if (!f) { - return false; - } - - // add it to the list - - var_address->push_back(temp); - } - - return true; - } - - private: - std::list *var_address; -}; diff --git a/include/loader/LoadError.h b/include/loader/LoadError.h deleted file mode 100644 index 5f3abc9..0000000 --- a/include/loader/LoadError.h +++ /dev/null @@ -1,37 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -/* - * LoadError.h - * - * Created on: Sep 22, 2016 - * Author: klewis - */ - -/** Subclass of logic_error used for reporting loading errors. */ - -#pragma once - -#include -#include - -class LoadError : public std::logic_error { - public: - explicit LoadError(const std::string &text); -}; diff --git a/include/loader/Loadable.h b/include/loader/Loadable.h deleted file mode 100644 index 5995089..0000000 --- a/include/loader/Loadable.h +++ /dev/null @@ -1,425 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -#include -#include -#include -#include -#include -#include - -#include "loader/DecodedStream.h" -#include "loader/ListLoaderLink.h" -#include "loader/LoadableLoaderLink.h" -#include "loader/LoadableLoaderLinkWithBrackets.h" -#include "loader/LoaderLink.h" -#include "loader/LoaderSupport.h" -#include "loader/NamedElementLoaderLink.h" -#include "loader/NativeLoaderLink.h" -#include "scalar/Angle.h" -#include "scalar/Speed.h" - -class Loadable : public LoaderSupport { - public: - inline static const LoaderDeprecatedMetaInfo DEFAULT_META_INFO = {false, ""}; - - Loadable(); - - Loadable(const Loadable &in); - - virtual ~Loadable(void); - - virtual void operator=(const Loadable &in); - - virtual bool load(DecodedStream *input) = 0; // all children of this class must implement this function it will - // return true if it can load - - // for loading sequences of things that are not named - - template - bool load_datum(TYPE &datum) // load one var - { - bool out = stream->get_datum(datum); - - return out; - } - - bool loadAngleDegrees(Units::Angle &angle); - - bool loadLengthFeet(Units::Length &length); - - bool loadSpeedKnots(Units::Speed &speed); - - bool loadLengthNM(Units::Length &length); - - //======================================================================== - // for loading named vars ------------------------------------------------------ - - /** - * Register an optional tag to load. - * - * @param name - * @param var_address - */ - template - void register_var(const std::string &name, TYPE *var_address) { - register_var(name, var_address, false, DEFAULT_META_INFO); - } - - /** - * Use this to declare a variable and to control its required flag. By definition, a required variable is NOT - * deprecated. - * - * @param name - * @param var_address - * @param required - * @param deprecated - */ - template - void register_var(const std::string &name, TYPE *var_address, bool isRequired) { - register_var(name, var_address, isRequired, DEFAULT_META_INFO); - } - - /** - * Use this to declare a variable and to control its deprecated flag. The required flag will be set to false. - * - * @param name - * @param var_address - */ - template - void register_var(const std::string &name, TYPE *var_address, const LoaderDeprecatedMetaInfo &info) { - register_var(name, var_address, false, info); - } - - // for loading lists --------------------------------------------------------- - // in the run file the named list appears once and is proceeded by the name of the list - - /** - * Register an optional LOADABLE_TYPE named list. - * @param name - * @param target - */ - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_vector_item(const std::string &name, std::vector *target) { - register_named_vector_item(name, target, false, DEFAULT_META_INFO); - } - - /** - * Register an optional LOADABLE_TYPE named list with required information. - * - * @param name - * @param target - * @param isRequired - */ - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_vector_item(const std::string &name, std::vector *target, bool isRequired) { - register_named_vector_item(name, target, isRequired, DEFAULT_META_INFO); - } - - /** - * Register an optional LOADABLE_TYPE named list with deprecated information. - * - * @param name - * @param target - * @param info - */ - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_vector_item(const std::string &name, std::vector *target, - const LoaderDeprecatedMetaInfo &info) { - register_named_vector_item(name, target, false, info); - } - - //--------------------------------------------------------------------------------------------------- - - /** - * Register an optional LOADABLE_TYPE list. LOADABLE_TYPE Must be a child of loadable or provide the necessary load - * function. - * - * @param name - * @param target - */ - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_list(const std::string &name, std::list *target) { - register_named_list(name, target, false, DEFAULT_META_INFO); - } - - /** - * Register a LOADABLE_TYPE list with an specific required setting. LOADABLE_TYPE Must be a child of loadable or - * provide the necessary load function. - * - * @param name - * @param target - * @param isRequired - */ - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_list(const std::string &name, std::list *target, bool isRequired) { - register_named_list(name, target, isRequired, DEFAULT_META_INFO); - } - - /** - * Register an optional LOADABLE_TYPE list with an specific LoaderDeprecatedMetaInfo setting. LOADABLE_TYPE Must be a - * child of loadable or provide the necessary load function. - * - * @param name - * @param target - * @param info - */ - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_list(const std::string &name, std::list *target, - const LoaderDeprecatedMetaInfo &info) { - register_named_list(name, target, false, info); - } - - // void register_named_list(string heading, Loadable_List *list); // this is used if all the list items are in a - // single block - //---------------------------------------------------------------------------------------------------------------------------- - - /** - * Register an optional inline loadable tag. This is useful for multiple parameters on a single line with a custom - * Loadable. - * - * @param name - * @param target - */ - template - void register_loadable(const std::string &name, LOADABLE_TYPE *target) { - register_loadable(name, target, false, DEFAULT_META_INFO); - } - - /** - * Register an inline loadable tag with specific required properties. - * - * @param name - * @param target - * @param isRequired - */ - template - void register_loadable(const std::string &name, LOADABLE_TYPE *target, bool isRequired) { - register_loadable(name, target, isRequired, DEFAULT_META_INFO); - } - - /** - * Register an optional inline loadable tag with specific deprecated properties. - * - * @param name - * @param target - * @param info - */ - template - void register_loadable(const std::string &name, LOADABLE_TYPE *target, const LoaderDeprecatedMetaInfo &info) { - register_loadable(name, target, false, info); - } - - //------------------------------------------------------------------------------------------------- - - /** - * This will register the bracket as optional and not deprecated. - * - * @param name bracket name - * @param target pointer to storage variable - */ - template - void register_loadable_with_brackets(const std::string &name, LOADABLE_TYPE *target) { - register_loadable_with_brackets(name, target, false, DEFAULT_META_INFO); - } - - /** - * Register a loadable tag with and set the required field. - * - * @param name - * @param target - * @param isRequired - */ - template - void register_loadable_with_brackets(const std::string &name, LOADABLE_TYPE *target, bool isRequired) { - register_loadable_with_brackets(name, target, isRequired, DEFAULT_META_INFO); - } - - /** - * Register an optional loadable tag and set the deprecated information. - * - * @param name - * @param target - * @param info - */ - template - void register_loadable_with_brackets(const std::string &name, LOADABLE_TYPE *target, - const LoaderDeprecatedMetaInfo &info) { - register_loadable_with_brackets(name, target, false, info); - } - - /** - * Call this after you finish registering things at it will load all the things it could and return false if it fails - * - * @return - * @see loaded_successfully() - */ - virtual bool complete(); - - virtual void dump() { /* intentionally empty */ }; // dump them to cout - - virtual void report_error(std::string error_message); - - virtual void report_warning(std::string warning_message); - - /** - * returns true if the call to complete() went well - * - * @return - */ - bool loaded_successfully(); - - protected - : //---------------------------------------------------------------------------------------------------------------------------- - void set_stream(DecodedStream *input) // This should be called in the loader function of the child - { - stream = input; - } - - DecodedStream *stream; - - void cleanup(); - - virtual bool test_load(); - - std::shared_ptr getLoaderLink(const std::string &name); - - std::map> lookup_table{}; - - bool was_load_successful{false}; - - private: //---------------------------------------------------------------- -#ifdef _DEBUG - - template - void check_address(P *a) { - assert(set1.find((void *)a) == set1.end()); // if assertion fails, it is because someone tried to register same - // address more than once - set1.insert((void *)a); - } - - set set1; - -#endif - - template - void register_var(const std::string &name, TYPE *var_address, bool isRequired, - const LoaderDeprecatedMetaInfo &depInfo) { - std::string varnameclean = clean_token(name); - -#ifdef _DEBUG - check_address(var_address); -#endif - - assert(lookup_table.find(varnameclean) == lookup_table.end()); // The user caller to register the variable name - // twice - - std::shared_ptr new_link = std::make_unique>(var_address); - new_link->set_must_load(isRequired); // set required flag - new_link->set_deprecated_info(depInfo); - - lookup_table[varnameclean] = new_link; - } - - template - void register_loadable_with_brackets(const std::string &name, LOADABLE_TYPE *target, bool isRequired, - const LoaderDeprecatedMetaInfo &depInfo) { - std::string varnameclean = clean_token(name); - -#ifdef _DEBUG - check_address(target); -#endif - - assert(lookup_table.find(varnameclean) == lookup_table.end()); // The user caller to register the variable name - // twice - - std::shared_ptr new_link = std::make_unique>(target); - new_link->set_must_load(isRequired); - new_link->set_deprecated_info(depInfo); - - lookup_table[varnameclean] = new_link; - } - - template - void register_loadable(const std::string &name, LOADABLE_TYPE *target, bool isRequired, - const LoaderDeprecatedMetaInfo &info) { - std::string varnameclean = clean_token(name); - -#ifdef _DEBUG - check_address(target); -#endif - assert(lookup_table.find(varnameclean) == lookup_table.end()); // The user caller to register the variable name - // twice - - std::shared_ptr new_link = std::make_unique>(target); - new_link->set_must_load(isRequired); - new_link->set_deprecated_info(info); - - lookup_table[varnameclean] = new_link; - } - - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_list(const std::string &name, std::list *target, bool isRequired, - const LoaderDeprecatedMetaInfo &info) { - std::string varnameclean = clean_token(name); - -#ifdef _DEBUG - check_address(target); -#endif - assert(lookup_table.find(varnameclean) == lookup_table.end()); // The user caller to register the variable name - // twice - - std::shared_ptr new_link = std::make_unique>(target); - new_link->set_must_load(isRequired); - new_link->set_deprecated_info(info); - - lookup_table[varnameclean] = new_link; - } - - template - // LOADABLE_TYPE Must be a child of loadable or provide the necessary load function - void register_named_vector_item(const std::string &name, std::vector *target, bool isRequired, - const LoaderDeprecatedMetaInfo &info) { - std::string varnameclean = clean_token(name); - -#ifdef _DEBUG - check_address(target); -#endif - - assert(lookup_table.find(varnameclean) == lookup_table.end()); // The user caller to register the variable name - // twice - - std::shared_ptr new_link = std::make_unique>(target); - new_link->set_must_load(isRequired); - new_link->set_deprecated_info(info); - - lookup_table[varnameclean] = new_link; - } -}; diff --git a/include/loader/LoadableLoaderLink.h b/include/loader/LoadableLoaderLink.h deleted file mode 100644 index d5d9196..0000000 --- a/include/loader/LoadableLoaderLink.h +++ /dev/null @@ -1,43 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include "loader/LoaderLink.h" - -template -class LoadableLoaderLink : public LoaderLink { - public: - explicit LoadableLoaderLink(DATA *address) { var_address = address; } - - //------------------------------------------------- - - LoadableLoaderLink(DATA *address, bool required, bool no_reset) { - var_address = address; - must_load = required; - must_load_only_once = no_reset; - } - - //------------------------------------------- - - bool load_s(DecodedStream *ds) { return var_address->load(ds); } - - private: - DATA *var_address; -}; diff --git a/include/loader/LoadableLoaderLinkWithBrackets.h b/include/loader/LoadableLoaderLinkWithBrackets.h deleted file mode 100644 index f7a7ca8..0000000 --- a/include/loader/LoadableLoaderLinkWithBrackets.h +++ /dev/null @@ -1,84 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -#include "loader/DecodedStream.h" -#include "loader/LoaderLink.h" - -template -class LoadableLoaderLinkWithBrackets : public LoaderLink { - public: - explicit LoadableLoaderLinkWithBrackets(DATA *address) { var_address = address; } - - //------------------------------------------------- - - LoadableLoaderLinkWithBrackets(DATA *address, bool required, bool no_reset) { - var_address = address; - must_load = required; - must_load_only_once = no_reset; - } - - bool load_s(DecodedStream *ds) { - std::string barck; - bool r = ds->get_datum(barck); - - if (!r) { - std::string msg = "ERROR: end of file while looking for {"; - ds->report_error("\n" + msg); - throw std::runtime_error(msg); - } - - if (barck != "{") { - std::string msg = "ERROR: found " + barck + "while looking for {"; - ds->report_error("\n" + msg); - throw std::runtime_error(msg); - } - - r = var_address->load(ds); - - if (!r) { - std::string msg = "ERROR: could not load object"; - ds->report_error("\n" + msg); - throw std::runtime_error(msg); - } - - r = ds->get_datum(barck); - - if (!r) { - std::string msg = "ERROR: end of file while looking for }"; - ds->report_error("\n" + msg); - throw std::runtime_error(msg); - } - - if (barck != "}") { - std::string msg = "ERROR: found " + barck + "while looking for }"; - ds->report_error("\n" + msg); - throw std::runtime_error(msg); - } - - return true; - } - - private: - DATA *var_address; -}; diff --git a/include/loader/LoaderLink.h b/include/loader/LoaderLink.h deleted file mode 100644 index 863b15e..0000000 --- a/include/loader/LoaderLink.h +++ /dev/null @@ -1,84 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -#include "loader/DecodedStream.h" - -/** - * Meta info for the concept of deprecated in the Loadable system. - */ -struct LoaderDeprecatedMetaInfo { - bool isDeprecated{false}; - std::string supersededByTagName{}; - // std::string deprecatedInVersion; // keep this commented out until a final concept of versioning is implemented in - // AAESim -}; - -class LoaderLink { - public: - LoaderLink(void); - - virtual ~LoaderLink() = 0; - - bool load(DecodedStream *ds); - - virtual bool load_s(DecodedStream *ds) = 0; - - //----------------------------------------------------------- - - bool get_loaded_status() { return loaded; } - - //----------------------------------------------------------- - - bool is_a_must_load() { return must_load; } - - //----------------------------------------------------------- - - void set_must_load(bool b) { must_load = b; } - - //----------------------------------------------------------- - - bool was_loaded() { return loaded; } - - //----------------------------------------------------------- - - bool ok() { - if (!must_load) { - return true; - } else if (loaded) { - return true; - } else { - return false; - } - } - - void set_deprecated_info(const LoaderDeprecatedMetaInfo &info) { deprecatedInfo = info; } - - const LoaderDeprecatedMetaInfo &get_deprecated_info() const { return deprecatedInfo; } - - protected: - bool loaded; - bool must_load; // if true you must load one or more times - bool must_load_only_once; // if true you can only load it once or 0 times - bool is_a_list; // if set high the two above do not apply - LoaderDeprecatedMetaInfo deprecatedInfo; -}; diff --git a/include/loader/LoaderSupport.h b/include/loader/LoaderSupport.h deleted file mode 100644 index 9c14436..0000000 --- a/include/loader/LoaderSupport.h +++ /dev/null @@ -1,31 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -class LoaderSupport { - public: - LoaderSupport(void); - - virtual ~LoaderSupport(void); - - std::string clean_token(const std::string &token); -}; diff --git a/include/loader/Logging.h b/include/loader/Logging.h deleted file mode 100644 index e9c1de2..0000000 --- a/include/loader/Logging.h +++ /dev/null @@ -1,27 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#define LOG4CPLUS_STATIC // force static usage of log4cplus - -#include -#include - -void LoadLoggerProperties(); diff --git a/include/loader/LoggingLoadable.h b/include/loader/LoggingLoadable.h deleted file mode 100644 index a242c3b..0000000 --- a/include/loader/LoggingLoadable.h +++ /dev/null @@ -1,55 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// 2023 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -#include "loader/Loadable.h" -#include "loader/Logging.h" - -class LoggingLoadable : public Loadable { - public: - LoggingLoadable(); - - LoggingLoadable(const LoggingLoadable &in); - - virtual ~LoggingLoadable(); - - virtual void operator=(const LoggingLoadable &in); - - /** - * Call this after you finish registering things at it will load all the things it could and return false if it fails - * - * @return - * @see loaded_successfully() - */ - virtual bool complete() override; - - virtual void report_error(std::string error_message) override; - - virtual void report_warning(std::string warning_message) override; - - protected: - virtual bool test_load() override; - - private: - static log4cplus::Logger m_logger; -}; diff --git a/include/loader/MoreStringFunctions.h b/include/loader/MoreStringFunctions.h deleted file mode 100644 index 4a1e533..0000000 --- a/include/loader/MoreStringFunctions.h +++ /dev/null @@ -1,45 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -class MoreStringFunctions { - public: - MoreStringFunctions() {} - - virtual ~MoreStringFunctions() {} - - static std::string FindAndReplace(std::string data, const std::string &search, const std::string &replace) { - size_t pos = 0; - - while (true) { - pos = data.find(search, pos); - - if (pos == std::string::npos) { - break; - } - - data.replace(pos, search.length(), replace); - pos += replace.length(); - } - return data; - } -}; diff --git a/include/loader/NamedElementLoaderLink.h b/include/loader/NamedElementLoaderLink.h deleted file mode 100644 index 5d6f728..0000000 --- a/include/loader/NamedElementLoaderLink.h +++ /dev/null @@ -1,108 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -#include "loader/LoaderLink.h" - -template -class NamedElementLoaderLink : public LoaderLink { - public: - explicit NamedElementLoaderLink(std::vector *address) { - var_address = address; - must_load_only_once = false; - is_a_list = true; - } - - //------------------------------------------------- - - bool load_s(DecodedStream *ds) { - DATA temp; - std::string token; - bool f; - - // read off the { - - f = ds->get_datum(token); - - if (!f) { - std::string msg = "load attempt failed: no first token"; - ds->highlight_on(); - ds->report_error("\n" + msg + "\n"); - ds->highlight_off(); - throw std::runtime_error(msg); - } - - if (token.compare("{") != 0) { - std::string msg = "load attempt failed: first token not {"; - ds->highlight_on(); - ds->report_error("\n" + msg + "\n"); - ds->highlight_off(); - throw std::runtime_error(msg); - } - - // load the entry ---------------------------------------------- - - f = temp.load(ds); - - if (!f) { - std::string msg = "load attempt failed."; - ds->highlight_on(); - ds->report_error("\n" + msg + "\n"); - ds->highlight_off(); - throw std::runtime_error(msg); - } - - // add it to the list ---------------------------------------------- - - var_address->push_back(temp); - - // get the end of the entry ---------------------------------------------- - - f = ds->get_datum(token); - - if (!f) { - std::string msg = "load attempt failed: no last token"; - ds->highlight_on(); - ds->report_error("\n" + msg + "\n"); - ds->highlight_off(); - throw std::runtime_error(msg); - } - - // look for the } at the end of the list ---------------------------------------------- - - if (token.compare("}") == 0) { - return true; - } else { - std::string msg = "load attempt failed: last token not }"; - ds->highlight_on(); - ds->report_error("\n" + msg + "\n"); - ds->highlight_off(); - throw std::runtime_error(msg); - } - - return true; - } - - private: - std::vector *var_address; -}; diff --git a/include/loader/NativeLoaderLink.h b/include/loader/NativeLoaderLink.h deleted file mode 100644 index 760caea..0000000 --- a/include/loader/NativeLoaderLink.h +++ /dev/null @@ -1,44 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include "loader/DecodedStream.h" -#include "loader/LoaderLink.h" - -template -class NativeLoaderLink : public LoaderLink { - public: - explicit NativeLoaderLink(DATA *address) { var_address = address; } - - //------------------------------------------------- - - NativeLoaderLink(DATA *address, bool required, bool no_reset) { - var_address = address; - must_load = required; - must_load_only_once = no_reset; - } - - //------------------------------------------------- - - bool load_s(DecodedStream *ds) { return ds->get_datum(*var_address); } - - private: - DATA *var_address; -}; diff --git a/include/loader/NullLoader.h b/include/loader/NullLoader.h deleted file mode 100644 index 0f8ecdd..0000000 --- a/include/loader/NullLoader.h +++ /dev/null @@ -1,30 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include "loader/Loadable.h" - -class NullLoader final : public Loadable { - public: - NullLoader() = default; - bool load(DecodedStream *input) override; -}; - -inline bool NullLoader::load(DecodedStream *input) { return true; } diff --git a/include/loader/RunFileArchiveDirector.h b/include/loader/RunFileArchiveDirector.h deleted file mode 100644 index 717b55c..0000000 --- a/include/loader/RunFileArchiveDirector.h +++ /dev/null @@ -1,82 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include -#include - -#include "loader/FilePath.h" - -class RunFileArchiveDirector { - public: - RunFileArchiveDirector(void); - - ~RunFileArchiveDirector(void); - - inline void set_Destination_Directory(const FilePath &destination_file_path) { - destination = destination_file_path; - } //------------------------------------------------------------------------ - - inline std::string get_Destination() { return destination.GetFullPath(); } - - std::string get_Place_to_Write_Archive(const FilePath &source_file) { - if (destination.GetFullPath() == "") { - return ""; - } - std::string dest = get_New_Link_Name(source_file); - if (dest == "") { - return ""; - } else { - FilePath dest1 = destination.Push(FilePath(dest)); - return dest1.GetFullPath(); - } - } //------------------------------------------------------------------------ - - std::string get_New_Link_Name(const FilePath &source_file); // returns the file name that should be written into the - // archive copy of the file - - bool is_new_File(const FilePath &source_file) const; - - bool is_Name_in_Archive(const std::string &name) const { - std::map::const_iterator it; - for (it = mapper.begin(); it != mapper.end(); ++it) { - std::string value = (*it).second; - if (name == value) { - return true; - } - } - return false; - } // look for name in the value column of the map and return true if found - //------------------------------------------------------------------------ - - // mainly for debug purposes - void print_Map() { - std::map::iterator it; - for (it = mapper.begin(); it != mapper.end(); ++it) { - std::cout << (*it).first << " => " << (*it).second << std::endl; - } - } - //------------------------------------------------------------------------ - - private: - FilePath destination; - std::map mapper; -}; diff --git a/include/loader/SinglePushBackStream.h b/include/loader/SinglePushBackStream.h deleted file mode 100644 index 3633553..0000000 --- a/include/loader/SinglePushBackStream.h +++ /dev/null @@ -1,49 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -#include "loader/Token.h" - -template -class SinglePushBackStream : public PARENT { - public: - SinglePushBackStream(void) { pushed = false; } - - Token get_next() { - if (pushed) { - pushed = false; - } else { - old_token2 = PARENT::get_next(); - } - - return old_token2; - } - - void push_back() { pushed = true; } - - // bool set_html_output_file(const std::string &dump_file_name) { return PARENT::set_output_file(dump_file_name, 0); - // } - - private: - Token old_token2; - bool pushed; -}; diff --git a/include/loader/Token.h b/include/loader/Token.h deleted file mode 100644 index ceacb4e..0000000 --- a/include/loader/Token.h +++ /dev/null @@ -1,66 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include - -class Token { - public: - Token(void) {} //-------------------------------------------------------------- - - inline void add_Data(char c) { data += c; } //-------------------------------------------------------------- - inline void add_Data(const std::string &s) { - data += s; - } //-------------------------------------------------------------- - - inline void add_Format(char c) { format += c; } //-------------------------------------------------------------- - inline void add_Format(const std::string &s) { - format += s; - } //-------------------------------------------------------------- - inline void add_Format(const Token &t) { - add_Format(t.get_Format()); - add_Format(t.get_Data()); - } //-------------------------------------------------------------- - inline void merge_data_into_format() { - format += data; - data = ""; - } //-------------------------------------------------------------- - inline const std::string &get_Data() const { - return data; - } //-------------------------------------------------------------- - inline const std::string &get_Format() const { - return format; - } //-------------------------------------------------------------- - - inline std::string get_All() const { - return format + data; - } //-------------------------------------------------------------- - - inline void set_data(std::string const &nd) { - data = nd; - } //-------------------------------------------------------------- - inline void set_format(std::string const &nf) { - format = nf; - } //-------------------------------------------------------------- - - private: - std::string data; - std::string format; -}; diff --git a/include/loader/TokenStream.h b/include/loader/TokenStream.h deleted file mode 100644 index 4752382..0000000 --- a/include/loader/TokenStream.h +++ /dev/null @@ -1,130 +0,0 @@ -// **************************************************************************** -// NOTICE -// -// This work was produced for the U.S. Government under Contract 693KA8-22-C-00001 -// and is subject to Federal Aviation Administration Acquisition Management System -// Clause 3.5-13, Rights In Data-General, Alt. III and Alt. IV (Oct. 1996). -// -// The contents of this document reflect the views of the author and The MITRE -// Corporation and do not necessarily reflect the views of the Federal Aviation -// Administration (FAA) or the Department of Transportation (DOT). Neither the FAA -// nor the DOT makes any warranty or guarantee, expressed or implied, concerning -// the content or accuracy of these views. -// -// For further information, please contact The MITRE Corporation, Contracts Management -// Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. -// -// (c) 2026 The MITRE Corporation. All Rights Reserved. -// **************************************************************************** - -#pragma once - -#include -#include - -#include "assert.h" -#include "loader/IndentManagement.h" -#include "loader/Token.h" - -class TokenStream : public IndentManagement { - public: - TokenStream(void); // constructor - - virtual ~TokenStream() = 0; - - virtual bool set_output_file(const std::string &file_name, - int i) // function to open dump file specified - { - return true; - } //------------------------------------------------ - - virtual bool open_file(const std::string &file_name) { - file.open(file_name.c_str()); - return file.is_open(); - } //------------------------------------------------ - - virtual void highlight_on() {} //------------------------------------------------ - - virtual void highlight_off() {} //------------------------------------------------ - - bool open_Archive(const std::string &new_file_name, const std::string &header_comment) { - return true; - } //------------------------------------------------ - - virtual void close_dump_file() // function to close the dump file specified - {} //------------------------------------------------ - - Token get_next(); // get next token - virtual void close(); // close file - virtual void report_error(std::string message); // place error message in dump file - virtual void report_warning(std::string message); // place warning message in dump file - - // inline - virtual bool ok() // for testing/debugging - { - return !error; - } //------------------------------------------------ - - virtual void set_echo(bool new_echo) // set bool echo variable to print out to command line or not - { - echo = new_echo; - } //------------------------------------------------ - - virtual bool get_echo() // get the private variable echo to determine whether to print out to commane line or not - { - return echo; - } //------------------------------------------------ - - virtual Token get_Next_From_Parent() // this a do nothing function that - { - Token out; - return out; - } - - virtual inline char get_character() { - char out = ' '; - assert(false); - return out; - } //------------------------------------------------ - - TokenStream &operator=(const TokenStream &rhs) { - IndentManagement::operator=(rhs); - indents = rhs.indents; - i = rhs.i; - s = rhs.s; - comment_not_end = rhs.comment_not_end; - echo = rhs.echo; - error = rhs.error; - last_was_return = rhs.last_was_return; - return *this; - } - - protected: - std::ifstream file; // name of the input file - char get_char(); // get next character from the file - bool is_comment(char c); // check if the character is a ; - bool is_quote(char c); // check if the characater is a " - bool is_char(char c); // check if the character is a regular non delimiter - // Token skip_comment(); //dont return a comment to get next - Token get_quote(); // get the quoted text - - virtual void echo_out(std::string dump) // print the string- dump to cline and dump file - {} //------------------------------------------------ - - virtual void print_to_dumpfile(std::string dump) {} //------------------------------------------------ - - int indents; - - bool is_delimiter(char ch); // check to see if the character is one of the designated delimiters - bool comment_not_end; - bool echo; // true or false for printing out to command line - - private: - bool error; // for error checking - // bool borrowed_dump; //bool to ensure only original file deletes itself - // void print_to_dumpfile(string dump); //print the string to the dump file - // void print_to_cout(string dump); //print the string to the command line - std::string add_indent(char c); - - bool last_was_return; -}; diff --git a/unittest/src/AircraftDynamicsTestFramework/framework.cmake b/unittest/src/AircraftDynamicsTestFramework/framework.cmake index b0bf147..aef237f 100644 --- a/unittest/src/AircraftDynamicsTestFramework/framework.cmake +++ b/unittest/src/AircraftDynamicsTestFramework/framework.cmake @@ -17,7 +17,6 @@ target_link_libraries(fmacm_test target_include_directories(fmacm_test PRIVATE ${nlohmann_json_INCLUDE_DIR} - ${LOG4CPLUS_DIRS} ) set_target_properties(fmacm_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/unittest/bin @@ -27,4 +26,3 @@ add_custom_target(run_fmacm_test DEPENDS ${CMAKE_SOURCE_DIR}/unittest/bin/fmacm_test WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/unittest/ ) - diff --git a/unittest/src/Public/public.cmake b/unittest/src/Public/public.cmake index 54e0e97..6448a44 100644 --- a/unittest/src/Public/public.cmake +++ b/unittest/src/Public/public.cmake @@ -28,7 +28,6 @@ target_include_directories(public_test PUBLIC ${aaesim_INCLUDE_DIRS} ${minicsv_INCLUDE_DIR} ${nlohmann_json_INCLUDE_DIR} - ${LOG4CPLUS_DIRS} ${UNITTEST_DIR}/src ${geolib_idealab_INCLUDE_DIRS}) set_target_properties(public_test PROPERTIES From 25d197581edcdde367faca7f0a4b0c42a5208165 Mon Sep 17 00:00:00 2001 From: Stuart Bowman Date: Mon, 8 Jun 2026 15:53:25 -0400 Subject: [PATCH 6/7] chore: added a convenience Makefile --- .gitignore | 1 - Makefile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 2a15cf8..752912c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ latex/* cmake_install.cmake CMakeFiles CMakeCache.txt -Makefile */baseline/*.html *.so *.png diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0ba8911 --- /dev/null +++ b/Makefile @@ -0,0 +1,54 @@ +.PHONY: debug reldebug release clean help d rd r h +BUILD_BACKEND ?= Ninja +BUILD_BACKEND_CMD = $(shell echo $(BUILD_BACKEND) | tr '[:upper:]' '[:lower:]') +BUILD_PATH ?= build + +# Determine CMake generator based on availability of BUILD_BACKEND +ifneq ($(shell command -v $(BUILD_BACKEND_CMD) >/dev/null 2>&1 && echo yes),) +CMAKE_GENERATOR = -G $(BUILD_BACKEND) +else +CMAKE_GENERATOR = +endif + +debug: + @echo "Building in debug mode..." + cmake $(CMAKE_GENERATOR) -S . -B $(BUILD_PATH) -DCMAKE_COLOR_DIAGNOSTICS=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_CCACHE=YES + cmake --build $(BUILD_PATH) --target clean + cmake --build $(BUILD_PATH) --target FMACM -j + +reldebug: + @echo "Building in release with debug info mode..." + cmake $(CMAKE_GENERATOR) -S . -B $(BUILD_PATH) -DCMAKE_COLOR_DIAGNOSTICS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=YES + cmake --build $(BUILD_PATH) --target clean + cmake --build $(BUILD_PATH) --target FMACM -j + +release: + @echo "Building in release mode..." + cmake $(CMAKE_GENERATOR) -S . -B $(BUILD_PATH) -DCMAKE_COLOR_DIAGNOSTICS=ON -DCMAKE_BUILD_TYPE=Release -DUSE_CCACHE=YES + cmake --build $(BUILD_PATH) --target clean + cmake --build $(BUILD_PATH) --target FMACM -j + +nuke: + @echo "Removing build directory..." + rm -rf $(BUILD_PATH) + +tests: + @echo "Running unit tests..." + cmake $(CMAKE_GENERATOR) -S . -B $(BUILD_PATH) -DCMAKE_COLOR_DIAGNOSTICS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=YES + cmake --build $(BUILD_PATH) --target run_tests -j --clean-first + +help: + @echo "Type less; dev more:" + @echo " debug (d) : Build in debug mode" + @echo " reldebug (rd) : Build in release with debug info mode" + @echo " release (r) : Build in release mode" + @echo " nuke (n) : Delete the build directory" + @echo " tests (ut) : Run unit tests" + @echo " help (h) : Show this help message" + +d: debug +rd: reldebug +r: release +n: nuke +ut: tests +h: help From 9a13bbbaa76cbd76b444cfecb428003c02a7de4b Mon Sep 17 00:00:00 2001 From: Stuart Bowman Date: Mon, 8 Jun 2026 15:58:36 -0400 Subject: [PATCH 7/7] chore: now using fsloader 1.0.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdc83d7..1b6ea34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-unused-functi CPMAddPackage( NAME fsloader GIT_REPOSITORY https://github.com/mitre/fsloader.git - GIT_TAG 1.0rc1 + GIT_TAG 1.0.0 OPTIONS "FSLOADER_BUILD_EXAMPLE OFF" "BUILD_SHARED_LIBS FALSE"