| OpendTect 8.0

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
Executor Class Reference
Basic

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

`#include <executor.h>`

Inherits SequentialTask.

Inherited by Array1DInterpol, Array2DFilterer< T >, ArrayNDGentleSmoother< T >, Attrib::PosVecOutputGen, Attrib::Processor, DPSMerger, DZT::Importer, EM::Hor2DTo3D, EM::HorizonZTransformer, EM::SurfaceT2DTransformer, EM::ZMapImporter, EM::dgbSurfDataReader, EM::dgbSurfDataWriter, ExecutorGroup, Geometry::BulkFaultBinIDSurfaceIntersector, Hor2DFrom3DCreator, Horizon2DScanner, HorizonScanner, HorizonSorter, IsochronMaker, JobRunner, LASWriter, LinSolverTask< T >, MultiWellCopier, MultiWellReader, MultiWellWriter, ODMad::ProcExec, PreStack::EventDuplicator, PreStack::EventReader, PreStack::EventWriter, SEGY::FileIndexer, SEGY::ReSorter, SEGY::Scanner, Seis2DCopier, Seis2DFrom3DExtractor, Seis2DLineGetter, Seis2DLineMerger, Seis2DTo3D, Seis2DTo3DInterPol, Seis::SequentialReader, SeisBayesClass, SeisBufReader, SeisCubeCopier, SeisDataPackWriter, SeisEventSnapper, SeisIOSimple, SeisImpBPSIF, SeisImpCBVSFromOtherSurvey, SeisImporter, SeisInterpol, SeisMerger, SeisPSMerger, SeisRandLineTo2D, SeisScanner, SeisSingleTraceProc, Strat::LayModAttribCalc, Strat::LayerModelGenerator, StratAmpCalc, StratSynth::Exporter, Table::Converter, Tut::HorTool, Tut::SeisTools, VolProc::ChainExecutor, VolProc::ChainOutput, WaveletExtractor, Well::DatabaseUpdater, Well::InfoCollector, Well::LogDataExtracter, Well::SimpleTrackSampler, Well::TrackSampler, WellTie::SeismicExtractor, lmkEMFault3DReader, lmkEMFault3DWriter, lmkEMStickSetReader, and lmkEMStickSetWriter.

## Public Member Functions
| Executor (const char *nm)
virtual | ~Executor ()
int | doStep () override
bool | execute () override
bool | go (od_ostream &s, bool isfirst=true, bool islast=true, int delaybtwnstepsinms=0)
bool | go (od_ostream *s=0, bool isfirst=true, bool islast=true, int delaybtwnstepsinms=0)
Public Member Functions inherited from SequentialTask
| SequentialTask (const char *nm=nullptr)
virtual | ~SequentialTask ()
bool | execute () override
Public Member Functions inherited from ReportingTask
| ReportingTask (const ReportingTask &)=delete
virtual | ~ReportingTask ()
void | getProgress (const ReportingTask &)
ReportingTask & | operator= (const ReportingTask &)=delete
void | setSimpleMeter (bool yn, int repperc)
int | simpleMeterStep () const
bool | useSimpleMeter () const
Public Member Functions inherited from Task
| Task (const Task &)=delete
virtual | ~Task ()
virtual void | controlWork (Control)
virtual void | enableWorkControl (bool=true)
| Must be called before execute()
virtual uiRetVal | errorWithDetails () const
virtual Control | getState () const
virtual od_int64 | nrDone () const
Task & | operator= (const Task &)=delete
virtual od_int64 | totalNr () const
virtual uiString | uiMessage () const
virtual uiString | uiNrDoneText () const
bool | workControlEnabled () const
Public Member Functions inherited from NamedCallBacker
| NamedCallBacker (const char *nm=nullptr)
| NamedCallBacker (const NamedCallBacker &)=delete
| ~NamedCallBacker ()
virtual Notifier< NamedCallBacker > & | objectToBeDeleted () const
NamedCallBacker & | operator= (const NamedCallBacker &)=delete
bool | operator== (const NamedCallBacker &oth) const
bool | operator== (const NamedObject &oth) 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 | detachAllNotifiers () const
| Call from the destructor of your inherited object.
void | detachCB (const NotifierAccess &, const CallBack &) const
void | detachCB (const NotifierAccess *notif, const CallBack &cb) const
virtual bool | isCapsule () const
bool | isNotifierAttached (const NotifierAccess *) const
| Only for debugging purposes, don't use.
CallBacker & | operator= (const CallBacker &)=delete
void | stopReceivingNotifications () const
virtual CallBacker * | trueCaller ()
Public Member Functions inherited from NamedObject
| NamedObject (const char *nm=nullptr)
| NamedObject (const NamedObject &oth)
virtual | ~NamedObject ()
virtual BufferString | getName () const
bool | getNameFromPar (const IOPar &)
const name_type & | name () const override
NamedObject & | operator= (const NamedObject &)
bool | operator== (const NamedObject &oth) const
virtual void | setName (const char *nm)
Public Member Functions inherited from ObjectWithName
virtual | ~ObjectWithName ()
bool | hasName (const char *nm) const
bool | hasName (const name_type &nm) const
void | putNameInPar (IOPar &) const

