Skip to content

Commit

Permalink
Merge pull request luxonis#52 from kunaltyagi/add.getConnectionMap
Browse files Browse the repository at this point in the history
Allow direct access to the node connections
  • Loading branch information
themarpe committed Feb 12, 2021
2 parents f9558c3 + 37cf47f commit 1ca39ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/depthai/pipeline/Pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ class PipelineImpl {
GlobalProperties globalProperties;
// Optimized for adding, searching and removing connections
std::unordered_map<Node::Id, std::shared_ptr<Node>> nodeMap;
using NodeConnectionMap = std::unordered_map<Node::Id, std::unordered_set<Node::Connection>>;
// Connection map, NodeId represents id of node connected TO (input)
std::unordered_map<Node::Id, std::unordered_set<Node::Connection>> nodeConnectionMap;
NodeConnectionMap nodeConnectionMap;

// Template create function
template <class N>
Expand Down Expand Up @@ -128,6 +129,11 @@ class Pipeline {
return impl()->getConnections();
}

using NodeConnectionMap = PipelineImpl::NodeConnectionMap;
const NodeConnectionMap& getConnectionMap() const {
return impl()->nodeConnectionMap;
}

void link(const Node::Output& out, const Node::Input& in) {
impl()->link(out, in);
}
Expand Down

0 comments on commit 1ca39ac

Please sign in to comment.