From bddfef82b6377fc17a1e51d4206e68e91912c26e Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Mon, 10 Jun 2024 18:01:14 -0700 Subject: [PATCH] Update BMI C++ header to match upstream with virtual dtor and correct namespace --- bmi/bmi.hxx | 9 ++++++--- include/bmi_soil_freeze_thaw.hxx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bmi/bmi.hxx b/bmi/bmi.hxx index 87b290b..4378a61 100644 --- a/bmi/bmi.hxx +++ b/bmi/bmi.hxx @@ -6,13 +6,14 @@ #ifndef BMI_HXX #define BMI_HXX + #include #include -namespace bmixx { +namespace bmi { - //const int BMI_SUCCESS = 0; - // const int BMI_FAILURE = 1; + const int BMI_SUCCESS = 0; + const int BMI_FAILURE = 1; const int MAX_COMPONENT_NAME = 2048; const int MAX_VAR_NAME = 2048; @@ -21,6 +22,8 @@ namespace bmixx { class Bmi { public: + virtual ~Bmi() { } + // Model control functions. virtual void Initialize(std::string config_file) = 0; virtual void Update() = 0; diff --git a/include/bmi_soil_freeze_thaw.hxx b/include/bmi_soil_freeze_thaw.hxx index 50704c3..283ea1a 100644 --- a/include/bmi_soil_freeze_thaw.hxx +++ b/include/bmi_soil_freeze_thaw.hxx @@ -14,7 +14,7 @@ class NotImplemented : public std::logic_error { }; -class BmiSoilFreezeThaw : public bmixx::Bmi { +class BmiSoilFreezeThaw : public bmi::Bmi { public: BmiSoilFreezeThaw() { this->input_var_names[0] = "ground_temperature";