OpendTect  6.3
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 NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
virtual bool isCapsule () const
 
void stopReceivingNotifications () const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual BufferString getName () const
 
virtual void setName (const char *nm)
 
bool getNameFromPar (const IOPar &)
 
void putNameInPar (IOPar &) const
 

Static Public Member Functions

static const char * sKeyDataDir ()
 
static const char * sKeyFinishMsg ()
 
static bool doImport (od_ostream &strm, IOPar &iop, bool is2d)
 
static bool doExport (od_ostream &strm, IOPar &iop, bool is2d)
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

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 NamedCallBacker
void sendDelNotif () const
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 

Protected Attributes

bool stillok_
 
bool inbg_
 
StreamDatasdout_
 
IOPariopar_
 
CommandLineParserclparser_
 
BufferStringSet requests_
 
- Protected Attributes inherited from NamedCallBacker
Notifier< NamedCallBackerdelnotif_
 
Threads::Atomic< bool > delalreadytriggered_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

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
static bool BatchProgram::doExport ( od_ostream strm,
IOPar iop,
bool  is2d 
)
static
static bool BatchProgram::doImport ( od_ostream strm,
IOPar iop,
bool  is2d 
)
static
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::sKeyDataDir ( )
inlinestatic
static const char* BatchProgram::sKeyFinishMsg ( )
inlinestatic

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
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. 2017