Workspace 6.21.5
|
Interface for iterating over a workflow in parallel using the Workspace scheduling infrastructure. More...
#include <Workspace/DataExecution/Operations/Builtin/paralleliteratingoperation.h>
Public Member Functions | |
void | onIterationAborted (Workspace &) override |
void | onIterationFinished (Workspace &) override |
void | onIterationSuccess (Workspace &) override |
Public Member Functions inherited from ParallelIteratingOperationBase | |
virtual void | onIterationAborted (Workspace &)=0 |
virtual void | onIterationFinished (Workspace &)=0 |
virtual void | onIterationSuccess (Workspace &)=0 |
void | processAbortedIteration (Workspace &) |
Public Member Functions inherited from IteratingOperationBase | |
IteratingOperationBase () | |
virtual | ~IteratingOperationBase ()=default |
Protected Types | |
using | IterationObservers = std::map< Workspace *, IterationObserver * > |
typedef std::map< Workspace *, bool > | WorkspacePool |
Protected Attributes | |
SimpleInput< bool > | enableParallelLooping_ |
IterationObservers | iterationObservers_ |
WorkspacePool | iterationPool_ |
QAtomicInt | remainingIterations_ |
QAtomicInt | runningIterations_ |
Protected Attributes inherited from ParallelIteratingOperationBase | |
int | counterValue_ |
int | endValue_ |
bool | overflowed_ |
int | startValue_ |
int | stepValue_ |
Protected Attributes inherited from IteratingOperation< Derived > | |
SimpleInput< bool > | enableLoop_ |
SimpleInput< bool > | wrap_ |
Protected Attributes inherited from IteratingOperationBase | |
bool | executing_ |
bool | reset_ |
Additional Inherited Members | |
Public Types inherited from IteratingOperationBase | |
enum | ExecutionResult { Abort , Success , Retry } |
Result of an iteration's execution. More... | |
Concrete implementations should extend either Operation or Workspace as well as this interface, and declare this class to be a friend.
|
protected |
|
protected |
|
protected |
|
overrideprotectedvirtual |
Invoked to test the end condition after each loop iteration.
Implements IteratingOperationBase.
|
overrideprotectedvirtual |
workspaceToExecute | The workspace of which to execute an iteration. This will be provided as 'null' if the derived class does not ensure that setWorkspaceToExecute() is invoked prior to execution. It's up to derived classes whether or not this is an error. |
Invoked for each iteration of the workspace under execution. Derived classes can override this to control exactly how this execution occurs. For example, it could execute immediately, or it could be scheduled for future execution.
Implements IteratingOperationBase.
|
protectedpure virtual |
workspaceToExecute | The workspace to execute. May be provided as null if the derived class does not invoke setWorkspaceToExecute() prior to execution. It is up to the derived class whether or not this is an error. |
iterationCounter | The counter of the iteration to execute. |
Derived classes must provide a way to execute in serial as well as parallel.
|
overrideprotectedvirtual |
Reimplemented from IteratingOperation< Derived >.
Reimplemented in ParallelIterationControlOperation< Derived >, and ParallelIterationControlOperation< CountedLoop >.
|
overrideprotectedvirtual |
Derived classes must override this method to specify when a loop termination condition is infinite. Workspace can then terminate the loop with an error if this is achieved. To allow infinite loops, simply return false from this method always.
Implements IteratingOperationBase.
|
overridevirtual |
Implements ParallelIteratingOperationBase.
|
overridevirtual |
Implements ParallelIteratingOperationBase.
|
overridevirtual |
Implements ParallelIteratingOperationBase.
|
overrideprotectedvirtual |
workspaceToExecute | The workspace to execute |
forceStop | Whether or not to force the execution to stop when cleaning up. |
Cleanup opportunity following the attempted execution of iterations. Regardless of how the execution terminates (aborted or successful), this method is invoked.
Reimplemented from IteratingOperation< Derived >.
|
overrideprotectedvirtual |
Initialisation opportunity prior to executing the iterations. This method is invoked using RAII, so its return value cannot be inspected. Therefore if errors occur, exceptions should be thrown.
Reimplemented from IteratingOperation< Derived >.
|
overrideprotectedvirtual |
Invoked immediately following the successful execution of an iteration. Default implementation does nothing, returning true.
Reimplemented from IteratingOperationBase.
|
overrideprotectedvirtual |
Invoked immediately prior to the commencement of any iterations. If 'wrap' is enabled, this will be invoked prior to each set of iterations.
Reimplemented from IteratingOperation< Derived >.
|
protectedvirtual |
finalIterations | Iteration pool containing the set of iterations completed in the last run. |
Selects an iteration from the provided iteration pool from which to assign output values. By default, it simply selects the first iteration it can find. Derived classes can override this to provide some logic, such as finding an iteration that matches some specific criteria.
Alternatively, derived classes may wish to override executeImpl altogether in order to assign some alternative data to the outputs.
|
overrideprotectedvirtual |
Sets the non-iteration-control inputs to not-up-to-date at the beginning of each iteration. Derived classes must override this and may choose to not avail of the functionality or perform it differently depending on the need of the specific derived class.
Invoked immediately following preIterations(). Default implementation does nothing. Override if needed.
Reimplemented from IteratingOperation< Derived >.
|
overrideprotectedvirtual |
Updates its parent operation's progress at the start of each iteration. Derived classes must override this to specify how progress is indicated, as it will change depending on how iteration is computed.
Implements IteratingOperationBase.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |