MCPcopy Index your code
hub / github.com/KhronosGroup/Vulkan-Docs / genEnum

Method genEnum

scripts/scriptgenerator.py:344–368  ·  view source on GitHub ↗

Generate enumerant (compile time constant). - Add the constant name to the 'consts' dictionary, with the value being None to indicate that the constant is not an enumeration value.

(self, enuminfo, name, alias)

Source from the content-addressed store, hash-verified

342 self.enums[groupName] = sorted(enumerants)
343
344 def genEnum(self, enuminfo, name, alias):
345 """Generate enumerant (compile time constant).
346
347 - Add the constant name to the 'consts' dictionary, with the
348 value being None to indicate that the constant is not
349 an enumeration value."""
350 OutputGenerator.genEnum(self, enuminfo, name, alias)
351
352 if name not in self.consts:
353 # Add a typeCategory{} entry for the category of this type.
354 self.addName(self.typeCategory, name, 'consts')
355 self.consts[name] = None
356
357 if alias:
358 # Add name -> alias mapping
359 self.addName(self.alias, name, alias)
360 else:
361 # May want to only emit definition on this branch
362 True
363
364 # Otherwise, do not add it to the consts dictionary because it is
365 # already present. This happens due to the generator 'reparentEnums'
366 # parameter being False, so each extension enum appears in both the
367 # <enums> type and in the <extension> or <feature> it originally
368 # came from.
369
370 def genCmd(self, cmdinfo, name, alias):
371 """Generate command.

Callers

nothing calls this directly

Calls 1

addNameMethod · 0.95

Tested by

no test coverage detected