OpendTect  7.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
OS::CommandLauncher Class Reference

Launches machine commands. More...

Public Member Functions

 CommandLauncher (const MachineCommand &)
 
 ~CommandLauncher ()
 
uiString errorMsg () const
 
bool execute (BufferString &output_stdout, BufferString *output_stderr=nullptr, const char *workdir=nullptr)
 run &, wait until finished, catch output More...
 
bool execute (const CommandExecPars &)
 
bool execute (LaunchType lt=Wait4Finish, const char *workdir=nullptr)
 
int exitCode () const
 
od_istreamgetStdError ()
 
od_ostreamgetStdInput ()
 
od_istreamgetStdOutput ()
 
const char * monitorFileName () const
 
PID_Type processID () const
 
void set (const MachineCommand &)
 
bool startServer (bool inpythonenv=false, const char *stdoutfnm=nullptr, const char *stderrfnm=nullptr, double maxwaittm=20)
 

Static Public Member Functions

static bool openTerminal (const char *cmd, const BufferStringSet *args=nullptr, BufferString *errmsg=nullptr, uiString *launchermsg=nullptr, const char *workdir=nullptr)
 

Protected Member Functions

int catchError ()
 
bool doExecute (const MachineCommand &, const CommandExecPars &)
 
void reset ()
 
bool startDetached (const MachineCommand &, bool inconsole=false, const char *workingdir=nullptr)
 
void startMonitor ()
 

Static Protected Member Functions

static void manageQProcess (QProcess *)
 

Protected Attributes

uiString errmsg_
 
MachineCommand machcmd_
 
BufferString monitorfnm_
 
const BufferString odprogressviewer_
 
PID_Type pid_
 
QProcess * process_
 
BufferString progvwrcmd_
 
od_istreamstderror_
 
qstreambufstderrorbuf_
 
od_ostreamstdinput_
 
qstreambufstdinputbuf_
 
od_istreamstdoutput_
 
qstreambufstdoutputbuf_
 

Detailed Description

Launches machine commands.

<>

Constructor & Destructor Documentation

◆ CommandLauncher()

OS::CommandLauncher::CommandLauncher ( const MachineCommand )

◆ ~CommandLauncher()

OS::CommandLauncher::~CommandLauncher ( )

Member Function Documentation

◆ catchError()

int OS::CommandLauncher::catchError ( )
protected

◆ doExecute()

bool OS::CommandLauncher::doExecute ( const MachineCommand ,
const CommandExecPars  
)
protected

◆ errorMsg()

uiString OS::CommandLauncher::errorMsg ( ) const
inline

◆ execute() [1/3]

bool OS::CommandLauncher::execute ( BufferString output_stdout,
BufferString output_stderr = nullptr,
const char *  workdir = nullptr 
)

run &, wait until finished, catch output

◆ execute() [2/3]

bool OS::CommandLauncher::execute ( const CommandExecPars )

◆ execute() [3/3]

bool OS::CommandLauncher::execute ( LaunchType  lt = Wait4Finish,
const char *  workdir = nullptr 
)

◆ exitCode()

int OS::CommandLauncher::exitCode ( ) const

◆ getStdError()

od_istream* OS::CommandLauncher::getStdError ( )
inline

◆ getStdInput()

od_ostream* OS::CommandLauncher::getStdInput ( )
inline

◆ getStdOutput()

od_istream* OS::CommandLauncher::getStdOutput ( )
inline

◆ manageQProcess()

static void OS::CommandLauncher::manageQProcess ( QProcess *  )
staticprotected

Add a QProcess and it will be deleted one day.

◆ monitorFileName()

const char* OS::CommandLauncher::monitorFileName ( ) const
inline

◆ openTerminal()

static bool OS::CommandLauncher::openTerminal ( const char *  cmd,
const BufferStringSet args = nullptr,
BufferString errmsg = nullptr,
uiString launchermsg = nullptr,
const char *  workdir = nullptr 
)
static

◆ processID()

PID_Type OS::CommandLauncher::processID ( ) const

◆ reset()

void OS::CommandLauncher::reset ( )
protected

◆ set()

void OS::CommandLauncher::set ( const MachineCommand )

◆ startDetached()

bool OS::CommandLauncher::startDetached ( const MachineCommand ,
bool  inconsole = false,
const char *  workingdir = nullptr 
)
protected

◆ startMonitor()

void OS::CommandLauncher::startMonitor ( )
protected

◆ startServer()

bool OS::CommandLauncher::startServer ( bool  inpythonenv = false,
const char *  stdoutfnm = nullptr,
const char *  stderrfnm = nullptr,
double  maxwaittm = 20 
)

Member Data Documentation

◆ errmsg_

uiString OS::CommandLauncher::errmsg_
protected

◆ machcmd_

MachineCommand OS::CommandLauncher::machcmd_
protected

◆ monitorfnm_

BufferString OS::CommandLauncher::monitorfnm_
protected

◆ odprogressviewer_

const BufferString OS::CommandLauncher::odprogressviewer_
protected

◆ pid_

PID_Type OS::CommandLauncher::pid_
protected

◆ process_

QProcess* OS::CommandLauncher::process_
protected

◆ progvwrcmd_

BufferString OS::CommandLauncher::progvwrcmd_
protected

◆ stderror_

od_istream* OS::CommandLauncher::stderror_
protected

◆ stderrorbuf_

qstreambuf* OS::CommandLauncher::stderrorbuf_
protected

◆ stdinput_

od_ostream* OS::CommandLauncher::stdinput_
protected

◆ stdinputbuf_

qstreambuf* OS::CommandLauncher::stdinputbuf_
protected

◆ stdoutput_

od_istream* OS::CommandLauncher::stdoutput_
protected

◆ stdoutputbuf_

qstreambuf* OS::CommandLauncher::stdoutputbuf_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024