18#ifndef QGSPROCESSINGALGRUNNERTASK_H
19#define QGSPROCESSINGALGRUNNERTASK_H
47 const QVariantMap ¶meters,
68 void executed(
bool successful,
const QVariantMap &results );
73 void finished(
bool result )
override;
77 QVariantMap mParameters;
81 std::unique_ptr< QgsProcessingFeedback > mOwnedFeedback;
82 std::unique_ptr< QgsProcessingAlgorithm > mAlgorithm;
bool algorithmCanceled()
Returns true if the algorithm was canceled.
void executed(bool successful, const QVariantMap &results)
Emitted when the algorithm has finished execution.
QgsProcessingAlgRunnerTask(const QgsProcessingAlgorithm *algorithm, const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback=nullptr, QgsTask::Flags flags=QgsTask::CanCancel)
Constructor for QgsProcessingAlgRunnerTask.
Abstract base class for processing algorithms.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
Flags flags() const
Returns the flags associated with the task.
virtual void finished(bool result)
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether ...
virtual bool run()=0
Performs the task's operation.
virtual void cancel()
Notifies the task that it should terminate.
QgsTask(const QString &description=QString(), QgsTask::Flags flags=AllFlags)
Constructor for QgsTask.
@ CanCancel
Task can be canceled.
bool isCanceled() const
Will return true if task should terminate ASAP.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call