Ninja
Public Member Functions | Public Attributes | Static Public Attributes
State Struct Reference

Global state (file status, loaded rules) for a single run. More...

#include <state.h>

List of all members.

Public Member Functions

bool AddDefault (const string &path, string *error)
EdgeAddEdge (const Rule *rule)
void AddIn (Edge *edge, const string &path)
void AddOut (Edge *edge, const string &path)
void AddRule (const Rule *rule)
vector< Node * > DefaultNodes (string *error)
NodeGetNode (const string &path)
NodeLookupNode (const string &path)
const RuleLookupRule (const string &rule_name)
void Reset ()
vector< Node * > RootNodes (string *error)
StatCachestat_cache ()
 State ()

Public Attributes

BindingEnv bindings_
struct BuildLogbuild_log_
vector< Node * > defaults_
vector< Edge * > edges_
 All the edges of the graph.
map< string, const Rule * > rules_
 All the rules used in the graph.
StatCache stat_cache_

Static Public Attributes

static const Rule kPhonyRule

Detailed Description

Global state (file status, loaded rules) for a single run.

Definition at line 34 of file state.h.


Constructor & Destructor Documentation

State::State ( )

Definition at line 24 of file state.cc.

References AddRule(), and kPhonyRule.


Member Function Documentation

bool State::AddDefault ( const string &  path,
string *  error 
)

Definition at line 78 of file state.cc.

References defaults_, and LookupNode().

Referenced by ManifestParser::ParseDefaults().

Edge * State::AddEdge ( const Rule rule)

Definition at line 40 of file state.cc.

References bindings_, edges_, Edge::env_, and Edge::rule_.

Referenced by Edge::LoadDepFile(), and ManifestParser::ParseEdge().

void State::AddIn ( Edge edge,
const string &  path 
)

Definition at line 62 of file state.cc.

References GetNode(), Edge::inputs_, and Node::out_edges_.

Referenced by ManifestParser::ParseEdge().

void State::AddOut ( Edge edge,
const string &  path 
)

Definition at line 68 of file state.cc.

References GetNode(), Node::in_edge_, Edge::outputs_, and Warning().

Referenced by ManifestParser::ParseEdge().

void State::AddRule ( const Rule rule)

Definition at line 28 of file state.cc.

References LookupRule(), Rule::name_, and rules_.

Referenced by ManifestParser::ParseRule(), and State().

vector< Node * > State::DefaultNodes ( string *  error)

Definition at line 106 of file state.cc.

References defaults_, and RootNodes().

Node * State::GetNode ( const string &  path)
Node * State::LookupNode ( const string &  path)
const Rule * State::LookupRule ( const string &  rule_name)
void State::Reset ( )

Definition at line 110 of file state.cc.

References edges_, StatCache::Invalidate(), and stat_cache_.

vector< Node * > State::RootNodes ( string *  error)
Returns:
the root node(s) of the graph. (Root nodes have no output edges).
Parameters:
errorwhere to write the error message if somethings went wrong.

Definition at line 88 of file state.cc.

References edges_.

Referenced by DefaultNodes().

StatCache* State::stat_cache ( ) [inline]

Definition at line 54 of file state.h.


Member Data Documentation

Definition at line 64 of file state.h.

Referenced by AddEdge(), main(), and ManifestParser::ManifestParser().

Definition at line 65 of file state.h.

Referenced by AddDefault(), and DefaultNodes().

vector<Edge*> State::edges_

All the edges of the graph.

Definition at line 62 of file state.h.

Referenced by AddEdge(), Cleaner::CleanAll(), Cleaner::DoCleanRule(), Reset(), and RootNodes().

const Rule State::kPhonyRule [static]

Definition at line 35 of file state.h.

Referenced by Cleaner::CleanAll(), Edge::is_phony(), Edge::LoadDepFile(), and State().

map<string, const Rule*> State::rules_

All the rules used in the graph.

Definition at line 59 of file state.h.

Referenced by AddRule(), and LookupRule().

Definition at line 56 of file state.h.

Referenced by GetNode(), LookupNode(), and Reset().


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