-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[processing] New c++ QgsProcessingRegistry class
Intended as a registry for the various processing components, including providers, algorithms and various parameters and outputs. Currently handles only registration of providers, as a step toward removing processing's algList (this requires first porting the algorithm class to c++) A QgsProcessingRegistry instance is attached to QgsApplication, and is retrieved by QgsApplication::processingRegistry()
- Loading branch information
1 parent
bb24dfe
commit dca697b
Showing
15 changed files
with
312 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* \class QgsProcessingRegistry | ||
* \ingroup core | ||
* 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(). | ||
* \note added in QGIS 3.0 | ||
*/ | ||
class QgsProcessingRegistry : QObject | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsprocessingregistry.h> | ||
%End | ||
|
||
public: | ||
|
||
/** | ||
* Constructor for QgsProcessingRegistry. | ||
*/ | ||
QgsProcessingRegistry( QObject* parent /TransferThis/ = nullptr ); | ||
|
||
~QgsProcessingRegistry(); | ||
|
||
/** | ||
* Get list of available providers. | ||
*/ | ||
QList<QgsProcessingProvider*> providers() const; | ||
|
||
/** | ||
* Add a processing provider to the registry. Ownership of the provider is transferred 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). | ||
* @see removeProvider() | ||
*/ | ||
bool addProvider( QgsProcessingProvider* provider /Transfer/ ); | ||
|
||
/** | ||
* 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 addProvider() | ||
*/ | ||
bool 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 addProvider() | ||
*/ | ||
bool removeProvider( const QString& providerId ); | ||
|
||
/** | ||
* Returns a matching provider by provider ID. | ||
*/ | ||
QgsProcessingProvider* providerById( const QString& id ); | ||
|
||
signals: | ||
|
||
//! Emitted when a provider has been added to the registry. | ||
void providerAdded( const QString& id ); | ||
|
||
//! Emitted when a provider is removed from the registry | ||
void providerRemoved( const QString& id ); | ||
|
||
private: | ||
|
||
//! Registry cannot be copied | ||
QgsProcessingRegistry( const QgsProcessingRegistry& other ); | ||
//! Registry cannot be copied | ||
//QgsProcessingRegistry& operator=( const QgsProcessingRegistry& other ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.