Ninja
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SubprocessSet Struct Reference

SubprocessSet runs a ppoll/pselect() loop around a set of Subprocesses. More...

#include <subprocess.h>

Public Member Functions

SubprocessAdd (const string &command)
 
void Clear ()
 
bool DoWork ()
 
SubprocessNextFinished ()
 
 SubprocessSet ()
 
 ~SubprocessSet ()
 

Static Public Member Functions

static void SetInterruptedFlag (int signum)
 

Public Attributes

queue< Subprocess * > finished_
 
struct sigaction old_act_
 
sigset_t old_mask_
 
vector< Subprocess * > running_
 

Static Public Attributes

static bool interrupted_
 

Detailed Description

SubprocessSet runs a ppoll/pselect() loop around a set of Subprocesses.

DoWork() waits for any state change in subprocesses; finished_ is a queue of subprocesses as they finish.

Definition at line 74 of file subprocess.h.

Constructor & Destructor Documentation

SubprocessSet::SubprocessSet ( )

Definition at line 148 of file subprocess-posix.cc.

References Fatal(), old_act_, old_mask_, and SetInterruptedFlag().

SubprocessSet::~SubprocessSet ( )

Definition at line 162 of file subprocess-posix.cc.

References Clear(), Fatal(), old_act_, and old_mask_.

Member Function Documentation

Subprocess * SubprocessSet::Add ( const string &  command)

Definition at line 171 of file subprocess-posix.cc.

References running_, and Subprocess::Start().

Referenced by RealCommandRunner::StartCommand().

void SubprocessSet::Clear ( )

Definition at line 279 of file subprocess-posix.cc.

References running_.

Referenced by RealCommandRunner::Abort(), and ~SubprocessSet().

bool SubprocessSet::DoWork ( )

Definition at line 228 of file subprocess-posix.cc.

References finished_, interrupted_, old_mask_, and running_.

Referenced by RealCommandRunner::WaitForCommand().

Subprocess * SubprocessSet::NextFinished ( )

Definition at line 271 of file subprocess-posix.cc.

References finished_.

Referenced by RealCommandRunner::WaitForCommand().

void SubprocessSet::SetInterruptedFlag ( int  signum)
static

Definition at line 143 of file subprocess-posix.cc.

References interrupted_.

Referenced by SubprocessSet().

Member Data Documentation

queue<Subprocess*> SubprocessSet::finished_

Definition at line 84 of file subprocess.h.

Referenced by DoWork(), and NextFinished().

bool SubprocessSet::interrupted_
static

Definition at line 91 of file subprocess.h.

Referenced by DoWork(), and SetInterruptedFlag().

struct sigaction SubprocessSet::old_act_

Definition at line 93 of file subprocess.h.

Referenced by Subprocess::Start(), SubprocessSet(), and ~SubprocessSet().

sigset_t SubprocessSet::old_mask_

Definition at line 94 of file subprocess.h.

Referenced by DoWork(), Subprocess::Start(), SubprocessSet(), and ~SubprocessSet().

vector<Subprocess*> SubprocessSet::running_

Definition at line 83 of file subprocess.h.

Referenced by Add(), RealCommandRunner::CanRunMore(), Clear(), and DoWork().


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