3from .Attribute
import Attribute
11 Such a pointer is not initialised by default, i.e. how to handle the
12 underlying data structure is totally up to the user. This data type
13 also does not support any MPI data exchange.
20 qualifier=Attribute.Qualifier.NONE,
28 expose = qualifier == Attribute.Qualifier.CONSTEXPR
36 expose_in_header_file=expose,
42 def get_methods(self, _full_qualified_class_name, for_declaration=True):
49 getter = (
"get" + accessor_name +
"()",
"static double*")
52 getter = (
"get" + accessor_name +
"()",
"double*")
57 getter = (
"get" + accessor_name +
"()",
"static double*")
61 getter = (
"get" + accessor_name +
"()",
"double*")
64 getter = (
"get" + accessor_name +
"() const",
"const double*")
68 getter = (
"get" + accessor_name +
"() const",
"double*")
70 methods.append(getter)
74 methods.append((
"set" + accessor_name +
"(double* value)",
"void"))
79 typestring =
"double*"
80 namestring =
"_" + self.
_name
84 typestring =
"inline static double*"
86 namestring +=
" = " + str(self.
_initval)
89 typestring =
"inline const static double*"
90 namestring +=
" = " + str(self.
_initval)
93 typestring =
"const double*"
94 namestring +=
" = " + str(self.
_initval)
101 if self.
_initval is not None and not for_constructor:
102 namestring +=
" = " + str(self.
_initval)
105 return [(namestring, typestring,
"")]
109 return " return _dataStore._" + self.
_name +
";\n"
111 return " return _" + self.
_name +
";\n"
113 return " _dataStore._" + self.
_name +
" = value;\n"
115 return " _" + self.
_name +
" = value;\n"
121 return [(
"MPI_DOUBLE /* <double pointer should not be used for MPI data exchange> */", 1)]
126 Return string representation of attribute.
130 return "_dataStore._" + self.
_name
132 return "_" + self.
_name
Represents one attribute.
get_accessor_name(self)
Generate the accessor name used throughout dastgen2 to create variables, function names,...
get_methods(self, _full_qualified_class_name, for_declaration=True)
Return sequence of methods that are defined for this attribute.
get_to_string(self)
Return string representation of attribute.
get_method_body(self, signature)
I hand in the method signature (see get_methods()) and wanna get the whole implementation.
__init__(self, name, ifdefs=[], qualifier=Attribute.Qualifier.NONE)
name: String This is a plain string which has to follow the C++ naming conventions,...
get_plain_C_attributes(self, for_constructor=False)
Return list of n-tuples.
get_native_MPI_type(self)
Return native (built-in) MPI datatype.