Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a context object for processing algorithm execution
- Loading branch information
1 parent
fea6bff
commit 241d283
Showing
4 changed files
with
146 additions
and
0 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,68 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/processing/qgsprocessingcontext.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsProcessingContext | ||
{ | ||
%Docstring | ||
Contains information about the context in which a processing algorithm is executed. | ||
|
||
Contextual information includes settings such as the associated project, and | ||
expression context. | ||
.. versionadded:: 3.0 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsprocessingcontext.h" | ||
%End | ||
public: | ||
|
||
QgsProcessingContext(); | ||
|
||
QgsProject *project() const; | ||
%Docstring | ||
Returns the project in which the algorithm is being executed. | ||
\see setProject() | ||
:rtype: QgsProject | ||
%End | ||
|
||
void setProject( QgsProject *project ); | ||
%Docstring | ||
Sets the ``project`` in which the algorithm will be executed. | ||
\see project() | ||
%End | ||
|
||
QgsExpressionContext expressionContext() const; | ||
%Docstring | ||
Returns the expression context. | ||
:rtype: QgsExpressionContext | ||
%End | ||
|
||
void setExpressionContext( const QgsExpressionContext &context ); | ||
%Docstring | ||
Sets the expression ``context``. | ||
%End | ||
|
||
}; | ||
|
||
|
||
|
||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/processing/qgsprocessingcontext.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
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,76 @@ | ||
/*************************************************************************** | ||
qgsprocessingcontext.h | ||
---------------------- | ||
begin : April 2017 | ||
copyright : (C) 2017 by Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSPROCESSINGCONTEXT_H | ||
#define QGSPROCESSINGCONTEXT_H | ||
|
||
#include "qgis_core.h" | ||
#include "qgis.h" | ||
#include "qgsproject.h" | ||
#include "qgsexpressioncontext.h" | ||
|
||
/** | ||
* \class QgsProcessingContext | ||
* \ingroup core | ||
* Contains information about the context in which a processing algorithm is executed. | ||
* | ||
* Contextual information includes settings such as the associated project, and | ||
* expression context. | ||
* \since QGIS 3.0 | ||
*/ | ||
|
||
class CORE_EXPORT QgsProcessingContext | ||
{ | ||
public: | ||
|
||
QgsProcessingContext() = default; | ||
|
||
/** | ||
* Returns the project in which the algorithm is being executed. | ||
* \see setProject() | ||
*/ | ||
QgsProject *project() const { return mProject; } | ||
|
||
/** | ||
* Sets the \a project in which the algorithm will be executed. | ||
* \see project() | ||
*/ | ||
void setProject( QgsProject *project ) { mProject = project; } | ||
|
||
/** | ||
* Returns the expression context. | ||
*/ | ||
QgsExpressionContext expressionContext() const { return mExpressionContext; } | ||
|
||
/** | ||
* Sets the expression \a context. | ||
*/ | ||
void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; } | ||
|
||
private: | ||
|
||
QPointer< QgsProject > mProject; | ||
|
||
QgsExpressionContext mExpressionContext; | ||
|
||
}; | ||
|
||
#endif // QGSPROCESSINGPARAMETERS_H | ||
|
||
|
||
|
||
|