slang::StructBuilder class

A helper class for constructing struct types programmatically.

Public functions

void addField(string_view name, const Type& fieldType, bitmask<VariableFlags> flags = VariableFlags::None)
Adds a field to the struct.
void addField(string_view name, const DeclaredType& typeLink, bitmask<VariableFlags> flags = VariableFlags::None)
Adds a field to the struct, linking its type to the given declared type.

Public variables

Compilation& compilation
The compilation used to construct symbols.
UnpackedStructType& type
The struct type being constructed.