Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
dai::node::Script Class Reference

#include <Script.hpp>

Inheritance diagram for dai::node::Script:
Inheritance graph
[legend]

Public Member Functions

ProcessorType getProcessor () const
 
std::string getScriptName () const
 Get the script name in utf-8. More...
 
dai::Path getScriptPath () const
 Get filesystem path from where script was loaded. More...
 
 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 setProcessor (ProcessorType type)
 
void setScript (const std::string &script, const std::string &name="")
 
void setScript (const std::vector< std::uint8_t > &data, const std::string &name="")
 
void setScriptPath (const dai::Path &path, const std::string &name="")
 
- Public Member Functions inherited from dai::NodeCRTP< Node, Script, ScriptProperties >
std::unique_ptr< Nodeclone () const override
 
const char * getName () const override
 
- Public Member Functions inherited from dai::Node
virtual std::unique_ptr< Nodeclone () const =0
 Deep copy the node. More...
 
AssetManagergetAssetManager ()
 Get node AssetManager as a reference. More...
 
const AssetManagergetAssetManager () const
 Get node AssetManager as a const reference. More...
 
std::vector< Input * > getInputRefs ()
 Retrieves reference to node inputs. More...
 
std::vector< const Input * > getInputRefs () const
 Retrieves reference to node inputs. More...
 
std::vector< InputgetInputs ()
 Retrieves all nodes inputs. More...
 
virtual const char * getName () const =0
 Retrieves nodes name. More...
 
std::vector< Output * > getOutputRefs ()
 Retrieves reference to node outputs. More...
 
std::vector< const Output * > getOutputRefs () const
 Retrieves reference to node outputs. More...
 
std::vector< OutputgetOutputs ()
 Retrieves all nodes outputs. More...
 
Pipeline getParentPipeline ()
 
const Pipeline getParentPipeline () const
 
 Node (const std::shared_ptr< PipelineImpl > &p, Id nodeId, std::unique_ptr< Properties > props)
 Constructs Node. More...
 
virtual ~Node ()=default
 

Public Attributes

InputMap inputs
 
OutputMap outputs
 
- Public Attributes inherited from dai::NodeCRTP< Node, Script, ScriptProperties >
Propertiesproperties
 Underlying properties. More...
 
- Public Attributes inherited from dai::Node
const Id id
 Id of node. More...
 
Propertiesproperties
 

Static Public Attributes

constexpr static const char * NAME = "Script"
 

Private Attributes

dai::Path scriptPath
 

Additional Inherited Members

- Public Types inherited from dai::NodeCRTP< Node, Script, ScriptProperties >
using Properties = ScriptProperties
 
- Public Types inherited from dai::Node
using Id = std::int64_t
 Node identificator. Unique for every node on a single Pipeline. More...
 
- Protected Member Functions inherited from dai::Node
virtual PropertiesgetProperties ()
 
virtual tl::optional< OpenVINO::VersiongetRequiredOpenVINOVersion ()
 
void setInputMapRefs (InputMap *inMapRef)
 
void setInputMapRefs (std::initializer_list< InputMap * > l)
 
void setInputRefs (Input *inRef)
 
void setInputRefs (std::initializer_list< Input * > l)
 
void setOutputMapRefs (OutputMap *outMapRef)
 
void setOutputMapRefs (std::initializer_list< OutputMap * > l)
 
void setOutputRefs (Output *outRef)
 
void setOutputRefs (std::initializer_list< Output * > l)
 
- Protected Attributes inherited from dai::Node
AssetManager assetManager
 
std::unordered_map< std::string, InputMap * > inputMapRefs
 
std::unordered_map< std::string, Input * > inputRefs
 
std::unordered_map< std::string, OutputMap * > outputMapRefs
 
std::unordered_map< std::string, Output * > outputRefs
 
std::weak_ptr< PipelineImplparent
 
copyable_unique_ptr< PropertiespropertiesHolder
 

Detailed Description

Definition at line 15 of file Script.hpp.

Constructor & Destructor Documentation

◆ Script() [1/2]

dai::node::Script::Script ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId 
)

Definition at line 9 of file Script.cpp.

◆ Script() [2/2]

dai::node::Script::Script ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId,
std::unique_ptr< Properties props 
)

Definition at line 10 of file Script.cpp.

Member Function Documentation

◆ getProcessor()

ProcessorType dai::node::Script::getProcessor ( ) const

Get on which processor the script should run

Returns
Processor type - Leon CSS or Leon MSS

Definition at line 65 of file Script.cpp.

◆ getScriptName()

std::string dai::node::Script::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

Definition at line 61 of file Script.cpp.

◆ getScriptPath()

dai::Path dai::node::Script::getScriptPath ( ) const

Get filesystem path from where script was loaded.

Returns
dai::Path from where script was loaded, otherwise returns empty path

Definition at line 57 of file Script.cpp.

◆ setProcessor()

void dai::node::Script::setProcessor ( ProcessorType  type)

Set on which processor the script should run

Parameters
typeProcessor type - Leon CSS or Leon MSS

Definition at line 53 of file Script.cpp.

◆ setScript() [1/2]

void dai::node::Script::setScript ( const std::string &  script,
const std::string &  name = "" 
)

Sets script data to be interpreted

Parameters
scriptScript string to be interpreted
nameOptionally set a name of this script

Definition at line 32 of file Script.cpp.

◆ setScript() [2/2]

void dai::node::Script::setScript ( const std::vector< std::uint8_t > &  data,
const std::string &  name = "" 
)

Sets script data to be interpreted

Parameters
dataBinary data that represents the script to be interpreted
nameOptionally set a name of this script

Definition at line 43 of file Script.cpp.

◆ setScriptPath()

void dai::node::Script::setScriptPath ( const dai::Path path,
const std::string &  name = "" 
)

Specify local filesystem path to load the script

Parameters
pathFilesystem path to load the script
nameOptionally set a name of this script, otherwise the name defaults to the path

Definition at line 22 of file Script.cpp.

Member Data Documentation

◆ inputs

InputMap dai::node::Script::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

Definition at line 30 of file Script.hpp.

◆ NAME

constexpr static const char* dai::node::Script::NAME = "Script"
staticconstexpr

Definition at line 17 of file Script.hpp.

◆ outputs

OutputMap dai::node::Script::outputs

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

Definition at line 35 of file Script.hpp.

◆ scriptPath

dai::Path dai::node::Script::scriptPath
private

Definition at line 20 of file Script.hpp.


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


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20