OpendTect  6.3
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Executor Class Referenceabstract

Specification to enable chunkwise execution of a process. More...

Inherits SequentialTask.

Inherited by Array1DInterpol, Array2DFilterer< T >, ArrayNDGentleSmoother< T >, Attrib::PosVecOutputGen, Attrib::Processor, BendPointFinder2DGeomSet, DPSMerger, EM::dgbSurfDataReader, EM::dgbSurfDataWriter, EM::Hor2DTo3D, EM::HorizonZTransformer, ExecutorGroup, Hor2DFrom3DCreator, Horizon2DScanner, HorizonScanner, HorizonSorter, JobRunner, LinSolverTask< T >, lmkEMFault3DReader, lmkEMStickSetReader, lmkEMStickSetWriter, PreStack::EventDuplicator, PreStack::EventReader, PreStack::EventWriter, SEGY::FileIndexer, SEGY::ReSorter, SEGY::Scanner, Seis2DCopier, Seis2DFrom3DExtractor, Seis2DLineGetter, Seis2DLineMerger, Seis2DTo3D, Seis::SequentialFSLoader, Seis::SequentialPSLoader, SeisBayesClass, SeisBufReader, SeisCubeCopier, SeisDataPackWriter, SeisEventSnapper, SeisImpBPSIF, SeisImpCBVSFromOtherSurvey, SeisImporter, SeisIOSimple, SeisMerger, SeisPSMerger, SeisRandLineTo2D, SeisSingleTraceProc, SeisStatsCalc, Strat::LayerModelGenerator, Strat::LayModAttribCalc, StratSynthExporter, Table::Converter, UnZipper, VolProc::ChainExecutor, VolProc::ChainOutput, WaveletExtractor, Well::InfoCollector, Well::LogDataExtracter, Well::SimpleTrackSampler, Well::TrackSampler, WellTie::SeismicExtractor, and Zipper.

Public Member Functions

 Executor (const char *nm)
 
virtual ~Executor ()
 
virtual int doStep ()
 
bool go (od_ostream *s=0, bool isfirst=true, bool islast=true, int delaybtwnstepsinms=0)
 
bool go (od_ostream &s, bool isfirst=true, bool islast=true, int delaybtwnstepsinms=0)
 
virtual bool execute ()
 
virtual uiString message () const =0
 
virtual uiString nrDoneText () const =0
 
virtual int64_t nrDone () const =0
 
- Public Member Functions inherited from SequentialTask
 SequentialTask (const char *nm=0)
 
virtual ~SequentialTask ()
 
void setProgressMeter (ProgressMeter *)
 Must be called before execute() More...
 
ProgressMeterprogressMeter ()
 
const ProgressMeterprogressMeter () const
 
bool execute ()
 
- Public Member Functions inherited from Task
virtual ~Task ()
 
virtual int64_t totalNr () const
 
virtual uiRetVal errorWithDetails () const
 
virtual void enableWorkControl (bool=true)
 Must be called before execute() More...
 
bool workControlEnabled () const
 
virtual void controlWork (Control)
 
virtual Control getState () const
 
- 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
 

Public Attributes

Notifier< Executorprestep
 
Notifier< Executorpoststep
 Only when MoreToDo will be returned. More...
 

Protected Member Functions

virtual bool goImpl (od_ostream *, bool, bool, int)
 
- Protected Member Functions inherited from SequentialTask
virtual int nextStep ()=0
 
- Protected Member Functions inherited from Task
 Task (const char *nm=0)
 
virtual bool shouldContinue ()
 
- 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...
 

Additional Inherited Members

- Public Types inherited from Task
enum  Control { Run, Pause, Stop }
 
- Static Public Member Functions inherited from SequentialTask
static int ErrorOccurred ()
 
static int Finished ()
 
static int MoreToDo ()
 
static int WarningAvailable ()
 
- Static Public Member Functions inherited from Task
static uiString stdMessage ()
 
static uiString stdNrDoneText ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Protected Attributes inherited from SequentialTask
ProgressMeterprogressmeter_
 
int lastupdate_
 
- Protected Attributes inherited from Task
Control control_
 
Threads::ConditionVarworkcontrolcondvar_
 
- Protected Attributes inherited from NamedCallBacker
Notifier< NamedCallBackerdelnotif_
 
Threads::Atomic< bool > delalreadytriggered_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Detailed Description

Specification to enable chunkwise execution of a process.

Interface enabling separation of the control of execution of any process from what actually is going on. The work is done by calling the doStep() method until either ErrorOccurred or Finished is returned. To enable logging and/or communication with the user, two types of info can be made available (the methods will be called before the step is executed). Firstly, a message. Secondly, info on the progress. It is common that Executors are combined to a new Executor object. This is the most common reason why totalNr() can change.

If doStep returns -1 (Failure) the error message should be in message().

The execute() utility executes the process while logging message() etc. to a stream. Useful in batch situations.

Constructor & Destructor Documentation

Executor::Executor ( const char *  nm)
inline
virtual Executor::~Executor ( )
inlinevirtual

Member Function Documentation

virtual int Executor::doStep ( )
virtual
Return values
MoreToDo()Not finished. Call me again.
Finished()Nothing more to do.
ErrorOccurred()Something went wrong.
Note
if function returns a value greater than cMoreToDo(), it should be interpreted as cMoreToDo().

Reimplemented from SequentialTask.

virtual bool Executor::execute ( )
inlinevirtual

Implements Task.

bool Executor::go ( od_ostream s = 0,
bool  isfirst = true,
bool  islast = true,
int  delaybtwnstepsinms = 0 
)
inline
bool Executor::go ( od_ostream s,
bool  isfirst = true,
bool  islast = true,
int  delaybtwnstepsinms = 0 
)
inline
virtual bool Executor::goImpl ( od_ostream ,
bool  ,
bool  ,
int   
)
protectedvirtual
virtual uiString Executor::message ( ) const
pure virtual
virtual int64_t Executor::nrDone ( ) const
pure virtual
virtual uiString Executor::nrDoneText ( ) const
pure virtual

Member Data Documentation

Notifier<Executor> Executor::poststep

Only when MoreToDo will be returned.

Notifier<Executor> Executor::prestep

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