Enzo
Loading...
Searching...
No Matches
enzo::expr::ScriptEngine Class Reference

Compiler for the per point scripts a script node runs. More...

#include <ScriptEngine.h>

Public Member Functions

std::shared_ptr< const PointScriptcompile (const String &code, String &error)
 Returns the compiled script for the user's code.
 
 ScriptEngine (const ScriptEngine &)=delete
 
ScriptEngineoperator= (const ScriptEngine &)=delete
 

Static Public Member Functions

static ScriptEngineinstance ()
 

Detailed Description

Compiler for the per point scripts a script node runs.

String error;
auto script = ScriptEngine::instance().compile("@height = pt", error)->clone();
script->addWrittenAttributes(output, error);
script->run(input, output, 0, input.getNumPoints(), &context, error);
Note
Compiled scripts are cached by their code.

Member Function Documentation

◆ compile()

std::shared_ptr< const PointScript > enzo::expr::ScriptEngine::compile ( const String & code,
String & error )

Returns the compiled script for the user's code.

Returns
The compiled script, or null when the code fails to compile.

The documentation for this class was generated from the following files: