TypeEnumeration

class dsviper.TypeEnumeration

Bases: Type

An enum type.

Note: Not directly instantiable.

cases() → list[TypeEnumerationCase]

Return the list of cases.

static cast(type: Type) → TypeEnumeration

Return a type enum or raise.

check(name: str) → TypeEnumerationCase

Return the case called name, or raise if the enum has none.

description(*, namespace: NameSpace | None = None) → str

Return the enum spelled out: its cases, then its name.

Each case appears as .name, in braces. namespace qualifies the name; representation() answers that name alone.

documentation() → str

Return the documentation the enum was created with, empty when none was given.

query(name: str) → TypeEnumerationCase | None

Return the case called name, or None if the enum has none.

representation(*, namespace: NameSpace | None = None) → str

Return the name the type was declared under, qualified against namespace - the global namespace when it is None.

runtime_id() → ValueUUId

Return the uuid identifying this type.

It is computed from what the type is, so the same declaration yields the same id in any Definitions. Definitions says what each kind is computed from.

type_code() → str

Return the code naming this kind of type, such as “int32”, “struct” or “vector”.

type_name() → TypeName

Return the TypeName: the namespace and the name the type was declared under.