OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
BatchProgram Class Reference

Main object for 'standard' batch programs. More...

Inheritance diagram for BatchProgram:
[legend]

Public Member Functions

const IOParpars () const
 
IOParpars ()
 
const CommandLineParserclParser ()
 
bool go (od_ostream &log_stream)
 This method must be defined by user. More...
 
 mExp (Batch) IOObj *getIOObjFromPars(const char *keybase
 
 mExp (Batch) bool pauseRequested() const
 pause requested (via socket) by master? More...
 
 mExp (Batch) bool errorMsg(const uiString &msg
 
 mExp (Batch) bool infoMsg(const char *msg
 
 mExp (Batch) static void deleteInstance()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject *linkedto)
 
 NamedObject (const NamedObject &)
 
virtual ~NamedObject ()
 
void setLinkedTo (NamedObject *)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual const OD::StringannotName () const
 
virtual void setName (const char *)
 
void setCleanName (const char *)
 cleans string first More...
 
void deleteNotify (const CallBack &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Static Public Member Functions

static const char * sKeyMasterHost ()
 
static const char * sKeyMasterPort ()
 
static const char * sKeyBG ()
 
static const char * sKeyJobID ()
 
static const char * sKeyDataDir ()
 
static const char * sKeyFinishMsg ()
 

Public Attributes

bool mknew
 
bool const IOObjContextctxt
 
bool const IOObjContext bool msgiffail =true) const
 
bool cc_stderr =false)
 
bool cc_stdout =false)
 

Protected Member Functions

 BatchProgram ()
 
 ~BatchProgram ()
 
 mExp (Batch) void init()
 
 mExp (Batch) bool initOutput()
 
 mExp (Batch) void progKilled(CallBacker *)
 
 mExp (Batch) void killNotify(bool yn)
 
JobCommunicmmComm ()
 
int jobId ()
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

bool stillok_
 
bool inbg_
 
StreamDatasdout_
 
IOPariopar_
 
CommandLineParserclparser_
 
BufferStringSet requests_
 
BufferString finishmsg_
 
- Protected Attributes inherited from NamedObject
BufferStringname_
 
NamedObjectlinkedto_
 
CallBackSetdelnotify_
 

Static Protected Attributes

static BatchPrograminst_
 

Private Member Functions

 mODTextTranslationClass (BatchProgram)
 

Private Attributes

JobCommuniccomm_
 
int jobid_
 

Friends

BatchProgramBP ()
 
int Execute_batch (int *, char **)
 

Detailed Description

Main object for 'standard' batch programs.

Most 'interesting' batch programs need a lot of parameters to do the work. Therefore, in OpendTect, BatchPrograms need a 'parameter file', with all the info needed in IOPar format, i.e., keyword/value pairs.

This object takes over the details of reading that file, extracting 'standard' components from the parameters, opening sockets etc.,

To use the object, instead of defining a function 'main', you should define the function 'BatchProgram::go'.

If you need argc and/or argv outside go(), the BP() singleton instance can be accessed.

Constructor & Destructor Documentation

BatchProgram::BatchProgram ( )
protected
BatchProgram::~BatchProgram ( )
protected

Member Function Documentation

const CommandLineParser& BatchProgram::clParser ( )
inline
bool BatchProgram::go ( od_ostream log_stream)

This method must be defined by user.

int BatchProgram::jobId ( )
inlineprotected
BatchProgram::mExp ( Batch  ) const
BatchProgram::mExp ( Batch  ) const

pause requested (via socket) by master?

BatchProgram::mExp ( Batch  ) const
BatchProgram::mExp ( Batch  ) const
BatchProgram::mExp ( Batch  )
BatchProgram::mExp ( Batch  )
protected
BatchProgram::mExp ( Batch  )
protected
BatchProgram::mExp ( Batch  )
protected
BatchProgram::mExp ( Batch  )
protected
JobCommunic* BatchProgram::mmComm ( )
inlineprotected
BatchProgram::mODTextTranslationClass ( BatchProgram  )
private
const IOPar& BatchProgram::pars ( ) const
inline
IOPar& BatchProgram::pars ( )
inline
static const char* BatchProgram::sKeyBG ( )
static
static const char* BatchProgram::sKeyDataDir ( )
inlinestatic
static const char* BatchProgram::sKeyFinishMsg ( )
inlinestatic
static const char* BatchProgram::sKeyJobID ( )
static
static const char* BatchProgram::sKeyMasterHost ( )
static
static const char* BatchProgram::sKeyMasterPort ( )
static

Friends And Related Function Documentation

BatchProgram& BP ( )
friend
int Execute_batch ( int *  ,
char **   
)
friend

Member Data Documentation

bool BatchProgram::cc_stderr =false)
bool BatchProgram::cc_stdout =false)
CommandLineParser* BatchProgram::clparser_
protected
JobCommunic* BatchProgram::comm_
private
bool const IOObjContext& BatchProgram::ctxt
BufferString BatchProgram::finishmsg_
protected
bool BatchProgram::inbg_
protected
BatchProgram* BatchProgram::inst_
staticprotected
IOPar* BatchProgram::iopar_
protected
int BatchProgram::jobid_
private
bool BatchProgram::mknew
bool const IOObjContext bool BatchProgram::msgiffail =true) const
BufferStringSet BatchProgram::requests_
protected
StreamData& BatchProgram::sdout_
protected
bool BatchProgram::stillok_
protected

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