Ninja
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
BuildStatus Struct Reference

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

#include <build.h>

List of all members.

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.
void PlanHasTotalEdges (int total)

Private Types

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

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.
const char * progress_status_format_
 The custom progress status format to use.
RunningEdgeMap running_edges_
int64_t start_time_millis_
 Time the build started.
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 
)

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 [inline, private]

Definition at line 231 of file build.h.

Referenced by FormatProgressStatus().


Member Data Documentation

Definition at line 213 of file build.h.

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

Definition at line 280 of file build.h.

Referenced by FormatProgressStatus(), and PrintStatus().

Definition at line 218 of file build.h.

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

Definition at line 279 of file build.h.

Referenced by FormatProgressStatus(), and PrintStatus().

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().

Definition at line 222 of file build.h.

Referenced by BuildEdgeFinished(), and BuildEdgeStarted().

Time the build started.

Definition at line 216 of file build.h.

Referenced by BuildEdgeFinished(), and BuildEdgeStarted().

Definition at line 218 of file build.h.

Referenced by BuildEdgeStarted(), and FormatProgressStatus().

Definition at line 218 of file build.h.

Referenced by FormatProgressStatus(), and PlanHasTotalEdges().


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