From ed40481d8fa138ec29e6fb8c6be5a27a6acc0770 Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Mon, 10 Jun 2024 17:58:48 -0700 Subject: [PATCH] Update BMI C++ header to match upstream with virtual dtor and correct namespace --- bmi/bmi.hxx | 9 ++++++--- include/bmi_soil_moisture_profile.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_moisture_profile.hxx b/include/bmi_soil_moisture_profile.hxx index 02e6976..1433aa7 100644 --- a/include/bmi_soil_moisture_profile.hxx +++ b/include/bmi_soil_moisture_profile.hxx @@ -16,7 +16,7 @@ namespace coupler { } -class BmiSoilMoistureProfile : public bmixx::Bmi { +class BmiSoilMoistureProfile : public bmi::Bmi { public: BmiSoilMoistureProfile() { this->input_var_names[0] = "soil_storage";