slang::ast::ClassBuilder class

A helper class for constructing class types programmatically.

Public functions

auto addMethod(std::string_view name, const Type& returnType, SubroutineKind kind = SubroutineKind::Function) -> MethodBuilder
Adds a method to the class with the given properties.

Public variables

Compilation& compilation
The compilation used to construct symbols.
ClassType& type
The class type being constructed.

Function documentation

MethodBuilder slang::ast::ClassBuilder::addMethod(std::string_view name, const Type& returnType, SubroutineKind kind = SubroutineKind::Function)

Adds a method to the class with the given properties.

The returned builder object can be used to modify the method further.