OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
OS::MachineCommand Class Reference

Encapsulates an actual command to execute + the machine to run it on. More...

Public Member Functions

 MachineCommand (const char *comm=0)
 
 MachineCommand (const char *comm, const char *hnm)
 
const char * command () const
 
void setCommand (const char *cm)
 
const char * hostName () const
 
void setHostName (const char *hnm)
 
const char * remExec () const
 
void setRemExec (const char *sh)
 
bool isBad () const
 
bool setFromSingleStringRep (const char *, bool ignorehostname=false)
 
const char * getSingleStringRep () const
 
bool hasHostName () const
 
BufferString getLocalCommand () const
 
BufferString runAndCollectOutput (BufferString *errmsg=nullptr)
 for quick get-me-the-output-of-this-command More...
 

Static Public Member Functions

static const char * defaultRemExec ()
 
static void setDefaultRemExec (const char *s)
 
static const char * extractHostName (const char *, BufferString &)
 returns remaining part More...
 
static const char * odRemExecCmd ()
 
static const char * sKeyRemoteHost ()
 
static const char * sKeyRemoteCmd ()
 
static const char * sKeyMasterHost ()
 
static const char * sKeyMasterPort ()
 
static const char * sKeyBG ()
 
static const char * sKeyFG ()
 
static const char * sKeyJobID ()
 

Protected Attributes

BufferString comm_
 
BufferString hname_
 
BufferString remexec_
 

Static Protected Attributes

static BufferString defremexec_
 

Detailed Description

Encapsulates an actual command to execute + the machine to run it on.

The default remote execution command is ssh.

Constructor & Destructor Documentation

OS::MachineCommand::MachineCommand ( const char *  comm = 0)

Sets from single string. Assumes that arguments are space separated, and command with spaces in them are properly escaped.

OS::MachineCommand::MachineCommand ( const char *  comm,
const char *  hnm 
)

Member Function Documentation

const char* OS::MachineCommand::command ( ) const
inline
static const char* OS::MachineCommand::defaultRemExec ( )
inlinestatic
static const char* OS::MachineCommand::extractHostName ( const char *  ,
BufferString  
)
static

returns remaining part

BufferString OS::MachineCommand::getLocalCommand ( ) const
const char* OS::MachineCommand::getSingleStringRep ( ) const
bool OS::MachineCommand::hasHostName ( ) const
inline
const char* OS::MachineCommand::hostName ( ) const
inline
bool OS::MachineCommand::isBad ( ) const
inline
static const char* OS::MachineCommand::odRemExecCmd ( )
inlinestatic
const char* OS::MachineCommand::remExec ( ) const
inline
BufferString OS::MachineCommand::runAndCollectOutput ( BufferString errmsg = nullptr)

for quick get-me-the-output-of-this-command

void OS::MachineCommand::setCommand ( const char *  cm)
inline
static void OS::MachineCommand::setDefaultRemExec ( const char *  s)
inlinestatic
bool OS::MachineCommand::setFromSingleStringRep ( const char *  ,
bool  ignorehostname = false 
)
Returns
!isBad(). Assumes that arguments are space separated, and command with spaces in them are properly escaped.
void OS::MachineCommand::setHostName ( const char *  hnm)
inline
void OS::MachineCommand::setRemExec ( const char *  sh)
inline
static const char* OS::MachineCommand::sKeyBG ( )
inlinestatic
static const char* OS::MachineCommand::sKeyFG ( )
inlinestatic
static const char* OS::MachineCommand::sKeyJobID ( )
inlinestatic
static const char* OS::MachineCommand::sKeyMasterHost ( )
inlinestatic
static const char* OS::MachineCommand::sKeyMasterPort ( )
inlinestatic
static const char* OS::MachineCommand::sKeyRemoteCmd ( )
inlinestatic
static const char* OS::MachineCommand::sKeyRemoteHost ( )
inlinestatic

Member Data Documentation

BufferString OS::MachineCommand::comm_
protected
BufferString OS::MachineCommand::defremexec_
staticprotected
BufferString OS::MachineCommand::hname_
protected
BufferString OS::MachineCommand::remexec_
protected

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