From 9e89efabc6e67a86341ea54cd3eb87c6134a88e8 Mon Sep 17 00:00:00 2001 From: kevstone Date: Mon, 19 Feb 2024 20:33:39 +0000 Subject: [PATCH] More level 2 conversion fixes --- .../grib_accessor_conversion_validation.py | 8 ++++++++ .../grib_accessor_type_info.py | 1 + 2 files changed, 9 insertions(+) diff --git a/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_conversion_validation.py b/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_conversion_validation.py index b46b16fe0..eda5879a1 100755 --- a/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_conversion_validation.py +++ b/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_conversion_validation.py @@ -266,3 +266,11 @@ class GribAccessorConversionValidation(default_conversion_validation.DefaultConv return updated_cppmacro_instantiation return super().validate_macro_instantiation(cmacro_instantiation, cppmacro_instantiation) + + def is_cppfunction_returning_container(self, cppfunc_object): + if "initData" in cppfunc_object.as_string(): + debug.line("is_cppfunction_returning_container", f"Assuming initData returns the correct container: cppfunc_object=[{debug.as_debug_string(cppfunc_object)}]") + return True + + return super().is_cppfunction_returning_container(cppfunc_object) + diff --git a/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_type_info.py b/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_type_info.py index c64175f7b..3a9189bdd 100755 --- a/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_type_info.py +++ b/src/clang_convert/grib_accessor/grib_accessor_conversion_pack/grib_accessor_type_info.py @@ -11,5 +11,6 @@ class GribAccessorTypeInfo(default_type_info.DefaultTypeInfo): def cpp_container_types(self): return super().cpp_container_types() + [ + "AccessorName", "AccessorDataBuffer", ]