Ninja
Public Types | Public Member Functions | Public Attributes | List of all members
Edge Struct Reference

An edge in the dependency graph; links between Nodes using Rules. More...

#include <graph.h>

Public Types

enum  VisitMark { VisitNone, VisitInStack, VisitDone }
 

Public Member Functions

bool AllInputsReady () const
 Return true if all inputs' in-edges are ready. More...
 
void CollectInputs (bool shell_escape, std::vector< std::string > *out) const
 
void Dump (const char *prefix="") const
 
 Edge ()
 
std::string EvaluateCommand (bool incl_rsp_file=false) const
 Expand all variables in a command and return it as a string. More...
 
std::string GetBinding (const std::string &key) const
 Returns the shell-escaped value of |key|. More...
 
bool GetBindingBool (const std::string &key) const
 
std::string GetUnescapedDepfile () const
 Like GetBinding("depfile"), but without shell escaping. More...
 
std::string GetUnescapedDyndep () const
 Like GetBinding("dyndep"), but without shell escaping. More...
 
std::string GetUnescapedRspfile () const
 Like GetBinding("rspfile"), but without shell escaping. More...
 
bool is_implicit (size_t index)
 
bool is_implicit_out (size_t index) const
 
bool is_order_only (size_t index)
 
bool is_phony () const
 
bool maybe_phonycycle_diagnostic () const
 
bool outputs_ready () const
 
Poolpool () const
 
const Rulerule () const
 
bool use_console () const
 
int weight () const
 

Public Attributes

bool deps_loaded_
 
bool deps_missing_
 
Nodedyndep_
 
BindingEnvenv_
 
bool generated_by_dep_loader_
 
size_t id_
 
int implicit_deps_
 
int implicit_outs_
 
std::vector< Node * > inputs_
 
VisitMark mark_
 
int order_only_deps_
 
std::vector< Node * > outputs_
 
bool outputs_ready_
 
Poolpool_
 
const Rulerule_
 
std::vector< Node * > validations_
 

Detailed Description

An edge in the dependency graph; links between Nodes using Rules.

Definition at line 164 of file graph.h.

Member Enumeration Documentation

◆ VisitMark

Enumerator
VisitNone 
VisitInStack 
VisitDone 

Definition at line 165 of file graph.h.

Constructor & Destructor Documentation

◆ Edge()

Edge::Edge ( )
inline

Definition at line 171 of file graph.h.

Member Function Documentation

◆ AllInputsReady()

bool Edge::AllInputsReady ( ) const

Return true if all inputs' in-edges are ready.

Definition at line 374 of file graph.cc.

Referenced by Plan::AddSubTarget(), and Plan::EdgeMaybeReady().

◆ CollectInputs()

void Edge::CollectInputs ( bool  shell_escape,
std::vector< std::string > *  out 
) const

Definition at line 459 of file graph.cc.

References GetShellEscapedString(), and GetWin32EscapedString().

Referenced by TEST_F().

◆ Dump()

void Edge::Dump ( const char *  prefix = "") const

Definition at line 515 of file graph.cc.

◆ EvaluateCommand()

std::string Edge::EvaluateCommand ( bool  incl_rsp_file = false) const

Expand all variables in a command and return it as a string.

If incl_rsp_file is enabled, the string will also contain the full contents of a response file (if applicable)

Definition at line 481 of file graph.cc.

Referenced by StatusPrinter::BuildEdgeFinished(), DependencyScan::RecomputeOutputsDirty(), BuildLog::RecordCommand(), RealCommandRunner::StartCommand(), FakeCommandRunner::StartCommand(), Builder::StartEdge(), and TEST_F().

◆ GetBinding()

std::string Edge::GetBinding ( const std::string &  key) const

◆ GetBindingBool()

bool Edge::GetBindingBool ( const std::string &  key) const

◆ GetUnescapedDepfile()

string Edge::GetUnescapedDepfile ( ) const

Like GetBinding("depfile"), but without shell escaping.

Definition at line 500 of file graph.cc.

References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().

Referenced by Builder::ExtractDeps(), Builder::FinishCommand(), ImplicitDepLoader::LoadDeps(), Cleaner::RemoveEdgeFiles(), and FakeCommandRunner::StartCommand().

