Ninja
|
Information about a node in the dependency graph: the file, whether it's dirty, mtime, etc. More...
#include <graph.h>
Public Member Functions | |
void | AddOutEdge (Edge *edge) |
bool | dirty () const |
void | Dump (const char *prefix="") const |
bool | exists () const |
int | id () const |
Edge * | in_edge () const |
void | MarkDirty () |
void | MarkMissing () |
Mark the Node as already-stat()ed and missing. | |
TimeStamp | mtime () const |
Node (const string &path) | |
const vector< Edge * > & | out_edges () const |
const string & | path () const |
void | ResetState () |
Mark as not-yet-stat()ed and not dirty. | |
void | set_dirty (bool dirty) |
void | set_id (int id) |
void | set_in_edge (Edge *edge) |
bool | Stat (DiskInterface *disk_interface) |
Return true if the file exists (mtime_ got a value). | |
bool | StatIfNecessary (DiskInterface *disk_interface) |
Return true if we needed to stat. | |
bool | status_known () const |
Private Attributes | |
bool | dirty_ |
Dirty is true when the underlying file is out-of-date. | |
int | id_ |
A dense integer id for the node, assigned and used by DepsLog. | |
Edge * | in_edge_ |
The Edge that produces this Node, or NULL when there is no known edge to produce it. | |
TimeStamp | mtime_ |
Possible values of mtime_: | |
vector< Edge * > | out_edges_ |
All Edges that use this Node as an input. | |
string | path_ |
Information about a node in the dependency graph: the file, whether it's dirty, mtime, etc.
Node::Node | ( | const string & | path | ) | [inline, explicit] |
void Node::AddOutEdge | ( | Edge * | edge | ) | [inline] |
Definition at line 87 of file graph.h.
Referenced by State::AddIn(), ImplicitDepLoader::LoadDepFile(), and ImplicitDepLoader::LoadDepsFromLog().
bool Node::dirty | ( | ) | const [inline] |
Definition at line 76 of file graph.h.
Referenced by Plan::AddSubTarget(), Plan::CleanNode(), Dump(), and State::Dump().
void Node::Dump | ( | const char * | prefix = "" | ) | const |
Definition at line 318 of file graph.cc.
References dirty(), Edge::Dump(), in_edge(), mtime(), out_edges(), and path().
bool Node::exists | ( | ) | const [inline] |
Definition at line 65 of file graph.h.
Referenced by DependencyScan::RecomputeOutputDirty().
int Node::id | ( | ) | const [inline] |
Definition at line 83 of file graph.h.
Referenced by State::Dump(), DepsLog::GetDeps(), DepsLog::Load(), and DepsLog::RecordDeps().
Edge* Node::in_edge | ( | ) | const [inline] |
Definition at line 80 of file graph.h.
Referenced by State::AddOut(), Plan::AddSubTarget(), GraphViz::AddTarget(), Builder::AddTarget(), ImplicitDepLoader::CreatePhonyInEdge(), BuildTest::Dirty(), Cleaner::DoCleanTarget(), and Dump().
void Node::MarkDirty | ( | ) | [inline] |
Definition at line 78 of file graph.h.
Referenced by Plan::CleanNode(), and BuildTest::Dirty().
void Node::MarkMissing | ( | ) | [inline] |
Mark the Node as already-stat()ed and missing.
Definition at line 61 of file graph.h.
Referenced by BuildTest::Dirty().
TimeStamp Node::mtime | ( | ) | const [inline] |
Definition at line 74 of file graph.h.
Referenced by Plan::CleanNode(), Dump(), DependencyScan::RecomputeDirty(), and DependencyScan::RecomputeOutputDirty().
const vector<Edge*>& Node::out_edges | ( | ) | const [inline] |
Definition at line 86 of file graph.h.
Referenced by Plan::CleanNode(), Dump(), and Plan::NodeFinished().
const string& Node::path | ( | ) | const [inline] |
Definition at line 73 of file graph.h.
Referenced by Plan::AddSubTarget(), GraphViz::AddTarget(), Cleaner::DoCleanTarget(), Dump(), State::Dump(), State::GetNode(), ImplicitDepLoader::LoadDepFile(), DependencyScan::RecomputeOutputDirty(), and DepsLog::RecordId().
void Node::ResetState | ( | ) | [inline] |
void Node::set_dirty | ( | bool | dirty | ) | [inline] |
Definition at line 77 of file graph.h.
Referenced by Plan::CleanNode().
void Node::set_id | ( | int | id | ) | [inline] |
Definition at line 84 of file graph.h.
Referenced by DepsLog::Load(), and DepsLog::RecordId().
void Node::set_in_edge | ( | Edge * | edge | ) | [inline] |
Definition at line 81 of file graph.h.
Referenced by State::AddOut(), and ImplicitDepLoader::CreatePhonyInEdge().
bool Node::Stat | ( | DiskInterface * | disk_interface | ) |
Return true if the file exists (mtime_ got a value).
Definition at line 30 of file graph.cc.
References METRIC_RECORD, mtime_, path_, and DiskInterface::Stat().
bool Node::StatIfNecessary | ( | DiskInterface * | disk_interface | ) | [inline] |
Return true if we needed to stat.
Definition at line 47 of file graph.h.
Referenced by Builder::AddTarget().
bool Node::status_known | ( | ) | const [inline] |
Definition at line 69 of file graph.h.
Referenced by State::Dump().
bool Node::dirty_ [private] |
Dirty is true when the underlying file is out-of-date.
But note that Edge::outputs_ready_ is also used in judging which edges to build.
int Node::id_ [private] |
Edge* Node::in_edge_ [private] |
TimeStamp Node::mtime_ [private] |
vector<Edge*> Node::out_edges_ [private] |
string Node::path_ [private] |