Android-cuttlefish cvd tool
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cuttlefish::Subprocess Class Reference

#include <subprocess.h>

Public Types

enum class  StdIOChannel { kStdIn = 0 , kStdOut = 1 , kStdErr = 2 }
 

Public Member Functions

 Subprocess (pid_t pid, SubprocessStopper stopper=KillSubprocess)
 
 Subprocess (Subprocess &&)
 
 ~Subprocess ()=default
 
Subprocessoperator= (Subprocess &&)
 
int Wait ()
 
int Wait (siginfo_t *infop, int options)
 
bool Started () const
 
pid_t pid () const
 
StopperResult Stop ()
 
Result< void > SendSignal (int signal)
 
Result< void > SendSignalToGroup (int signal)
 

Private Member Functions

 Subprocess (const Subprocess &)=delete
 
Subprocessoperator= (const Subprocess &)=delete
 

Private Attributes

std::atomic< pid_t > pid_ = -1
 
bool started_ = false
 
SubprocessStopper stopper_
 

Member Enumeration Documentation

◆ StdIOChannel

Enumerator
kStdIn 
kStdOut 
kStdErr 

Constructor & Destructor Documentation

◆ Subprocess() [1/3]

cuttlefish::Subprocess::Subprocess ( pid_t  pid,
SubprocessStopper  stopper = KillSubprocess 
)
inline

◆ Subprocess() [2/3]

cuttlefish::Subprocess::Subprocess ( Subprocess &&  subprocess)

◆ ~Subprocess()

cuttlefish::Subprocess::~Subprocess ( )
default

◆ Subprocess() [3/3]

cuttlefish::Subprocess::Subprocess ( const Subprocess )
privatedelete

Member Function Documentation

◆ operator=() [1/2]

Subprocess & cuttlefish::Subprocess::operator= ( const Subprocess )
privatedelete

◆ operator=() [2/2]

Subprocess & cuttlefish::Subprocess::operator= ( Subprocess &&  other)

◆ pid()

pid_t cuttlefish::Subprocess::pid ( ) const
inline

◆ SendSignal()

Result< void > cuttlefish::Subprocess::SendSignal ( int  signal)

◆ SendSignalToGroup()

Result< void > cuttlefish::Subprocess::SendSignalToGroup ( int  signal)

◆ Started()

bool cuttlefish::Subprocess::Started ( ) const
inline

◆ Stop()

StopperResult cuttlefish::Subprocess::Stop ( )
inline

◆ Wait() [1/2]

int cuttlefish::Subprocess::Wait ( )

◆ Wait() [2/2]

int cuttlefish::Subprocess::Wait ( siginfo_t *  infop,
int  options 
)

Member Data Documentation

◆ pid_

std::atomic<pid_t> cuttlefish::Subprocess::pid_ = -1
private

◆ started_

bool cuttlefish::Subprocess::started_ = false
private

◆ stopper_

SubprocessStopper cuttlefish::Subprocess::stopper_
private

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