|
Ninja
|
Global state (file status) for a single run. More...
#include <state.h>
Public Types | |
| typedef ExternalStringHashMap< Node * >::Type | Paths |
| Mapping of path -> Node. More... | |
Public Member Functions | |
| bool | AddDefault (StringPiece path, string *error) |
| Edge * | AddEdge (const Rule *rule) |
| void | AddIn (Edge *edge, StringPiece path, uint64_t slash_bits) |
| bool | AddOut (Edge *edge, StringPiece path, uint64_t slash_bits) |
| void | AddPool (Pool *pool) |
| vector< Node * > | DefaultNodes (string *error) const |
| void | Dump () |
| Dump the nodes and Pools (useful for debugging). More... | |
| Node * | GetNode (StringPiece path, uint64_t slash_bits) |
| Node * | LookupNode (StringPiece path) const |
| Pool * | LookupPool (const string &pool_name) |
| void | Reset () |
| Reset state. More... | |
| vector< Node * > | RootNodes (string *error) const |
| Node * | SpellcheckNode (const string &path) |
| State () | |
Public Attributes | |
| BindingEnv | bindings_ |
| vector< Node * > | defaults_ |
| vector< Edge * > | edges_ |
| All the edges of the graph. More... | |
| Paths | paths_ |
| map< string, Pool * > | pools_ |
| All the pools used in the graph. More... | |
Static Public Attributes | |
| static Pool | kConsolePool |
| static Pool | kDefaultPool |
| static const Rule | kPhonyRule |
| typedef ExternalStringHashMap<Node*>::Type State::Paths |
| State::State | ( | ) |
Definition at line 76 of file state.cc.
References AddPool(), BindingEnv::AddRule(), bindings_, kConsolePool, kDefaultPool, and kPhonyRule.
| bool State::AddDefault | ( | StringPiece | path, |
| string * | error | ||
| ) |
Definition at line 152 of file state.cc.
References StringPiece::AsString(), defaults_, and LookupNode().
Referenced by ManifestParser::ParseDefault().
Definition at line 94 of file state.cc.
References bindings_, edges_, Edge::env_, kDefaultPool, Edge::pool_, and Edge::rule_.
Referenced by ImplicitDepLoader::CreatePhonyInEdge(), and ManifestParser::ParseEdge().
| void State::AddIn | ( | Edge * | edge, |
| StringPiece | path, | ||
| uint64_t | slash_bits | ||
| ) |
Definition at line 137 of file state.cc.
References Node::AddOutEdge(), GetNode(), and Edge::inputs_.
Referenced by ManifestParser::ParseEdge().
| bool State::AddOut | ( | Edge * | edge, |
| StringPiece | path, | ||
| uint64_t | slash_bits | ||
| ) |
Definition at line 143 of file state.cc.
References GetNode(), Node::in_edge(), Edge::outputs_, and Node::set_in_edge().
Referenced by ManifestParser::ParseEdge().
| void State::AddPool | ( | Pool * | pool | ) |
Definition at line 82 of file state.cc.
References LookupPool(), Pool::name(), and pools_.
Referenced by ManifestParser::ParsePool(), and State().
| vector< Node * > State::DefaultNodes | ( | string * | error | ) | const |
Definition at line 180 of file state.cc.
References defaults_, and RootNodes().
| void State::Dump | ( | ) |
Dump the nodes and Pools (useful for debugging).
Definition at line 193 of file state.cc.
References Node::dirty(), Node::id(), Node::path(), paths_, pools_, and Node::status_known().
| Node * State::GetNode | ( | StringPiece | path, |
| uint64_t | slash_bits | ||
| ) |
Definition at line 103 of file state.cc.
References StringPiece::AsString(), LookupNode(), Node::path(), and paths_.
Referenced by AddIn(), AddOut(), Builder::ExtractDeps(), StateTestWithBuiltinRules::GetNode(), DepsLog::Load(), ImplicitDepLoader::LoadDepFile(), and TEST_F().
| Node * State::LookupNode | ( | StringPiece | path | ) | const |
Definition at line 112 of file state.cc.
References METRIC_RECORD, and paths_.
Referenced by AddDefault(), Builder::AddTarget(), Cleaner::CleanTarget(), Cleaner::CleanTargets(), and GetNode().
| Pool * State::LookupPool | ( | const string & | pool_name | ) |
Definition at line 87 of file state.cc.
References pools_.
Referenced by AddPool(), ManifestParser::ParseEdge(), ManifestParser::ParsePool(), and TEST_F().
| void State::Reset | ( | ) |
Reset state.
Keeps all nodes and edges, but restores them to the state where we haven't yet examined the disk for dirty state.
Definition at line 184 of file state.cc.
References edges_, paths_, and Edge::VisitNone.
| vector< Node * > State::RootNodes | ( | string * | error | ) | const |
| error | where to write the error message if somethings went wrong. |
Definition at line 162 of file state.cc.
References edges_.
Referenced by DefaultNodes().
| Node * State::SpellcheckNode | ( | const string & | path | ) |
Definition at line 120 of file state.cc.
References EditDistance(), and paths_.
| BindingEnv State::bindings_ |
Definition at line 127 of file state.h.
Referenced by AddEdge(), Cleaner::CleanRule(), Cleaner::CleanRules(), ManifestParser::ManifestParser(), and State().
| vector<Node*> State::defaults_ |
Definition at line 128 of file state.h.
Referenced by AddDefault(), and DefaultNodes().
| vector<Edge*> State::edges_ |
All the edges of the graph.
Definition at line 125 of file state.h.
Referenced by AddEdge(), Cleaner::CleanAll(), Cleaner::DoCleanRule(), LoadManifests(), ManifestParser::ParseEdge(), Reset(), RootNodes(), TEST_F(), VerifyGraph(), and WriteTestData().
|
static |
Definition at line 87 of file state.h.
Referenced by State(), and Edge::use_console().
|
static |
|
static |
Definition at line 88 of file state.h.
Referenced by ImplicitDepLoader::CreatePhonyInEdge(), Edge::is_phony(), and State().
| Paths State::paths_ |
Definition at line 119 of file state.h.
Referenced by Dump(), GetNode(), LookupNode(), Reset(), SpellcheckNode(), and VerifyGraph().
| map<string, Pool*> State::pools_ |
All the pools used in the graph.
Definition at line 122 of file state.h.
Referenced by AddPool(), Dump(), and LookupPool().
1.8.14