◆ GetUnescapedDyndep()

string Edge::GetUnescapedDyndep ( ) const

Like GetBinding("dyndep"), but without shell escaping.

Definition at line 505 of file graph.cc.

References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().

Referenced by ManifestParser::ParseEdge().

◆ GetUnescapedRspfile()

std::string Edge::GetUnescapedRspfile ( ) const

Like GetBinding("rspfile"), but without shell escaping.

Definition at line 510 of file graph.cc.

References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().

Referenced by Builder::FinishCommand(), Cleaner::RemoveEdgeFiles(), and Builder::StartEdge().

◆ is_implicit()

bool Edge::is_implicit ( size_t  index)
inline

Definition at line 230 of file graph.h.

References implicit_deps_, inputs_, is_order_only(), and order_only_deps_.

Referenced by TEST_F().

◆ is_implicit_out()

bool Edge::is_implicit_out ( size_t  index) const
inline

Definition at line 244 of file graph.h.

References implicit_outs_, and outputs_.

Referenced by TEST_F().

◆ is_order_only()

bool Edge::is_order_only ( size_t  index)
inline

Definition at line 234 of file graph.h.

References inputs_, and order_only_deps_.

Referenced by GraphViz::AddTarget(), is_implicit(), DependencyScan::RecomputeNodeDirty(), and TEST_F().

◆ is_phony()

bool Edge::is_phony ( ) const

◆ maybe_phonycycle_diagnostic()

bool Edge::maybe_phonycycle_diagnostic ( ) const

Definition at line 551 of file graph.cc.

Referenced by ManifestParser::ParseEdge(), and DependencyScan::VerifyDAG().

◆ outputs_ready()

bool Edge::outputs_ready ( ) const
inline

◆ pool()

Pool* Edge::pool ( ) const
inline

Definition at line 216 of file graph.h.

References pool_.

Referenced by Plan::EdgeFinished(), and Plan::ScheduleWork().

◆ rule()

const Rule& Edge::rule ( ) const
inline

Definition at line 215 of file graph.h.

References rule_.

Referenced by FakeCommandRunner::StartCommand(), and FakeCommandRunner::WaitForCommand().

◆ use_console()

bool Edge::use_console ( ) const

◆ weight()

int Edge::weight ( ) const
inline

Member Data Documentation

◆ deps_loaded_

bool Edge::deps_loaded_

Definition at line 211 of file graph.h.

Referenced by DependencyScan::RecomputeNodeDirty().

◆ deps_missing_

bool Edge::deps_missing_

Definition at line 212 of file graph.h.

Referenced by DependencyScan::RecomputeNodeDirty().

◆ dyndep_

Node* Edge::dyndep_

◆ env_

BindingEnv* Edge::env_

Definition at line 207 of file graph.h.

Referenced by State::AddEdge(), ManifestParser::ParseEdge(), and DyndepLoader::UpdateEdge().

◆ generated_by_dep_loader_

bool Edge::generated_by_dep_loader_

Definition at line 213 of file graph.h.

Referenced by ImplicitDepLoader::CreatePhonyInEdge().

◆ id_

size_t Edge::id_

Definition at line 209 of file graph.h.

Referenced by State::AddEdge(), and EdgeCmp::operator()().

◆ implicit_deps_

int Edge::implicit_deps_

◆ implicit_outs_

int Edge::implicit_outs_

◆ inputs_

std::vector<Node*> Edge::inputs_

◆ mark_

VisitMark Edge::mark_

◆ order_only_deps_

int Edge::order_only_deps_

◆ outputs_

std::vector<Node*> Edge::outputs_

◆ outputs_ready_

bool Edge::outputs_ready_

◆ pool_

Pool* Edge::pool_

Definition at line 202 of file graph.h.

Referenced by State::AddEdge(), ManifestParser::ParseEdge(), and pool().

◆ rule_

const Rule* Edge::rule_

Definition at line 201 of file graph.h.

Referenced by State::AddEdge(), GraphViz::AddTarget(), and rule().

◆ validations_

std::vector<Node*> Edge::validations_

The documentation for this struct was generated from the following files: