MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / typeMayAlias

Method typeMayAlias

scripts/cgenerator.py:426–443  ·  view source on GitHub ↗
(self, typeName)

Source from the content-addressed store, hash-verified

424 return (protect_if_str, protect_end_str)
425
426 def typeMayAlias(self, typeName):
427 if not self.may_alias:
428 if self.registry is None:
429 raise MissingRegistryError()
430 # First time we have asked if a type may alias.
431 # So, populate the set of all names of types that may.
432
433 # Everyone with an explicit mayalias="true"
434 self.may_alias = set(typeName
435 for typeName, data in self.registry.typedict.items()
436 if data.elem.get('mayalias') == 'true')
437
438 # Every type mentioned in some other type's parentstruct attribute.
439 polymorphic_bases = (otherType.elem.get('parentstruct')
440 for otherType in self.registry.typedict.values())
441 self.may_alias.update(set(x for x in polymorphic_bases
442 if x is not None))
443 return typeName in self.may_alias
444
445 def genStruct(self, typeinfo, typeName, alias):
446 """Generate struct (e.g. C "struct" type).

Callers 1

genStructMethod · 0.95

Calls 4

itemsMethod · 0.80
valuesMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected