Skip to content

refactor: Node ancestor search#2334

Merged
rprospero merged 3 commits intodevelop2from
node_ancestor_search
Mar 13, 2026
Merged

refactor: Node ancestor search#2334
rprospero merged 3 commits intodevelop2from
node_ancestor_search

Conversation

@rprospero
Copy link
Contributor

This PR adds the ability for a node to recursively examine its inputs. A template parameter filters for only nodes of the given type.

@rprospero rprospero changed the title Node ancestor search refactor: Node ancestor search Mar 11, 2026
}
}

std::set<const Node *> Node::ancestors_() const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::set<const Node *> Node::ancestors_() const
// Get all nodes that lead into this node
std::set<const Node *> Node::ancestors_() const

src/nodes/node.h Outdated
return NodeConstants::ProcessResult::Failed;
}
// Get all nodes that lead into this node
std::set<const Node *> ancestors_() const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be the sole example of a function with this name_ convention in the codebase I think - not a problem per se, but is there an alternative name we could give it to clarify its intent? Perhaps rename the public function to getAncestors() (which makes it consistent with e.g. getNode()) and rename this to ancestors()?

@rprospero rprospero merged commit 997105e into develop2 Mar 13, 2026
1 check passed
@rprospero rprospero deleted the node_ancestor_search branch March 13, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants