15 #ifndef NINJA_STATE_H_
16 #define NINJA_STATE_H_
83 if (weight_diff != 0) {
84 return weight_diff < 0;
127 std::vector<Node*>
RootNodes(std::string* error)
const;
128 std::vector<Node*>
DefaultNodes(std::string* error)
const;
An Env which contains a mapping of variables to values as well as a pointer to a parent scope.
An edge in the dependency graph; links between Nodes using Rules.
A template for hash_maps keyed by a StringPiece whose string is owned externally (typically by the va...
Information about a node in the dependency graph: the file, whether it's dirty, mtime,...
bool operator()(const Edge *a, const Edge *b) const
A pool for delayed edges.
bool ShouldDelayEdge() const
true if the Pool might delay this edge
void DelayEdge(Edge *edge)
adds the given edge to this Pool to be delayed.
Pool(const std::string &name, int depth)
void RetrieveReadyEdges(EdgePriorityQueue *ready_queue)
Pool will add zero or more edges to the ready_queue.
void EdgeScheduled(const Edge &edge)
informs this Pool that the given edge is committed to be run.
const std::string & name() const
std::set< Edge *, WeightedEdgeCmp > DelayedEdges
void EdgeFinished(const Edge &edge)
informs this Pool that the given edge is no longer runnable, and should relinquish its resources back...
int current_use_
|current_use_| is the total of the weights of the edges which are currently scheduled in the Plan (i....
void Dump() const
Dump the Pool and its edges (useful for debugging).
An invocable build command and associated metadata (description, etc.).
Global state (file status) for a single run.
std::vector< Node * > RootNodes(std::string *error) const
void AddValidation(Edge *edge, StringPiece path, uint64_t slash_bits)
std::vector< Edge * > edges_
All the edges of the graph.
std::vector< Node * > DefaultNodes(std::string *error) const
bool AddDefault(StringPiece path, std::string *error)
Edge * AddEdge(const Rule *rule)
Node * SpellcheckNode(const std::string &path)
Node * GetNode(StringPiece path, uint64_t slash_bits)
void AddIn(Edge *edge, StringPiece path, uint64_t slash_bits)
Add input / output / validation nodes to a given edge.
Node * LookupNode(StringPiece path) const
std::map< std::string, Pool * > pools_
All the pools used in the graph.
Pool * LookupPool(const std::string &pool_name)
std::vector< Node * > defaults_
void Dump()
Dump the nodes and Pools (useful for debugging).
ExternalStringHashMap< Node * >::Type Paths
Mapping of path -> Node.
bool AddOut(Edge *edge, StringPiece path, uint64_t slash_bits, std::string *err)
StringPiece represents a slice of a string whose memory is managed externally.
unsigned long long uint64_t