OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Batch::JobDispatcher Class Referenceabstract

Base class (with factory) for methods to kick-off an OD batch job. More...

Inheritance diagram for Batch::JobDispatcher:
[legend]

Public Member Functions

 JobDispatcher ()
 
virtual ~JobDispatcher ()
 
virtual uiString description () const =0
 
virtual bool isSuitedFor (const char *prognm) const =0
 
virtual bool canHandle (const JobSpec &) const
 
virtual bool canResume (const JobSpec &) const
 
bool go (const JobSpec &)
 
uiString errMsg () const
 
 mDefineFactoryInClass (JobDispatcher, factory)
 
void setToDefParFileName ()
 
void setJobName (const char *)
 
BufferString jobName () const
 

Static Public Member Functions

static void getDefParFilename (const char *prognm, BufferString &)
 
static void getJobNames (BufferStringSet &)
 
static BufferString getJobName (const char *)
 
static void setUserWantsResume (IOPar &, bool)
 
static bool userWantsResume (const IOPar &)
 

Public Attributes

JobSpec jobspec_
 
BufferString parfnm_
 

Protected Member Functions

virtual bool init ()
 
virtual bool launch ()=0
 
bool writeParFile () const
 

Protected Attributes

uiString errmsg_
 

Private Member Functions

 mODTextTranslationClass (JobDispatcher)
 

Detailed Description

Base class (with factory) for methods to kick-off an OD batch job.

Subclasses are expected to be ranging from simple single-prcess starters to elaborate cluster-based job splitting monsters.

isSuitedFor() determines whether a certain type of dispatcher can handle any job for this program. canHandle() decides on the whole JobSpec. If the job creates intermediate results, then it may be able to resume after the user has stopped. In that case, canResume() can return true.

Every job will sooner or later be written to a par file. We want to have user select job names, not par file names. Thus, there are both job names and the actual parameter file full path. Par files are written to, and expected to be in the 'Proc' directory. If that is the case, than job name <-> par file goes both ways.

Constructor & Destructor Documentation

Batch::JobDispatcher::JobDispatcher ( )
inline
virtual Batch::JobDispatcher::~JobDispatcher ( )
inlinevirtual

Member Function Documentation

virtual bool Batch::JobDispatcher::canHandle ( const JobSpec ) const
virtual
virtual bool Batch::JobDispatcher::canResume ( const JobSpec ) const
inlinevirtual
virtual uiString Batch::JobDispatcher::description ( ) const
pure virtual
uiString Batch::JobDispatcher::errMsg ( ) const
inline
static void Batch::JobDispatcher::getDefParFilename ( const char *  prognm,
BufferString  
)
static
static BufferString Batch::JobDispatcher::getJobName ( const char *  )
static
static void Batch::JobDispatcher::getJobNames ( BufferStringSet )
static
bool Batch::JobDispatcher::go ( const JobSpec )
virtual bool Batch::JobDispatcher::init ( )
inlineprotectedvirtual
virtual bool Batch::JobDispatcher::isSuitedFor ( const char *  prognm) const
pure virtual
BufferString Batch::JobDispatcher::jobName ( ) const
inline
virtual bool Batch::JobDispatcher::launch ( )
protectedpure virtual
Batch::JobDispatcher::mDefineFactoryInClass ( JobDispatcher  ,
factory   
)
Batch::JobDispatcher::mODTextTranslationClass ( JobDispatcher  )
private
void Batch::JobDispatcher::setJobName ( const char *  )
void Batch::JobDispatcher::setToDefParFileName ( )
inline
static void Batch::JobDispatcher::setUserWantsResume ( IOPar ,
bool   
)
static
static bool Batch::JobDispatcher::userWantsResume ( const IOPar )
static
bool Batch::JobDispatcher::writeParFile ( ) const
protected

Member Data Documentation

uiString Batch::JobDispatcher::errmsg_
mutableprotected
JobSpec Batch::JobDispatcher::jobspec_
BufferString Batch::JobDispatcher::parfnm_

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