## Public Attributes
Notifier< Executor > | poststep
| Only when MoreToDo will be returned.
Notifier< Executor > | prestep
Public Attributes inherited from ReportingTask
Notifier< ReportingTask > | progressUpdated

## Protected Member Functions
virtual bool | goImpl (od_ostream *, bool, bool, int)
Protected Member Functions inherited from SequentialTask
virtual bool | doFinish (bool success, od_ostream *=nullptr)
virtual bool | doPrepare (od_ostream *=nullptr)
virtual int | nextStep ()=0
Protected Member Functions inherited from ReportingTask
| ReportingTask (const char *nm=nullptr)
void | incrementProgress ()
ProgressMeter * | progressMeter () const
void | reportProgressFinished ()
void | reportProgressStarted ()
void | resetProgress ()
void | setProgressMeter (ProgressMeter *) override
| Must be called before execute()
void | updateProgressMeter (bool forced=false, od_int64 *totalnr=0)
void | updateReportedName ()
Protected Member Functions inherited from Task
| Task (const char *nm=nullptr)
virtual bool | shouldContinue ()
Protected Member Functions inherited from NamedCallBacker
void | sendDelNotif () const

## Friends
class | ExecutorGroup

## Additional Inherited Members
Public Types inherited from Task
enum | Control { Run , Pause , Stop }
Public Types inherited from ObjectWithName
typedef OD::String | name_type
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 ReportingTask
static PtrMan< ProgressMeter > | getTextProgressMeter (od_ostream &, const IOPar *iop=nullptr)
static bool | needSimpleLogging (const IOPar &)
static const char * | sKeySimpleLogging ()
static const char * | sKeySimpleLoggingStep ()
Static Public Member Functions inherited from Task
static uiString | uiStdNrDoneText ()
Static Public Member Functions inherited from CallBacker
static void | createReceiverForCurrentThread ()
static void | removeReceiverForCurrentThread ()
Protected Attributes inherited from Task
Control | control_ = Task::Run
Threads::ConditionVar * | workcontrolcondvar_ = nullptr
Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > | delalreadytriggered_
Notifier< NamedCallBacker > | delnotif_
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 uiMessage().

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

<>

## Constructor & Destructor Documentation

## ◆ Executor()

Executor::Executor | ( | const char * | nm | ) |
| inline

## ◆ ~Executor()

virtual Executor::~Executor | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ doStep()

int Executor::doStep | ( |  | ) |
| override 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.

## ◆ execute()

bool Executor::execute | ( |  | ) |
| inline override virtual

Implements Task.

## ◆ go() [1/2]

bool Executor::go | ( | od_ostream & | s,
|  | bool | isfirst = true,
|  | bool | islast = true,
|  | int | delaybtwnstepsinms = 0 )
| inline

## ◆ go() [2/2]

bool Executor::go | ( | od_ostream * | s = 0,
|  | bool | isfirst = true,
|  | bool | islast = true,
|  | int | delaybtwnstepsinms = 0 )
| inline

## ◆ goImpl()

virtual bool Executor::goImpl | ( | od_ostream * | ,
|  | bool | ,
|  | bool | ,
|  | int | )
| protected virtual

Reimplemented in SeisCubeCopier, Seis2DCopier, SeisImporter, Seis::SequentialReader, SeisSingleTraceProc, Strat::LayerModelGenerator, and Tut::SeisTools.

## Friends And Related Symbol Documentation

## ◆ ExecutorGroup

friend class ExecutorGroup
| friend

## Member Data Documentation

## ◆ poststep

Notifier<Executor> Executor::poststep

Only when MoreToDo will be returned.

## ◆ prestep

Notifier<Executor> Executor::prestep

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