|
Enzo
|
A compiled daslang program ready to run. More...
#include <Runtime.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| bool | evalFloat (const String &functionName, const expr::ExpressionContext *context, floatT &result, String &error) |
| Evaluates an exported function as a float. | |
| bool | evalInt (const String &functionName, const expr::ExpressionContext *context, intT &result, String &error) |
| Evaluates an exported function as an integer. | |
| bool | evalString (const String &functionName, const expr::ExpressionContext *context, String &result, String &error) |
| Evaluates an exported function as a string. | |
| bool | run (const String &functionName, std::span< const ScriptArgument > arguments, const script::ScriptContext *context, size_t primitiveIndex, String &error) |
| Runs an exported function for its side effects. | |
| std::vector< bool > | getWrittenArguments (const String &functionName) const |
| Returns whether the function writes each of its arguments, in argument order. | |
| std::vector< String > | takeWarnings () |
| Returns the warnings the runs added and clears them. | |
| std::shared_ptr< CompiledProgram > | clone () const |
| Returns a copy that shares the compiled program and runs in its own context. | |
Friends | |
| class | Runtime |
A compiled daslang program ready to run.
Reused across many evaluations so the cost of compiling is paid once. Each eval helper runs an exported function by name and returns its result.
Example
| std::shared_ptr< CompiledProgram > enzo::daslang::CompiledProgram::clone | ( | ) | const |
Returns a copy that shares the compiled program and runs in its own context.
| bool enzo::daslang::CompiledProgram::evalFloat | ( | const String & | functionName, |
| const expr::ExpressionContext * | context, | ||
| floatT & | result, | ||
| String & | error ) |
Evaluates an exported function as a float.
| bool enzo::daslang::CompiledProgram::evalInt | ( | const String & | functionName, |
| const expr::ExpressionContext * | context, | ||
| intT & | result, | ||
| String & | error ) |
Evaluates an exported function as an integer.
| bool enzo::daslang::CompiledProgram::evalString | ( | const String & | functionName, |
| const expr::ExpressionContext * | context, | ||
| String & | result, | ||
| String & | error ) |
Evaluates an exported function as a string.
| std::vector< bool > enzo::daslang::CompiledProgram::getWrittenArguments | ( | const String & | functionName | ) | const |
Returns whether the function writes each of its arguments, in argument order.
| bool enzo::daslang::CompiledProgram::run | ( | const String & | functionName, |
| std::span< const ScriptArgument > | arguments, | ||
| const script::ScriptContext * | context, | ||
| size_t | primitiveIndex, | ||
| String & | error ) |
Runs an exported function for its side effects.
| primitiveIndex | The input primitive the function's attribute reads go to. |