Ninja
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
BuildStatus Struct Reference

Tracks the status of a build: completion fraction, printing updates. More...

#include <build.h>

Classes

struct  RateInfo
 
struct  SlidingRateInfo
 

Public Member Functions

void BuildEdgeFinished (Edge *edge, bool success, const string &output, int *start_time, int *end_time)
 
void BuildEdgeStarted (Edge *edge)
 
void BuildFinished ()
 
 BuildStatus (const BuildConfig &config)
 
string FormatProgressStatus (const char *progress_status_format) const
 Format the progress status string by replacing the placeholders. More...
 
void PlanHasTotalEdges (int total)
 

Private Types

typedef map< Edge *, int > RunningEdgeMap
 Map of running edge to time the edge started running. More...
 

Private Member Functions

void PrintStatus (Edge *edge)
 
template<size_t S>
void snprinfRate (double rate, char(&buf)[S], const char *format) const
 

Private Attributes

const BuildConfigconfig_
 
SlidingRateInfo current_rate_
 
int finished_edges_
 
RateInfo overall_rate_
 
LinePrinter printer_
 Prints progress output. More...
 
const char * progress_status_format_
 The custom progress status format to use. More...
 
RunningEdgeMap running_edges_
 
int64_t start_time_millis_
 Time the build started. More...
 
int started_edges_
 
int total_edges_
 

Detailed Description

Tracks the status of a build: completion fraction, printing updates.

Definition at line 196 of file build.h.

Member Typedef Documentation

typedef map<Edge*, int> BuildStatus::RunningEdgeMap
private

Map of running edge to time the edge started running.

Definition at line 221 of file build.h.

Constructor & Destructor Documentation

BuildStatus::BuildStatus ( const BuildConfig config)
explicit

Member Function Documentation

void BuildStatus::BuildEdgeFinished ( Edge edge,
bool  success,
const string &  output,
int *  start_time,
int *  end_time 
)
void BuildStatus::BuildEdgeStarted ( Edge edge)
void BuildStatus::BuildFinished ( )

Definition at line 153 of file build.cc.

References printer_, LinePrinter::PrintOnNewLine(), and LinePrinter::SetConsoleLocked().

Referenced by Builder::Build().

string BuildStatus::FormatProgressStatus ( const char *  progress_status_format) const

Format the progress status string by replacing the placeholders.

See the user manual for more information about the available placeholders.

Parameters
progress_status_formatThe format of the progress status.

Definition at line 158 of file build.cc.

References current_rate_, BuildStatus::RateInfo::Elapsed(), Fatal(), finished_edges_, overall_rate_, BuildStatus::RateInfo::rate(), BuildStatus::SlidingRateInfo::rate(), snprinfRate(), started_edges_, total_edges_, BuildStatus::RateInfo::UpdateRate(), and BuildStatus::SlidingRateInfo::UpdateRate().

Referenced by PrintStatus().

void BuildStatus::PlanHasTotalEdges ( int  total)

Definition at line 90 of file build.cc.

References total_edges_.

Referenced by Builder::Build(), and Builder::FinishCommand().

void BuildStatus::PrintStatus ( Edge edge)
private
template<size_t S>
void BuildStatus::snprinfRate ( double  rate,
char(&)  buf[S],
const char *  format 
) const
inlineprivate

Definition at line 231 of file build.h.

Referenced by FormatProgressStatus().

Member Data Documentation

const BuildConfig& BuildStatus::config_
private

Definition at line 213 of file build.h.

Referenced by BuildEdgeFinished(), BuildStatus(), and PrintStatus().

SlidingRateInfo BuildStatus::current_rate_
mutableprivate

Definition at line 280 of file build.h.

Referenced by FormatProgressStatus(), and PrintStatus().

int BuildStatus::finished_edges_
private

Definition at line 218 of file build.h.

Referenced by BuildEdgeFinished(), FormatProgressStatus(), and PrintStatus().

RateInfo BuildStatus::overall_rate_
mutableprivate

Definition at line 279 of file build.h.

Referenced by FormatProgressStatus(), and PrintStatus().

LinePrinter BuildStatus::printer_
private

Prints progress output.

Definition at line 225 of file build.h.

Referenced by BuildEdgeFinished(), BuildEdgeStarted(), BuildFinished(), BuildStatus(), and PrintStatus().

const char* BuildStatus::progress_status_format_
private

The custom progress status format to use.

Definition at line 228 of file build.h.

Referenced by BuildStatus(), and PrintStatus().

RunningEdgeMap BuildStatus::running_edges_
private

Definition at line 222 of file build.h.

Referenced by BuildEdgeFinished(), and BuildEdgeStarted().

int64_t BuildStatus::start_time_millis_
private

Time the build started.

Definition at line 216 of file build.h.

Referenced by BuildEdgeFinished(), and BuildEdgeStarted().

int BuildStatus::started_edges_
private

Definition at line 218 of file build.h.

Referenced by BuildEdgeStarted(), and FormatProgressStatus().

int BuildStatus::total_edges_
private

Definition at line 218 of file build.h.

Referenced by FormatProgressStatus(), and PlanHasTotalEdges().


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