Class Script
Defined in File Script.hpp
Inheritance Relationships
Base Type
public dai::NodeCRTP< Node, Script, ScriptProperties >(Template Class NodeCRTP)
Class Documentation
-
class Script : public dai::NodeCRTP<Node, Script, ScriptProperties>
Public Functions
-
void setScriptPath(const dai::Path &path, const std::string &name = "")
Specify local filesystem path to load the script
- Parameters:
path – Filesystem path to load the script
name – Optionally set a name of this script, otherwise the name defaults to the path
-
void setScript(const std::string &script, const std::string &name = "")
Sets script data to be interpreted
- Parameters:
script – Script string to be interpreted
name – Optionally set a name of this script
-
void setScript(const std::vector<std::uint8_t> &data, const std::string &name = "")
Sets script data to be interpreted
- Parameters:
data – Binary data that represents the script to be interpreted
name – Optionally set a name of this script
-
dai::Path getScriptPath() const
Get filesystem path from where script was loaded.
- Returns:
dai::Path from where script was loaded, otherwise returns empty path
-
std::string getScriptName() const
Get the script name in utf-8.
When name set with setScript() or setScriptPath(), returns that name. When script loaded with setScriptPath() with name not provided, returns the utf-8 string of that path. Otherwise, returns “<script>”
- Returns:
std::string of script name in utf-8
-
void setProcessor(ProcessorType type)
Set on which processor the script should run
- Parameters:
type – Processor type - Leon CSS or Leon MSS
-
ProcessorType getProcessor() const
Get on which processor the script should run
- Returns:
Processor type - Leon CSS or Leon MSS
Public Members
Public Static Attributes
-
static constexpr const char *NAME = "Script"
-
void setScriptPath(const dai::Path &path, const std::string &name = "")