8 def __init__(self, name, cardinality, min_value=None, max_value=None, ifdefs=[]):
9 dastgen2.attributes.IntegerArray.__init__(
10 self, name, cardinality, min_value, max_value, ifdefs=ifdefs
14 def get_methods(self, _full_qualified_class_name, for_declaration=True):
18 "get" + accessor_name +
"() const",
24 +
"(const tarch::la::Vector<"
29 (
"get" + accessor_name +
"(int index) const",
"int"),
30 (
"set" + accessor_name +
"(int index, int value)",
"void"),
39 "[[clang::pack_range("
44 [
"defined(" + LLVMSymbol +
")"],
50 [
"!defined(" + LLVMSymbol +
")"],
59 return [(
"_" + self.
_name_name +
".data()[0]",
"int")]
73 if signature.startswith(
"get")
and "index" in signature
and not self.
compress:
74 return " return " + name +
"(index);\n"
75 elif signature.startswith(
"set")
and "index" in signature
and not self.
compress:
76 return name +
"(index) = value;\n"
77 elif signature.startswith(
"get")
and "index" in signature
and not self.
compress:
78 return " return " + name +
"(index);\n"
79 elif signature.startswith(
"set")
and "index" in signature
and not self.
compress:
80 return name +
"(index) = value;\n"
81 elif signature.startswith(
"get")
and not self.
compress:
82 return " return " + name +
";\n"
83 elif signature.startswith(
"set")
and not self.
compress:
84 return name +
" = value;\n"
86 elif signature.startswith(
"get")
and "index" in signature:
87 return " return " + name +
"[index];\n"
88 elif signature.startswith(
"set")
and "index" in signature:
89 return name +
"[index] = value;\n"
90 elif signature.startswith(
"get"):
106 elif signature.startswith(
"set"):
119 assert False,
"signature=" + signature
129 Return string representation of attribute.
get_constructor_arguments(self)
Return list of tuple of arguments for the constructor.
get_to_string(self)
Return string representation of attribute.
get_native_MPI_type(self)
Return native (built-in) MPI datatype.
get_plain_C_attributes(self, for_constructor=False)
Return list of n-tuples.
get_methods(self, _full_qualified_class_name, for_declaration=True)
Return sequence of methods that are defined for this attribute.
use_default_copy_constructor(self)
Cannot use the default copy constructor, as it is an array, i.e.
get_method_body(self, signature)
I hand in the method signature (see get_methods()) and wanna get the whole implementation.
get_first_plain_C_attribute(self)
For MPI for example, I need to know the first attribute.
__init__(self, name, cardinality, min_value=None, max_value=None, ifdefs=[])
min_value: None or integer value Has to be smaller than max_value.