Ninja
status.h
Go to the documentation of this file.
1// Copyright 2016 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef NINJA_STATUS_H_
16#define NINJA_STATUS_H_
17
18#include <string>
19#include "exit_status.h"
20
21struct BuildConfig;
22struct Edge;
23struct Explanations;
24
25/// Abstract interface to object that tracks the status of a build:
26/// completion fraction, printing updates.
27struct Status {
28 virtual void EdgeAddedToPlan(const Edge* edge) = 0;
29 virtual void EdgeRemovedFromPlan(const Edge* edge) = 0;
30 virtual void BuildEdgeStarted(const Edge* edge,
31 int64_t start_time_millis) = 0;
32 virtual void BuildEdgeFinished(Edge* edge, int64_t start_time_millis,
33 int64_t end_time_millis, ExitStatus exit_code,
34 const std::string& output) = 0;
35 virtual void BuildStarted() = 0;
36 virtual void BuildFinished() = 0;
37
38 /// Set the Explanations instance to use to report explanations,
39 /// argument can be nullptr if no explanations need to be printed
40 /// (which is the default).
41 virtual void SetExplanations(Explanations*) = 0;
42
43 virtual void Info(const char* msg, ...) = 0;
44 virtual void Warning(const char* msg, ...) = 0;
45 virtual void Error(const char* msg, ...) = 0;
46
47 virtual ~Status() { }
48
49 /// creates the actual implementation
50 static Status* factory(const BuildConfig&);
51};
52
53#endif // NINJA_STATUS_H_
ExitStatus
Definition exit_status.h:27
Options (e.g. verbosity, parallelism) passed to a build.
Definition build.h:176
An edge in the dependency graph; links between Nodes using Rules.
Definition graph.h:175
A class used to record a list of explanation strings associated with a given 'item' pointer.
Abstract interface to object that tracks the status of a build: completion fraction,...
Definition status.h:27
virtual void BuildEdgeStarted(const Edge *edge, int64_t start_time_millis)=0
virtual void BuildStarted()=0
virtual void EdgeRemovedFromPlan(const Edge *edge)=0
virtual void SetExplanations(Explanations *)=0
Set the Explanations instance to use to report explanations, argument can be nullptr if no explanatio...
virtual ~Status()
Definition status.h:47
static Status * factory(const BuildConfig &)
creates the actual implementation
virtual void Warning(const char *msg,...)=0
virtual void BuildEdgeFinished(Edge *edge, int64_t start_time_millis, int64_t end_time_millis, ExitStatus exit_code, const std::string &output)=0
virtual void EdgeAddedToPlan(const Edge *edge)=0
virtual void Error(const char *msg,...)=0
virtual void Info(const char *msg,...)=0
virtual void BuildFinished()=0
signed long long int64_t
A 64-bit integer type.
Definition win32port.h:28