Class Script

Inheritance Relationships

Base Type

Class Documentation

class Script : public dai::NodeCRTP<Node, Script, ScriptProperties>

Public Functions

Script(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
Script(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId, std::unique_ptr<Properties> props)
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:
  • scriptScript 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

InputMap inputs

Inputs to Script node. Can be accessed using subscript operator (Eg: inputs[‘in1’]) By default inputs are set to blocking with queue size 8

OutputMap outputs

Outputs from Script node. Can be accessed subscript operator (Eg: outputs[‘out1’])

Public Static Attributes

static constexpr const char *NAME = "Script"