Created
March 22, 2025 11:05
-
-
Save trikitrok/2ae1bca2d70fb42bb1cd62dc51527965 to your computer and use it in GitHub Desktop.
Used to illustrate Effect Sketches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class CppClass { | |
private readonly name: string; | |
private readonly declarations: Declaration[]; | |
constructor(name: string, declarations: Declaration[]) { | |
this.name = name; | |
this.declarations = declarations; | |
} | |
public getDeclarationCount(): number { | |
return this.declarations.length; | |
} | |
public getName(): string { | |
return this.name; | |
} | |
public getDeclaration(index: number): Declaration { | |
return this.declarations[index]; | |
} | |
public getInterface(interfaceName: string, indices: number[]): string { | |
let result = "class " + interfaceName + " {\n public:\n"; | |
for (const index of indices) { | |
const virtualFunction = this.declarations[index]; | |
result += "\t" + virtualFunction.asAbstract() + "\n"; | |
} | |
result += "};\n"; | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment