QGIS API Documentation  3.8.0-Zanzibar (11aff65)
Signals | Public Member Functions | List of all members
QgsProcessingRegistry Class Reference

Registry for various processing components, including providers, algorithms and various parameters and outputs. More...

#include <qgsprocessingregistry.h>

Inheritance diagram for QgsProcessingRegistry:
Inheritance graph
[legend]

Signals

void parameterTypeAdded (QgsProcessingParameterType *type)
 Emitted when a new parameter type has been added to the registry. More...
 
void parameterTypeRemoved (QgsProcessingParameterType *type)
 Emitted when a parameter type has been removed from the registry and is about to be deleted. More...
 
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 addParameterType (QgsProcessingParameterType *type)
 Register a new parameter type for processing. More...
 
bool addProvider (QgsProcessingProvider *provider)
 Add a processing provider to the registry. More...
 
const QgsProcessingAlgorithmalgorithmById (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...
 
QgsProcessingAlgorithmcreateAlgorithmById (const QString &id, const QVariantMap &configuration=QVariantMap()) const
 Creates a new instance of an algorithm by its ID. More...
 
QgsProcessingRegistryoperator= (const QgsProcessingRegistry &other)=delete
 Registry cannot be copied. More...
 
QgsProcessingParameterTypeparameterType (const QString &id) const
 Returns the parameter type registered for id. More...
 
QList< QgsProcessingParameterType * > parameterTypes () const
 Returns a list with all known parameter types. More...
 
QgsProcessingProviderproviderById (const QString &id)
 Returns a matching provider by provider ID. More...
 
QList< QgsProcessingProvider * > providers () const
 Gets list of available providers. More...
 
void removeParameterType (QgsProcessingParameterType *type)
 Unregister a custom parameter type from processing. 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...
 

Detailed Description

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().

Since
QGIS 3.0

Definition at line 39 of file qgsprocessingregistry.h.

Constructor & Destructor Documentation

◆ QgsProcessingRegistry() [1/2]

QgsProcessingRegistry::QgsProcessingRegistry ( QObject *  parent = nullptr)

Constructor for QgsProcessingRegistry.

Definition at line 22 of file qgsprocessingregistry.cpp.

◆ ~QgsProcessingRegistry()

QgsProcessingRegistry::~QgsProcessingRegistry ( )
override

Definition at line 56 of file qgsprocessingregistry.cpp.

◆ QgsProcessingRegistry() [2/2]

QgsProcessingRegistry::QgsProcessingRegistry ( const QgsProcessingRegistry other)
delete

Registry cannot be copied.

Member Function Documentation

◆ addParameterType()

bool QgsProcessingRegistry::addParameterType ( QgsProcessingParameterType type)

Register a new parameter type for processing.

Ownership is transferred to the registry. Will emit parameterTypeAdded.

See also
removeParameterType
Since
QGIS 3.2

Definition at line 168 of file qgsprocessingregistry.cpp.

◆ addProvider()

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.

See also
removeProvider()

Definition at line 72 of file qgsprocessingregistry.cpp.

◆ algorithmById()

const QgsProcessingAlgorithm * QgsProcessingRegistry::algorithmById ( const QString &  id) const

Finds an algorithm by its ID.

If no matching algorithm is found, nullptr is returned.

See also
algorithms()
createAlgorithmById()

Definition at line 136 of file qgsprocessingregistry.cpp.

◆ algorithms()

QList< const QgsProcessingAlgorithm *> QgsProcessingRegistry::algorithms ( ) const

Returns a list of all available algorithms from registered providers.

See also
algorithmById()

Definition at line 125 of file qgsprocessingregistry.cpp.

◆ createAlgorithmById()

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, 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.

See also
algorithms()
algorithmById()

Definition at line 158 of file qgsprocessingregistry.cpp.

◆ operator=()

QgsProcessingRegistry& QgsProcessingRegistry::operator= ( const QgsProcessingRegistry other)
delete

Registry cannot be copied.

◆ parameterType()

QgsProcessingParameterType * QgsProcessingRegistry::parameterType ( const QString &  id) const

Returns the parameter type registered for id.

Since
QGIS 3.2

Definition at line 194 of file qgsprocessingregistry.cpp.

◆ parameterTypeAdded

void QgsProcessingRegistry::parameterTypeAdded ( QgsProcessingParameterType type)
signal

Emitted when a new parameter type has been added to the registry.

Since
QGIS 3.2

◆ parameterTypeRemoved

void QgsProcessingRegistry::parameterTypeRemoved ( QgsProcessingParameterType type)
signal

Emitted when a parameter type has been removed from the registry and is about to be deleted.

Since
QGIS 3.2

◆ parameterTypes()

QList< QgsProcessingParameterType * > QgsProcessingRegistry::parameterTypes ( ) const

Returns a list with all known parameter types.

Since
QGIS 3.2

Definition at line 199 of file qgsprocessingregistry.cpp.

◆ providerAdded

void QgsProcessingRegistry::providerAdded ( const QString &  id)
signal

Emitted when a provider has been added to the registry.

◆ providerById()

QgsProcessingProvider * QgsProcessingRegistry::providerById ( const QString &  id)

Returns a matching provider by provider ID.

Definition at line 120 of file qgsprocessingregistry.cpp.

◆ providerRemoved

void QgsProcessingRegistry::providerRemoved ( const QString &  id)
signal

Emitted when a provider is removed from the registry.

◆ providers()

QList<QgsProcessingProvider *> QgsProcessingRegistry::providers ( ) const
inline

Gets list of available providers.

Definition at line 60 of file qgsprocessingregistry.h.

◆ removeParameterType()

void QgsProcessingRegistry::removeParameterType ( QgsProcessingParameterType type)

Unregister a custom parameter type from processing.

The type will be deleted. Will emit parameterTypeRemoved.

See also
addParameterType
Since
QGIS 3.2

Definition at line 187 of file qgsprocessingregistry.cpp.

◆ removeProvider() [1/2]

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).

See also
addProvider()

Definition at line 97 of file qgsprocessingregistry.cpp.

◆ removeProvider() [2/2]

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).

See also
addProvider()

Definition at line 114 of file qgsprocessingregistry.cpp.


The documentation for this class was generated from the following files: