Go to the documentation of this file.
35 using Id = std::int64_t;
44 std::unordered_map<std::string, Output*>
outputRefs;
77 Output(
Node& par, std::string n,
Type t, std::vector<DatatypeHierarchy> types)
136 class OutputMap :
public std::unordered_map<std::string, Output> {
166 Input(
Node& par, std::string n,
Type t, std::vector<DatatypeHierarchy> types)
258 class InputMap :
public std::unordered_map<std::string, Input> {
306 virtual std::unique_ptr<Node>
clone()
const = 0;
309 virtual const char*
getName()
const = 0;
330 Node(
const std::shared_ptr<PipelineImpl>& p,
Id nodeId, std::unique_ptr<Properties> props);
331 virtual ~Node() =
default;
341 template <
typename Base,
typename Derived,
typename Props>
348 return Derived::NAME;
350 std::unique_ptr<Node>
clone()
const override {
351 return std::make_unique<Derived>(
static_cast<const Derived&
>(*
this));
355 NodeCRTP(
const std::shared_ptr<PipelineImpl>& par, int64_t nodeId, std::unique_ptr<Properties> props)
357 NodeCRTP(
const std::shared_ptr<PipelineImpl>& par, int64_t nodeId) :
NodeCRTP(par, nodeId,
std::make_unique<Props>()) {}
368 struct hash<
dai::Node::Connection> {
371 std::hash<dai::Node::Id> hId;
372 std::hash<std::string> hStr;
373 seed ^= hId(obj.
outputId) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
374 seed ^= hStr(obj.
outputName) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
375 seed ^= hId(obj.
inputId) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
376 seed ^= hStr(obj.
outputName) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
Properties & properties
Underlying properties.
size_t operator()(const dai::Node::Connection &obj) const
Pipeline getParentPipeline()
const Node & getParent() const
Represents the pipeline, set of nodes and connections between them.
virtual std::unique_ptr< Node > clone() const =0
Deep copy the node.
std::int64_t Id
Node identificator. Unique for every node on a single Pipeline.
virtual Properties & getProperties()
std::vector< DatatypeHierarchy > possibleDatatypes
bool isSamePipeline(const Input &in)
void setInputRefs(std::initializer_list< Input * > l)
void setOutputMapRefs(std::initializer_list< OutputMap * > l)
copyable_unique_ptr< Properties > propertiesHolder
AssetManager assetManager
AssetManager can store assets and serialize.
void setInputMapRefs(std::initializer_list< InputMap * > l)
bool canConnect(const Input &in)
void unlink(const Input &in)
Output & operator[](const std::string &key)
Create or modify an input.
std::vector< Input * > getInputRefs()
Retrieves reference to node inputs.
const AssetManager & getAssetManager() const
Get node AssetManager as a const reference.
NodeCRTP(const std::shared_ptr< PipelineImpl > &par, int64_t nodeId, std::unique_ptr< Properties > props)
constexpr auto size(const C &c) -> decltype(c.size())
std::vector< Output > getOutputs()
Retrieves all nodes outputs.
OutputMap(std::string name, Output defaultOutput)
Connection between an Input and Output.
virtual const char * getName() const =0
Retrieves nodes name.
DatatypeHierarchy(DatatypeEnum d, bool c)
std::unique_ptr< Node > clone() const override
std::vector< Connection > getConnections()
std::string toString() const
Output to string representation.
Node(const std::shared_ptr< PipelineImpl > &p, Id nodeId, std::unique_ptr< Properties > props)
Constructs Node.
std::vector< Output * > getOutputRefs()
Retrieves reference to node outputs.
Base Properties structure.
std::unordered_map< std::string, Output * > outputRefs
void setOutputRefs(std::initializer_list< Output * > l)
virtual tl::optional< OpenVINO::Version > getRequiredOpenVINOVersion()
Output(Node &par, std::string n, Type t, std::vector< DatatypeHierarchy > types)
bool operator==(const Connection &rhs) const
std::unordered_map< std::string, OutputMap * > outputMapRefs
NodeCRTP(const std::shared_ptr< PipelineImpl > &par, int64_t nodeId)
std::unordered_map< std::string, InputMap * > inputMapRefs
std::weak_ptr< PipelineImpl > parent
const char * getName() const override
Connection(Output out, Input in)
void link(const Input &in)
std::unordered_map< std::string, Input * > inputRefs
std::vector< Input > getInputs()
Retrieves all nodes inputs.
Output(Node &par, std::string group, std::string n, Type t, std::vector< DatatypeHierarchy > types)
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19