Skip to content

refactor: Node ancestor search#2334

Open
rprospero wants to merge 2 commits intodevelop2from
node_ancestor_search
Open

refactor: Node ancestor search#2334
rprospero wants to merge 2 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

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()?

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