Main object for 'standard' batch programs. More...
Public Member Functions | |
| const IOPar & | pars () const |
| IOPar & | pars () |
| int | nrArgs () const |
| const char * | arg (int idx) const |
| const char * | fullPath () const |
| const char * | progName () const |
| bool | go (std::ostream &log_stream) |
| This method must be defined by user. | |
| char ** | argv () |
| int & | argc () |
| int | argc () const |
| int | realArgsStartAt () const |
| BufferStringSet & | cmdLineOpts () |
| IOObj * | getIOObjFromPars (const char *keybase, bool mknew, const IOObjContext &ctxt, bool msgiffail=true) const |
| bool | pauseRequested () const |
| pause requested (via socket) by master? | |
| bool | errorMsg (const char *msg, bool cc_stderr=false) |
| bool | infoMsg (const char *msg, bool cc_stdout=false) |
Static Public Member Functions | |
| static void | deleteInstance () |
Protected Member Functions | |
| BatchProgram () | |
| ~BatchProgram () | |
| void | init (int *, char **) |
| bool | initOutput () |
| void | progKilled (CallBacker *) |
| void | killNotify (bool yn) |
| MMSockCommunic * | mmComm () |
| int | jobId () |
Protected Attributes | |
| int * | pargc |
| char ** | argv_ |
| int | argshift |
| FileNameString | fullpath |
| bool | stillok |
| bool | inbg |
| StreamData & | sdout |
| IOPar * | iopar |
| BufferStringSet | opts |
| BufferString | parversion_ |
| BufferStringSet | requests_ |
| BufferString | finishmsg_ |
Static Protected Attributes | |
| static BatchProgram * | inst_ |
Private Attributes | |
| MMSockCommunic * | comm |
| int | jobid |
Friends | |
| class | MMSockCommunic |
| mGlobal friend BatchProgram & | BP () |
| int | Execute_batch (int *, char **) |
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. etc.
To use the object, instead of defining a function 'main', you should define the function 'BatchProgramgo'.
If you need argc and/or argv outside go(), the BP() singleton instance can be accessed.
| BatchProgram::BatchProgram | ( | ) | [protected] |
| BatchProgram::~BatchProgram | ( | ) | [protected] |
| const char* BatchProgram::arg | ( | int | idx | ) | const [inline] |
| int& BatchProgram::argc | ( | ) | [inline] |
| int BatchProgram::argc | ( | ) | const [inline] |
| char** BatchProgram::argv | ( | ) | [inline] |
| BufferStringSet& BatchProgram::cmdLineOpts | ( | ) | [inline] |
| static void BatchProgram::deleteInstance | ( | ) | [static] |
| bool BatchProgram::errorMsg | ( | const char * | msg, | |
| bool | cc_stderr = false | |||
| ) |
| const char* BatchProgram::fullPath | ( | ) | const [inline] |
| IOObj* BatchProgram::getIOObjFromPars | ( | const char * | keybase, | |
| bool | mknew, | |||
| const IOObjContext & | ctxt, | |||
| bool | msgiffail = true | |||
| ) | const |
| bool BatchProgram::go | ( | std::ostream & | log_stream | ) |
This method must be defined by user.
| bool BatchProgram::infoMsg | ( | const char * | msg, | |
| bool | cc_stdout = false | |||
| ) |
| void BatchProgram::init | ( | int * | , | |
| char ** | ||||
| ) | [protected] |
| bool BatchProgram::initOutput | ( | ) | [protected] |
| int BatchProgram::jobId | ( | ) | [inline, protected] |
| void BatchProgram::killNotify | ( | bool | yn | ) | [protected] |
| MMSockCommunic* BatchProgram::mmComm | ( | ) | [inline, protected] |
| int BatchProgram::nrArgs | ( | ) | const [inline] |
| const IOPar& BatchProgram::pars | ( | ) | const [inline] |
| IOPar& BatchProgram::pars | ( | ) | [inline] |
| bool BatchProgram::pauseRequested | ( | ) | const |
pause requested (via socket) by master?
| void BatchProgram::progKilled | ( | CallBacker * | ) | [protected] |
| const char* BatchProgram::progName | ( | ) | const |
| int BatchProgram::realArgsStartAt | ( | ) | const [inline] |
| mGlobal friend BatchProgram& BP | ( | ) | [friend] |
| int Execute_batch | ( | int * | , | |
| char ** | ||||
| ) | [friend] |
friend class MMSockCommunic [friend] |
int BatchProgram::argshift [protected] |
char** BatchProgram::argv_ [protected] |
MMSockCommunic* BatchProgram::comm [private] |
BufferString BatchProgram::finishmsg_ [protected] |
FileNameString BatchProgram::fullpath [protected] |
bool BatchProgram::inbg [protected] |
BatchProgram* BatchProgram::inst_ [static, protected] |
IOPar* BatchProgram::iopar [protected] |
int BatchProgram::jobid [private] |
BufferStringSet BatchProgram::opts [protected] |
int* BatchProgram::pargc [protected] |
BufferString BatchProgram::parversion_ [protected] |
BufferStringSet BatchProgram::requests_ [protected] |
StreamData& BatchProgram::sdout [protected] |
bool BatchProgram::stillok [protected] |
1.7.1