mirror of https://github.com/ecmwf/eccodes.git
Added accessor-specific conversion classes from previous (regex) converter
This commit is contained in:
parent
06b7d183f1
commit
81db7afeec
|
@ -7,7 +7,7 @@ grib_accessor_class_double.cc
|
|||
grib_accessor_class_long.cc
|
||||
grib_accessor_class_proj_string.cc
|
||||
grib_accessor_class_blob.cc
|
||||
# [SLOW FAILS] grib_accessor_class_bufr_data_array.cc
|
||||
# [SLOW] grib_accessor_class_bufr_data_array.cc
|
||||
grib_accessor_class_bufr_data_element.cc
|
||||
grib_accessor_class_bufr_elements_table.cc
|
||||
grib_accessor_class_bufr_extract_area_subsets.cc
|
||||
|
|
|
@ -15,6 +15,10 @@ class TemplateConversionPackUpdates(base_conversion_pack_updates.BaseConversionP
|
|||
"pack_long": self.apply_updates_for_pack_long
|
||||
})
|
||||
|
||||
self._include_files.extend([
|
||||
"<float.h>",
|
||||
])
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class ApplyBitmapConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class ApplyBoustrophedonicConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
|
@ -9,6 +9,7 @@ class BaseConversionPackUpdates:
|
|||
self._update_funcs = {}
|
||||
self._funcsig_mappings = []
|
||||
self._all_function_arg_mappings = {}
|
||||
self._include_files = []
|
||||
|
||||
def add_funcsig_mappings_to_conversion_data(self, conversion_data):
|
||||
for mapping in self._funcsig_mappings:
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class BufrDataArrayConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# static int check_overridden_reference_values(const grib_context* c, long* refValList, size_t refValListSize, int numBits)
|
||||
FuncSigMapping(FuncSig("int", "check_overridden_reference_values", [Arg("const grib_context*", "c"), Arg("long*", "refValList"), Arg("size_t", "refValListSize"), Arg("int", "numBits")]),
|
||||
FuncSig("GribStatus", "checkOverriddenReferenceValues", [NONE_VALUE, Arg("std::vector<long>", "refValList"), NONE_VALUE, Arg("int", "numBits")]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
# static grib_accessor* create_attribute_variable(const char* name, grib_section* section, int type, char* sval, double dval, long lval, unsigned long flags)
|
||||
FuncSigMapping(FuncSig("grib_accessor*", "create_attribute_variable", [Arg("const char*", "name"), Arg("grib_section*", "section"), Arg("int", "type"), Arg("char*", "sval"), Arg("double", "dval"), Arg("long", "lval"), Arg("unsigned long", "flags")]),
|
||||
FuncSig("AccessorName", "createAttributeVariable", [Arg("std::string&", "name"), NONE_VALUE, Arg("GribType", "type"), Arg("std::string&", "sval"), Arg("double", "dval"), Arg("long", "lval"), Arg("unsigned long", "flags")])),
|
||||
])
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("const char*","dataKeysName") : Arg("AccessorName","dataKeysName"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class ChangeScanningDirectionConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("const char*","axis") : Arg("std::string","axis"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class CheckInternalVersionConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("const char*","s_defn_version") : Arg("AccessorName","sDefnVersion"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class ClosestDateConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._include_files.extend([
|
||||
"<float.h>",
|
||||
])
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class CodeflagConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("const char*","tablename") : Arg("std::string","tablename"),
|
||||
})
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class CodetableConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
#FuncSigMapping(FuncSig("int", "str_eq", [Arg("const char*", "a"), Arg("const char*", "b")]),
|
||||
# FuncSig("void", "strEq", [NONE_VALUE, NONE_VALUE])),
|
||||
])
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class CountMissingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","p") : Arg("AccessorDataPointer","p"),
|
||||
})
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataCcsdsPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataComplexPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._update_funcs.update({
|
||||
"unpack_helper" : self.apply_updates_for_unpack_helper,
|
||||
"pack_double" : self.apply_updates_for_pack_double,
|
||||
})
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
FuncSigMapping(FuncSig("double", "calculate_pfactor", [Arg("const grib_context*", "a"), Arg("const double*", "spectralField"), Arg("long", "fieldTruncation"), Arg("long", "subsetTruncation")]),
|
||||
FuncSig("double", "calculatePfactor", [NONE_VALUE, Arg("std::vector<double>", "spectralField"), Arg("long", "fieldTruncation"), Arg("long", "subsetTruncation")])),
|
||||
])
|
||||
|
||||
def apply_updates_for_unpack_helper(self, conversion_pack):
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("unsigned char*","buf"), Arg("AccessorDataPointer","buf"))
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("unsigned char*","hres"), Arg("AccessorDataPointer","hres"))
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("unsigned char*","lres"), Arg("AccessorDataPointer","lres"))
|
||||
#conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("unsigned char*","scals"), Arg("AccessorDataBuffer","scals"))
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("T*","pscals"), Arg("T","pscals"))
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("T*","pval"), Arg("T","pval"))
|
||||
|
||||
def apply_updates_for_pack_double(self, conversion_pack):
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("unsigned char*","buf"), Arg("AccessorDataBuffer","buf"))
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("unsigned char*","hres"), Arg("AccessorDataPointer","hres"))
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("unsigned char*","lres"), Arg("AccessorDataPointer","lres"))
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataG1secondOrderConstantWidthPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataG1secondOrderGeneralExtendedPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("double*", "dvalues"), Arg("float*", "fvalues"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<double>&", "vecdValues"), Arg("std::vector<float>&", "vecfValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=3, cpp_container=1)),
|
||||
])
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataG1secondOrderGeneralPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._update_funcs.update({
|
||||
"unpack_helper": self.apply_updates_for_unpack_helper
|
||||
})
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "values"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
||||
|
||||
def apply_updates_for_unpack_helper(self, conversion_pack):
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("long*","p"), Arg("auto","p"))
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataG1secondOrderRowByRowPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "values"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataG22orderPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("const size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("const std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataRawPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataRunLengthPackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataShPackedConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataShUnpackedConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class DataSimplePackingConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._update_funcs.update({
|
||||
"number_of_bits": self.apply_updates_for_number_of_bits
|
||||
})
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
||||
|
||||
def apply_updates_for_number_of_bits(self, conversion_pack):
|
||||
conversion_pack.conversion_data.add_funcbody_arg_mapping(Arg("const unsigned long*","n"), Arg("UnsignedLongVectorConstIterator","n"))
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class G1HalfByteCodeflagConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","dat") : Arg("AccessorDataPointer","dat"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class G1bitmapConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataPointer","buf"),
|
||||
})
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class IbmfloatConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class IeeefloatConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
# template<typename T> static int unpack_helper(grib_accessor* a, T* val, size_t* len)
|
||||
FuncSigMapping(FuncSig("int", "unpack_helper", [Arg("grib_accessor*", "a"), Arg("T*", "val"), Arg("size_t*", "len")]),
|
||||
FuncSig("GribStatus", "unpackHelper", [NONE_VALUE, Arg("std::vector<T>&", "vecTValues"), NONE_VALUE]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class Md5ConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","mess") : Arg("AccessorDataPointer","mess"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class MessageCopyConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","v") : Arg("AccessorDataPointer","v"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class Uint64ConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","data") : Arg("AccessorDataPointer","data"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class Uint64LittleEndianConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","data") : Arg("AccessorDataPointer","data"),
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class Uint8ConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","data") : Arg("AccessorDataPointer","data"),
|
||||
})
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
import utils.debug as debug
|
||||
import grib_accessor.grib_accessor_conversion_pack.conversion_pack_updates.base_conversion_pack_updates as base_conversion_pack_updates
|
||||
from code_object.arg import Arg
|
||||
from code_object_converter.conversion_pack.funcsig_mapping import FuncSigMapping
|
||||
from code_object_converter.conversion_pack.arg_indexes import ArgIndexes
|
||||
from code_object.funcsig import FuncSig
|
||||
from code_object.code_interface import NONE_VALUE
|
||||
|
||||
class UnsignedConversionPackUpdates(base_conversion_pack_updates.BaseConversionPackUpdates):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._funcsig_mappings.extend([
|
||||
FuncSigMapping(FuncSig("int", "pack_long_unsigned_helper", [Arg("grib_accessor*", "a"), Arg("const long*", "val"), Arg("size_t*", "len"), Arg("int", "check")]),
|
||||
FuncSig("GribStatus", "packLongUnsignedHelper", [NONE_VALUE, Arg("std::vector<long> const&", "longValues"), NONE_VALUE, Arg("int", "check")]),
|
||||
ArgIndexes(cbuffer=1, clength=2, cpp_container=1)),
|
||||
])
|
||||
|
||||
self._all_function_arg_mappings.update({
|
||||
Arg("unsigned char*","buf") : Arg("AccessorDataBuffer","buf"),
|
||||
# This may need to be a data member...
|
||||
Arg("grib_arguments*","arg") : Arg("AccessorInitData","arg"),
|
||||
})
|
|
@ -8,4 +8,3 @@ class MessageCopyDataAccessorSpecific(AccessorSpecific):
|
|||
self._custom_arg_transforms["ALL"] = {
|
||||
arg.Arg("unsigned char*","v") : arg.Arg("AccessorDataPointer","v"),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue