15 #pragma warning(disable : 4267)
18 #pragma GCC diagnostic push
19 #pragma GCC diagnostic ignored "-Wunused-value"
22 #define TYPE_TEMPLATE(x) \
35 x<unsigned short int>(); \
39 x<unsigned long int>(); \
41 x<unsigned long long int>();
43 #define SETFILL_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
44 .def(funcnamestr, &classname ::funcname<T>)
46 #define VARCREATE_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
48 (Variable(classname::*)(const std::string&, const std::vector<Dimensions_t>&, \
49 const std::vector<Dimensions_t>&, const VariableCreationParameters&)) & \
50 classname ::funcname<T>, \
51 "Create a variable", py::arg("name"), py::arg("dimensions") = std::vector<Dimensions_t>{1}, \
52 py::arg("max_dimensions") = std::vector<Dimensions_t>{}, \
53 py::arg("params") = VariableCreationParameters())
55 #define VARCREATESCALES_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
57 (Variable(classname::*)(const std::string&, const std::vector<Variable>&, \
58 const VariableCreationParameters&)) & \
59 classname ::funcname<T>, \
60 "Create a variable", py::arg("name"), py::arg("dimension_scales"), \
61 py::arg("params") = VariableCreationParameters())
63 #define ISA_ATT_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
64 .def(funcnamestr, &classname ::funcname<T>, "Is " #T " the storage type of the data?")
66 #define READ_ATT_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
67 .def(funcnamestr, &classname ::funcname<T>, "Read as type " #T)
69 #define WRITE_ATT_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
70 .def(funcnamestr, &classname ::funcname<T>, "Write as type " #T)
72 #define READ_VAR_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
73 .def(funcnamestr, &classname ::funcname<T>, "Read as type " #T, py::arg("mem_selection") = Selection::all, \
74 py::arg("file_selection") = Selection::all)
76 #define WRITE_VAR_CLASS_TEMPLATE_FUNCTION_T(funcnamestr, funcname, classname, T) \
77 .def(funcnamestr, &classname ::funcname<T>, "Write as type " #T, py::arg("vals"), \
78 py::arg("mem_selection") = Selection::all, py::arg("file_selection") = Selection::all)
80 #define CLASS_TEMPLATE_FUNCTION_PATTERN_NOALIASES(actualname, classname, PATTERN) \
81 PATTERN("float", actualname, classname, float) \
82 PATTERN("double", actualname, classname, double) \
83 PATTERN("long_double", actualname, classname, long double) \
84 PATTERN("int32", actualname, classname, int32_t) \
85 PATTERN("uint32", actualname, classname, uint32_t) \
86 PATTERN("int16", actualname, classname, int16_t) \
87 PATTERN("uint16", actualname, classname, uint16_t) \
88 PATTERN("int64", actualname, classname, int64_t) \
89 PATTERN("uint64", actualname, classname, uint64_t)
95 #define CLASS_TEMPLATE_FUNCTION_PATTERN_NOSTR(actualname, classname, PATTERN) \
96 CLASS_TEMPLATE_FUNCTION_PATTERN_NOALIASES(actualname, classname, PATTERN) \
97 PATTERN("short", actualname, classname, short int) \
98 PATTERN("ushort", actualname, classname, unsigned short int) \
99 PATTERN("int", actualname, classname, int) \
100 PATTERN("uint", actualname, classname, unsigned int) \
101 PATTERN("lint", actualname, classname, long int) \
102 PATTERN("ulint", actualname, classname, unsigned long int) \
103 PATTERN("llint", actualname, classname, long long int) \
104 PATTERN("ullint", actualname, classname, unsigned long long int)
106 #define CLASS_TEMPLATE_FUNCTION_PATTERN(actualname, classname, PATTERN) \
107 PATTERN("str", actualname, classname, std::string) \
108 PATTERN("char", actualname, classname, char) \
109 CLASS_TEMPLATE_FUNCTION_PATTERN_NOSTR(actualname, classname, PATTERN)