Workspace 6.21.5
|
An operation that allows the user to create a loop with a built in counter. More...
#include <Workspace/DataExecution/Operations/Builtin/countedloop.h>
Public Member Functions | |
CountedLoop () | |
~CountedLoop () override | |
QString | getHelpPage () const override |
void | setInputNotUpToDate (InputScalar &input) override |
Public Member Functions inherited from ParallelIterationControlOperation< CountedLoop > | |
ParallelIterationControlOperation (const OperationFactory &factory, const QString &opName) | |
Public Member Functions inherited from Operation | |
~Operation () override | |
bool | addInput (Input &input, bool modifiedInPlace=false) |
bool | addOutput (Output &output) |
template<typename T > | |
bool | assignInput (const QString &inputName, const T &value) |
bool | canSerialize () const override |
bool | connectProgressEvents (QProgressBar *progressBar) |
virtual Presentation::CustomOperationProperties * | createCustomPropertiesHandler () |
virtual void | ensureHasData () |
bool | getBroadcastUpdateEvents () const |
QColor | getColor () const |
virtual QString | getDefaultIconPath () const |
QString | getDefaultUiPath () const |
QString | getDeprecationMessage () const |
const QString & | getDescription () const |
SerializedItem | getExtras () |
const OperationFactory & | getFactory () const |
Operation * | getFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const override |
virtual GraphicsSize | getGraphicsSize () const |
virtual QString | getHelpPage () const |
QString | getIconPath () const |
const QUuid & | getId () const |
QString | getIdPath (bool scoped=true) const override |
QString | getIdPath (const Workspace &relativeTo) const |
difference_type | getIndex (const Input &input, IndexCountingOptions options=SkipNone) const |
difference_type | getIndex (const Output &output, IndexCountingOptions options=SkipNone) const |
void | getIndexPair (InputScalar &input, difference_type &mainIndex, difference_type &arrayIndex) |
Input * | getInput (const QString &name) |
const Input * | getInput (const QString &name) const |
Input * | getInput (size_type index) |
const Input * | getInput (size_type index) const |
InputArray * | getInputArray (const QString &name) |
const InputArray * | getInputArray (const QString &name) const |
IOBaseIteratorRange< Input, false > | getInputs () |
IOBaseIteratorRange< Input, true > | getInputs () const |
InputScalar * | getInputScalar (const QString &name) |
const InputScalar * | getInputScalar (const QString &name) const |
template<typename T > | |
T & | getInputValue (const QString &inputName) |
template<typename T > | |
const T & | getInputValue (const QString &inputName) const |
const QString & | getLabel () const |
QString | getLabelRelativeToRoot () const |
Output * | getOutput (const QString &name) |
const Output * | getOutput (const QString &name) const |
Output * | getOutput (size_type index) |
const Output * | getOutput (size_type index) const |
IOBaseIteratorRange< Output, false > | getOutputs () |
IOBaseIteratorRange< Output, true > | getOutputs () const |
template<typename T > | |
T & | getOutputValue (const QString &outputName) |
template<typename T > | |
const T & | getOutputValue (const QString &outputName) const |
bool | getProfilingEnabled () const |
int | getProgress () const |
int | getProgressContribution () const |
bool | getProgressResetByNotUpToDate () const |
virtual SchedulerFeatures | getRequiredSchedulerFeatures () const |
InputScalar * | getScalarInput (size_type mainIndex, difference_type arrayIndex) |
QString | getShortLabel () const |
QString | getTagName () const |
bool | getTerminateExecution () const |
QString | getUiPath () const |
bool | getUpToDate () const override |
virtual bool | hasRequiredSchedulerFeatures () const |
void | idPathChanged () override |
virtual bool | inputRebuilt (InputScalar &input) |
virtual bool | isAsynchronous () const |
virtual bool | isAsynchronousProcess () const |
virtual bool | isAtomicUpdate () const |
bool | isConnectedToAsynchronous () const override |
bool | isDeprecated () const |
bool | isEditable () const |
bool | isIdPathCachingEnabled () const |
virtual bool | isPolymorphicType () const |
virtual bool | isRunningAsynchronously () const |
virtual bool | isThreadSafe () const |
template<typename T > | |
bool | isType () const |
bool | isType (const OperationFactory &type) const |
bool | isUpdating () const |
virtual bool | isUserConfigurable () |
bool | isUsingDefaultColor () const |
bool | isUsingDefaultIconPath () const |
bool | isUsingDefaultUiPath () const |
bool | isWaitingForAsynchronousUpdate () const override |
bool | isWorkspaceType () const |
bool | load (const SerializedItem &item) override |
void | markUpToDateWhereSafe () |
bool | matchesType (const Operation &otherOperation) const |
size_type | numInputs (IndexCountingOptions=SkipNone) const |
size_type | numOutputs (IndexCountingOptions=SkipNone) const |
bool | removeInput (const QString &name) |
bool | removeInput (Input &input) |
bool | removeOutput (const QString &name) |
bool | removeOutput (Output &output) |
virtual void | resetExecutionDependencies () |
bool | save (SerializedItem &item) const override |
virtual bool | saveWithData (SerializedItem &item) const |
virtual void | setAtomicUpdate (bool atomic) |
void | setBroadcastUpdateEvents (bool enable) |
void | setColor (const QColor &c) |
void | setDescription (const QString &description) |
void | setEditable (bool b) |
void | setIconPath (const QString &path) |
void | setId (const QUuid &id) |
virtual void | setIdPathCachingEnabled (bool b) |
virtual void | setInputNotUpToDate (InputScalar &input) |
virtual void | setIsAsynchronous (bool asynchronous) |
virtual void | setIsAsynchronousProcess (bool) |
virtual void | setIsRunningAsynchronously (bool asynchronous) |
void | setLabel (const QString &label) |
virtual void | setOutputNotUpToDate (Output &output) |
void | setProfilingEnabled (bool enable) |
virtual void | setProgress (int percent) |
void | setProgressContribution (int percent) |
void | setProgressResetByNotUpToDate (bool b) |
virtual void | setRequiredSchedulerFeatures (const SchedulerFeatures &) |
void | setTerminateExecution (bool b) |
void | setUiPath (const QString &path) |
void | setUpToDate (bool b) override |
bool | update (Updater *updater=nullptr) override |
Public Member Functions inherited from WorkspaceElement | |
~WorkspaceElement () override | |
const Workspace * | getWorkspace () const override |
Workspace * | getWorkspace () override |
virtual void | workspaceChanged (Workspace *oldWorkspace) |
Public Member Functions inherited from Updatable | |
~Updatable () override | |
virtual bool | comesFromExternal () const |
QString | getEnclosingScope () const |
virtual Updatable * | getFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const =0 |
const QString & | getGlobalName () const |
virtual QString | getIdPath (bool scoped=true) const =0 |
virtual Workspace * | getRootWorkspace () |
virtual const Workspace * | getRootWorkspace () const |
QString | getScopedGlobalName () const |
virtual bool | getUpToDate () const =0 |
virtual const Workspace * | getWorkspace () const =0 |
virtual Workspace * | getWorkspace ()=0 |
virtual void | idPathChanged () |
virtual bool | isConnectedToAsynchronous () const =0 |
virtual bool | isWaitingForAsynchronousUpdate () const =0 |
void | setGlobalName (const QString &name) |
virtual void | setUpToDate (bool b)=0 |
virtual bool | update (Updater *updater=nullptr)=0 |
Public Member Functions inherited from Observable | |
virtual | ~Observable () |
void | attachObserver (Observer &observer) |
void | destroy () |
void | detachObserver (Observer &observer) |
void | notifyEvent (const ObservableEvent &event) |
Public Member Functions inherited from Serialize | |
virtual | ~Serialize ()=default |
virtual bool | canSerialize () const =0 |
virtual bool | load (const SerializedItem &item)=0 |
virtual bool | save (SerializedItem &item) const =0 |
Public Member Functions inherited from TextLogger | |
TextLogger () | |
TextLogger (const DataExecution::IOBase &io) | |
TextLogger (const DataExecution::Operation &operation) | |
TextLogger (const TextLogger &logger) | |
TextLogger (TextLogger &&logger) | |
virtual | ~TextLogger () |
void | logLine (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logLine (const QString &msg) const |
void | logText (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logText (const QString &msg) const |
TextLogger & | operator= (TextLogger) |
Public Member Functions inherited from ParallelIteratingOperation< Derived > | |
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 Member Functions | |
IterationControlParams | getIterationControlParams () const override |
bool | isIterationControlInput (const Input &input) const override |
bool | updateInputsForIteration () override |
Protected Member Functions inherited from ParallelIterationControlOperation< CountedLoop > | |
bool | bringInputsUpToDate () override |
bool | execute () override |
bool | isIterationControlInput (const Input &input) const override |
void | setInputNotUpToDate (InputScalar &input) override |
Protected Member Functions inherited from Operation | |
Operation (const OperationFactory &factory, const QString &label) | |
bool | bringArrayOfInputsUpToDate (Input *&array, size_type arraySize) |
bool | bringArrayOfInputsUpToDate (std::vector< Input * > &array) |
virtual bool | bringInputsUpToDate () |
bool | bringInputUpToDate (Input &input) |
virtual void | cancelExecution (bool b) |
virtual bool | execute ()=0 |
virtual bool | finishInputsOutputsAfterLoad (const SerializedItem &item) |
Updater * | getCurrentUpdater () |
virtual const Input * | getRenamedInput (const QString &name) const |
virtual const Output * | getRenamedOutput (const QString &name) const |
virtual bool | inputsAreUpToDate () const |
virtual bool | makeOutputsValid () |
virtual void | markOutputsUpToDate () |
void | pauseUpdate () |
virtual bool | postSave (SerializedItem &item) const |
virtual bool | prepareInputsOutputsForLoad (const SerializedItem &item) |
void | saveExtras (SerializedItem &item) const |
virtual bool | shouldPutInExtras (const QString &tagName) const |
Protected Member Functions inherited from WorkspaceElement | |
WorkspaceElement () | |
Protected Member Functions inherited from Updatable | |
Updatable () | |
Updatable (const Updatable &up) | |
void | notifyUpdated () |
Updatable & | operator= (const Updatable &up) |
Protected Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Protected Member Functions inherited from ParallelIteratingOperation< Derived > | |
ParallelIteratingOperation () | |
bool | atEndCondition () override |
IteratingOperationBase::ExecutionResult | executeIteration (Workspace *workspaceToExecute) override |
virtual IteratingOperationBase::ExecutionResult | executeIterationInSerial (Workspace *workspaceToExecute, int iterationCounter) noexcept(false)=0 |
bool | isIterationControlInput (const Input &input) const override |
bool | isLoopConditionValid () const override |
void | performCleanup (Workspace *workspaceToExecute, bool forceStop) override |
bool | performInitialisation (Workspace *workspaceToExecute) override |
bool | postIterationExecute () override |
bool | preIterations () override |
virtual Workspace * | selectIterationForOutputAssignment (const WorkspacePool &iterations) const |
void | setNonIterationControlInputsNotUpToDate () override |
void | updateProgress () override |
Protected Member Functions inherited from ParallelIteratingOperationBase | |
ParallelIteratingOperationBase () | |
virtual | ~ParallelIteratingOperationBase ()=default |
int | calcProgress (int startValue, int endValue, int counterValue) |
virtual IterationControlParams | getIterationControlParams () const =0 |
int | getIterationCount () |
void | setMethodDispatcher (ParallelIteratingOperationMethodDispatcher *dispatcher) |
void | sleep (int msec) |
Protected Member Functions inherited from IteratingOperation< Derived > | |
IteratingOperation () | |
~IteratingOperation () override | |
virtual bool | bringInputsUpToDateImpl () |
virtual bool | executeImpl () |
virtual bool | isIterationControlInput (const Input &input) const |
void | performCleanup (Workspace *workspaceToExecute, bool forceStop) override |
bool | performInitialisation (Workspace *workspaceToExecute) override |
bool | preIterations () override |
virtual void | setInputNotUpToDateImpl (InputScalar &input) |
void | setNonIterationControlInputsNotUpToDate () override |
void | terminateExecution () |
bool | updateInputsForIteration () override |
Protected Member Functions inherited from IteratingOperationBase | |
virtual bool | atEndCondition ()=0 |
virtual ExecutionResult | executeIteration (Workspace *workspaceToExecute) noexcept(false)=0 |
Workspace * | getWorkspaceToExecute () |
bool | isExecuting () const |
virtual bool | isLoopConditionValid () const =0 |
virtual void | performCleanup (Workspace *workspaceToExecute, bool forceStop) noexcept(false)=0 |
virtual bool | performInitialisation (Workspace *workspaceToExecute) noexcept(false)=0 |
virtual bool | postIterationExecute () |
virtual bool | preIterations ()=0 |
virtual void | setNonIterationControlInputsNotUpToDate () |
void | setWorkspaceToExecute (Workspace *workspace) |
virtual bool | updateInputsForIteration ()=0 |
virtual void | updateProgress ()=0 |
Additional Inherited Members | |
Public Types inherited from Operation | |
enum | ConfigStatus { GoodConfig = 0x00 , UnknownConfig = 0x01 , InvalidConfig = 0x02 } |
using | difference_type = ptrdiff_t |
enum | GraphicsSize { Default = 100 , Small = 65 } |
Options for the graphical size of an operation, able to be changed by derived classes. Values are percentages. More... | |
enum | IndexCountingOption { SkipNone = 0x0 , SkipInvisible = 0x1 , SkipDependencies = 0x2 } |
using | size_type = size_t |
Public Types inherited from IteratingOperationBase | |
enum | ExecutionResult { Abort , Success , Retry } |
Result of an iteration's execution. More... | |
Static Public Member Functions inherited from Updatable | |
static InputScalar * | findInputScalarGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static IOBase * | findIOBaseGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static Operation * | findOperationGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
Protected Types inherited from ParallelIteratingOperation< Derived > | |
using | IterationObservers = std::map< Workspace *, IterationObserver * > |
typedef std::map< Workspace *, bool > | WorkspacePool |
Protected Attributes inherited from ParallelIterationControlOperation< CountedLoop > | |
SimpleInput< Dependency > | iterationDependency_ |
Protected Attributes inherited from ParallelIteratingOperation< Derived > | |
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_ |
CountedLoop | ( | ) |
The default counted loop starts and ends at 0 and has a step of 1.
|
overridedefault |
|
overridevirtual |
\page helpmyoperation MyOperation
In this case, getHelpPage() should return the string "helpmyoperation".
Reimplemented from Operation.
|
overrideprotectedvirtual |
Implements ParallelIteratingOperationBase.
|
overrideprotectedvirtual |
Reimplemented from IteratingOperation< Derived >.
|
overridevirtual |
input | The input making the requested status change. |
This function is provided so that operations can take special action when a particular input is marked as not up to date. The default implementation marks the whole operation as not up to date by calling setUpToDate(false), but subclasses (notably Workspace) may want to do something more interesting.
Reimplemented from Operation.
|
overrideprotectedvirtual |
Forces derived classes to specify how the iteration's input values are updated for each iteration of the loop. For most operations, this will be as simple as assigning a value to an input or an output (for operation-based iterators) and then flipping its up-to-date status to false, then back to true.
For example, in the counted loop:
*outputCounterValue_ = counterValue; outputCounterValue_.setUpToDate(false); outputCounterValue_.setUpToDate(true);
Implements IteratingOperationBase.