Ninja
CommandRunner Struct Referenceabstract

CommandRunner is an interface that wraps running the build subcommands. More...

#include <build.h>

Inheritance diagram for CommandRunner:

Classes

struct  Result
 The result of waiting for a command. More...
 

Public Member Functions

virtual void Abort ()
 
virtual size_t CanRunMore () const =0
 
virtual std::vector< Edge * > GetActiveEdges ()
 
virtual bool StartCommand (Edge *edge)=0
 
virtual bool WaitForCommand (Result *result)=0
 Wait for a command to complete, or return false if interrupted.
 
virtual ~CommandRunner ()
 

Static Public Member Functions

static CommandRunnerfactory (const BuildConfig &config, Jobserver::Client *jobserver)
 Creates the RealCommandRunner.
 

Detailed Description

CommandRunner is an interface that wraps running the build subcommands.

This allows tests to abstract out running commands. RealCommandRunner is an implementation that actually runs commands.

Definition at line 150 of file build.h.

Constructor & Destructor Documentation

◆ ~CommandRunner()

virtual CommandRunner::~CommandRunner ( )
inlinevirtual

Definition at line 151 of file build.h.

Member Function Documentation

◆ Abort()

virtual void CommandRunner::Abort ( )
inlinevirtual

Reimplemented in FakeCommandRunner, and RealCommandRunner.

Definition at line 167 of file build.h.

◆ CanRunMore()

virtual size_t CommandRunner::CanRunMore ( ) const
pure virtual

Implemented in FakeCommandRunner, and RealCommandRunner.

◆ factory()

CommandRunner * CommandRunner::factory ( const BuildConfig & config,
Jobserver::Client * jobserver )
static

Creates the RealCommandRunner.

  • jobserver can be nullptr if there is no jobserver pool to use.

Definition at line 117 of file real_command_runner.cc.

Referenced by Builder::Build().

◆ GetActiveEdges()

virtual std::vector< Edge * > CommandRunner::GetActiveEdges ( )
inlinevirtual

Reimplemented in FakeCommandRunner, and RealCommandRunner.

Definition at line 166 of file build.h.

◆ StartCommand()

virtual bool CommandRunner::StartCommand ( Edge * edge)
pure virtual

Implemented in FakeCommandRunner, and RealCommandRunner.

◆ WaitForCommand()

virtual bool CommandRunner::WaitForCommand ( Result * result)
pure virtual

Wait for a command to complete, or return false if interrupted.

Implemented in FakeCommandRunner, and RealCommandRunner.


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