@@ -61,7 +61,7 @@ def make_type_string(self, type):
6161 is_nested_list = isinstance (type .type , nodes .AggregationType )
6262 tmpl = templates .list_list_type if is_nested_list else templates .list_type if is_list else templates .array_type
6363 return tmpl % {
64- 'instance_type' : self .make_type_string (type .type ),
64+ 'instance_type' : self .make_type_string (self . flatten_type_string ( type .type ) ),
6565 'lower' : type .bounds .lower ,
6666 'upper' : type .bounds .upper ,
6767 }
@@ -77,7 +77,7 @@ def is_array(self, type):
7777 def make_argument_entity (self , attr ):
7878 type = attr .type if hasattr (attr , 'type' ) else attr
7979 while isinstance (type , nodes .AggregationType ): type = type .type
80- if type in self .express_to_cpp_typemapping or isinstance ( type , nodes . BinaryType ) : return "Type::UNDEFINED"
80+ if type in self .express_to_cpp_typemapping : return "Type::UNDEFINED"
8181 else : return "Type::%s" % type
8282
8383 def make_argument_type (self , attr ):
@@ -88,8 +88,6 @@ def _make_argument_type(type):
8888 return "ENTITY_INSTANCE"
8989 elif self .schema .is_type (type ):
9090 return _make_argument_type (self .schema .types [type ].type .type )
91- elif isinstance (type , nodes .BinaryType ):
92- return "BINARY"
9391 elif isinstance (type , nodes .EnumerationType ):
9492 return "ENUMERATION"
9593 elif isinstance (type , nodes .AggregationType ):
@@ -154,23 +152,28 @@ def derived_in_supertype(self, t):
154152 return c + ([str (s ) for s in t .derive .elements ] if t .derive else [])
155153
156154 def list_instance_type (self , attr ):
155+ attr_type = attr .type if isinstance (attr , nodes .ExplicitAttribute ) else attr
156+ if isinstance (attr_type , str ): return None
157157 f = lambda v : 'IfcUtil::IfcBaseClass' if self .schema .is_select (v ) else str (v )
158- if self .is_array (attr . type ):
159- if not isinstance (attr . type , str ) and self .is_array (attr . type .type ):
160- if isinstance (attr . type .type , str ):
161- return f (attr . type .type )
162- else : return f (attr . type .type .type )
158+ if self .is_array (attr_type ):
159+ if not isinstance (attr_type , str ) and self .is_array (attr_type .type ):
160+ if isinstance (attr_type .type , str ):
161+ return f (attr_type .type )
162+ else : return f (attr_type .type .type )
163163 else :
164- if isinstance (attr . type , str ):
165- return f (attr . type )
166- else : return f (attr . type .type )
164+ if isinstance (attr_type , str ):
165+ return f (attr_type )
166+ else : return f (attr_type .type )
167167 return None
168168
169169 def is_templated_list (self , attr ):
170+ attr_type = attr .type if isinstance (attr , nodes .ExplicitAttribute ) else attr
171+ if isinstance (attr , str ): return False
170172 ty = self .list_instance_type (attr )
171- arr = self .is_array (attr .type )
173+ if ty is None : return False
174+ arr = self .is_array (attr_type )
172175 simple = self .schema .is_simpletype (ty )
173- express = ty in self .express_to_cpp_typemapping
176+ express = self . flatten_type_string ( ty ) in self .express_to_cpp_typemapping
174177 select = ty == 'IfcUtil::IfcBaseClass'
175178 return arr and not simple and not express and not select
176179
0 commit comments