|
Ninja
|
A class used to collect the transitive set of inputs from a given set of starting nodes. More...
#include <graph.h>
Public Member Functions | |
| std::vector< std::string > | GetInputsAsStrings (bool shell_escape=false) const |
| Same as inputs(), but returns the list of visited nodes as a list of strings, with optional shell escaping. More... | |
| const std::vector< const Node * > & | inputs () const |
| Retrieve list of visited input nodes. More... | |
| void | Reset () |
| Reset collector state. More... | |
| void | VisitNode (const Node *node) |
| Visit a single. More... | |
Private Attributes | |
| std::vector< const Node * > | inputs_ |
| std::set< const Node * > | visited_nodes_ |
A class used to collect the transitive set of inputs from a given set of starting nodes.
Used to implement the inputs tool.
When collecting inputs, the outputs of phony edges are always ignored from the result, but are followed by the dependency walk.
Usage is:
| std::vector< std::string > InputsCollector::GetInputsAsStrings | ( | bool | shell_escape = false | ) | const |
Same as inputs(), but returns the list of visited nodes as a list of strings, with optional shell escaping.
Definition at line 786 of file graph.cc.
References GetShellEscapedString(), and GetWin32EscapedString().
Referenced by TEST_F().
|
inline |
Retrieve list of visited input nodes.
A dependency always appears before its dependents in the result, but final order depends on the order of the VisitNode() calls performed before this.
Definition at line 449 of file graph.h.
References inputs_.
|
inline |
Reset collector state.
Definition at line 456 of file graph.h.
References inputs_, and visited_nodes_.
Referenced by TEST_F().
| void InputsCollector::VisitNode | ( | const Node * | node | ) |
Visit a single.
Definition at line 764 of file graph.cc.
References Node::in_edge(), Edge::inputs_, and Edge::is_phony().
Referenced by TEST_F().
|
private |
|
private |