Ninja
RealCommandRunner Struct Reference
Inheritance diagram for RealCommandRunner:

Public Member Functions

void Abort () override
 
size_t CanRunMore () const override
 
void ClearJobTokens ()
 
std::vector< Edge * > GetActiveEdges () override
 
 RealCommandRunner (const BuildConfig &config, Jobserver::Client *jobserver)
 
bool StartCommand (Edge *edge) override
 
bool WaitForCommand (Result *result) override
 Wait for a command to complete, or return false if interrupted.
 

Static Public Member Functions

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

Public Attributes

const BuildConfigconfig_
 
Jobserver::Clientjobserver_ = nullptr
 
std::map< const Subprocess *, Edge * > subproc_to_edge_
 
SubprocessSet subprocs_
 

Detailed Description

Definition at line 20 of file real_command_runner.cc.

Constructor & Destructor Documentation

◆ RealCommandRunner()

RealCommandRunner::RealCommandRunner ( const BuildConfig & config,
Jobserver::Client * jobserver )
inlineexplicit

Definition at line 21 of file real_command_runner.cc.

References config_, and jobserver_.

Member Function Documentation

◆ Abort()

void RealCommandRunner::Abort ( )
overridevirtual

Reimplemented from CommandRunner.

Definition at line 53 of file real_command_runner.cc.

References ClearJobTokens(), and subprocs_.

◆ CanRunMore()

size_t RealCommandRunner::CanRunMore ( ) const
overridevirtual

Implements CommandRunner.

Definition at line 58 of file real_command_runner.cc.

References config_, GetLoadAverage(), jobserver_, and subprocs_.

◆ ClearJobTokens()

void RealCommandRunner::ClearJobTokens ( )
inline

Definition at line 30 of file real_command_runner.cc.

References GetActiveEdges(), and jobserver_.

Referenced by Abort().

◆ factory()

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

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

std::vector< Edge * > RealCommandRunner::GetActiveEdges ( )
overridevirtual

Reimplemented from CommandRunner.

Definition at line 44 of file real_command_runner.cc.

References subproc_to_edge_.

Referenced by ClearJobTokens().

◆ StartCommand()

bool RealCommandRunner::StartCommand ( Edge * edge)
overridevirtual

◆ WaitForCommand()

bool RealCommandRunner::WaitForCommand ( Result * result)
overridevirtual

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

Implements CommandRunner.

Definition at line 97 of file real_command_runner.cc.

References CommandRunner::Result::edge, Subprocess::Finish(), Subprocess::GetOutput(), CommandRunner::Result::output, CommandRunner::Result::status, subproc_to_edge_, and subprocs_.

Member Data Documentation

◆ config_

const BuildConfig& RealCommandRunner::config_

Definition at line 38 of file real_command_runner.cc.

Referenced by CanRunMore(), and RealCommandRunner().

◆ jobserver_

Jobserver::Client* RealCommandRunner::jobserver_ = nullptr

Definition at line 40 of file real_command_runner.cc.

Referenced by CanRunMore(), ClearJobTokens(), and RealCommandRunner().

◆ subproc_to_edge_

std::map<const Subprocess*, Edge*> RealCommandRunner::subproc_to_edge_

Definition at line 41 of file real_command_runner.cc.

Referenced by GetActiveEdges(), StartCommand(), and WaitForCommand().

◆ subprocs_

SubprocessSet RealCommandRunner::subprocs_

Definition at line 39 of file real_command_runner.cc.

Referenced by Abort(), CanRunMore(), StartCommand(), and WaitForCommand().


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