QGIS API Documentation
3.0.2-Girona (307d082)
|
Registry for various processing components, including providers, algorithms and various parameters and outputs. More...
#include <qgsprocessingregistry.h>
Signals | |
void | providerAdded (const QString &id) |
Emitted when a provider has been added to the registry. More... | |
void | providerRemoved (const QString &id) |
Emitted when a provider is removed from the registry. More... | |
Public Member Functions | |
QgsProcessingRegistry (QObject *parent=nullptr) | |
Constructor for QgsProcessingRegistry. More... | |
QgsProcessingRegistry (const QgsProcessingRegistry &other)=delete | |
Registry cannot be copied. More... | |
~QgsProcessingRegistry () override | |
bool | addProvider (QgsProcessingProvider *provider) |
Add a processing provider to the registry. More... | |
const QgsProcessingAlgorithm * | algorithmById (const QString &id) const |
Finds an algorithm by its ID. More... | |
QList< const QgsProcessingAlgorithm * > | algorithms () const |
Returns a list of all available algorithms from registered providers. More... | |
QgsProcessingAlgorithm * | createAlgorithmById (const QString &id, const QVariantMap &configuration=QVariantMap()) const |
Creates a new instance of an algorithm by its ID. More... | |
QgsProcessingRegistry & | operator= (const QgsProcessingRegistry &other)=delete |
Registry cannot be copied. More... | |
QgsProcessingProvider * | providerById (const QString &id) |
Returns a matching provider by provider ID. More... | |
QList< QgsProcessingProvider * > | providers () const |
Get list of available providers. More... | |
bool | removeProvider (QgsProcessingProvider *provider) |
Removes a provider implementation from the registry (the provider object is deleted). More... | |
bool | removeProvider (const QString &providerId) |
Removes a provider implementation from the registry (the provider object is deleted). More... | |
Registry for various processing components, including providers, algorithms and various parameters and outputs.
QgsProcessingRegistry is not usually directly created, but rather accessed through QgsApplication::processingRegistry().
Definition at line 36 of file qgsprocessingregistry.h.
QgsProcessingRegistry::QgsProcessingRegistry | ( | QObject * | parent = nullptr | ) |
Constructor for QgsProcessingRegistry.
Definition at line 21 of file qgsprocessingregistry.cpp.
|
override |
Definition at line 25 of file qgsprocessingregistry.cpp.
|
delete |
Registry cannot be copied.
bool QgsProcessingRegistry::addProvider | ( | QgsProcessingProvider * | provider | ) |
Add a processing provider to the registry.
Ownership of the provider is transferred to the registry, and the provider's parent will be set to the registry. Returns false if the provider could not be added (eg if a provider with a duplicate ID already exists in the registry). Adding a provider to the registry automatically triggers the providers QgsProcessingProvider::load() method to populate the provider with algorithms.
Definition at line 33 of file qgsprocessingregistry.cpp.
const QgsProcessingAlgorithm * QgsProcessingRegistry::algorithmById | ( | const QString & | id | ) | const |
Finds an algorithm by its ID.
If no matching algorithm is found, a nullptr is returned.
Definition at line 97 of file qgsprocessingregistry.cpp.
QList< const QgsProcessingAlgorithm *> QgsProcessingRegistry::algorithms | ( | ) | const |
Returns a list of all available algorithms from registered providers.
Definition at line 86 of file qgsprocessingregistry.cpp.
QgsProcessingAlgorithm * QgsProcessingRegistry::createAlgorithmById | ( | const QString & | id, |
const QVariantMap & | configuration = QVariantMap() |
||
) | const |
Creates a new instance of an algorithm by its ID.
If no matching algorithm is found, a nullptr is returned. Callers take responsibility for deleting the returned object.
The configuration argument allows passing of a map of configuration settings to the algorithm, allowing it to dynamically adjust its initialized parameters and outputs according to this configuration. This is generally used only for algorithms in a model, allowing them to adjust their behavior at run time according to some user configuration.
Definition at line 118 of file qgsprocessingregistry.cpp.
|
delete |
Registry cannot be copied.
|
signal |
Emitted when a provider has been added to the registry.
QgsProcessingProvider * QgsProcessingRegistry::providerById | ( | const QString & | id | ) |
Returns a matching provider by provider ID.
Definition at line 81 of file qgsprocessingregistry.cpp.
|
signal |
Emitted when a provider is removed from the registry.
|
inline |
Get list of available providers.
Definition at line 57 of file qgsprocessingregistry.h.
bool QgsProcessingRegistry::removeProvider | ( | QgsProcessingProvider * | provider | ) |
Removes a provider implementation from the registry (the provider object is deleted).
Returns false if the provider could not be removed (eg provider does not exist in the registry).
Definition at line 58 of file qgsprocessingregistry.cpp.
bool QgsProcessingRegistry::removeProvider | ( | const QString & | providerId | ) |
Removes a provider implementation from the registry (the provider object is deleted).
Returns false if the provider could not be removed (eg provider does not exist in the registry).
Definition at line 75 of file qgsprocessingregistry.cpp.