QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsprocessingmodelresult.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingmodelresult.h
3 ----------------------
4 begin : April 2024
5 copyright : (C) 2024 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPROCESSINGMODELRESULT_H
19#define QGSPROCESSINGMODELRESULT_H
20
21#include "qgis_core.h"
22#include "qgis.h"
23#include <QSet>
24
32{
33 public:
34
36
43
49 void setExecutionStatus( Qgis::ProcessingModelChildAlgorithmExecutionStatus status ) { mExecutionStatus = status; }
50
56 QVariantMap inputs() const { return mInputs; }
57
63 void setInputs( const QVariantMap &inputs ) { mInputs = inputs; }
64
70 QVariantMap outputs() const { return mOutputs; }
71
77 void setOutputs( const QVariantMap &outputs ) { mOutputs = outputs; }
78
84 QString htmlLog() const { return mHtmlLog; }
85
91 void setHtmlLog( const QString &log ) { mHtmlLog = log; }
92
94 {
95 return mExecutionStatus == other.mExecutionStatus
96 && mHtmlLog == other.mHtmlLog
97 && mInputs == other.mInputs
98 && mOutputs == other.mOutputs;
99 }
101 {
102 return !( *this == other );
103 }
104
105 private:
106
108 QVariantMap mInputs;
109 QVariantMap mOutputs;
110 QString mHtmlLog;
111
112};
113
121{
122 public:
123
125
129 void clear();
130
136 void mergeWith( const QgsProcessingModelResult &other );
137
143 QMap< QString, QgsProcessingModelChildAlgorithmResult > childResults() const { return mChildResults; }
144
152 QMap< QString, QgsProcessingModelChildAlgorithmResult > &childResults() SIP_SKIP { return mChildResults; }
153
162 QVariantMap &rawChildInputs() SIP_SKIP { return mRawChildInputs; }
163
172 QVariantMap &rawChildOutputs() SIP_SKIP { return mRawChildOutputs; }
173
180 QSet< QString > &executedChildIds() SIP_SKIP { return mExecutedChildren; }
181
185 QSet< QString > executedChildIds() const { return mExecutedChildren; }
186
187 private:
188
189 QMap< QString, QgsProcessingModelChildAlgorithmResult > mChildResults;
190
191 QSet< QString > mExecutedChildren;
192 QVariantMap mRawChildInputs;
193 QVariantMap mRawChildOutputs;
194
195};
196
197
198#endif // QGSPROCESSINGMODELRESULT_H
199
200
201
202
ProcessingModelChildAlgorithmExecutionStatus
Reflects the status of a child algorithm in a Processing model.
Definition qgis.h:3585
Encapsulates the results of running a child algorithm within a model.
void setOutputs(const QVariantMap &outputs)
Sets the outputs generated by child algorithm.
QString htmlLog() const
Returns the HTML formatted contents of logged messages which occurred while running the child.
QVariantMap outputs() const
Returns the outputs generated by the child algorithm.
void setExecutionStatus(Qgis::ProcessingModelChildAlgorithmExecutionStatus status)
Sets the status of executing the child algorithm.
Qgis::ProcessingModelChildAlgorithmExecutionStatus executionStatus() const
Returns the status of executing the child algorithm.
void setInputs(const QVariantMap &inputs)
Sets the inputs used for the child algorithm.
QVariantMap inputs() const
Returns the inputs used for the child algorithm.
void setHtmlLog(const QString &log)
Sets the HTML formatted contents of logged messages which occurred while running the child.
bool operator!=(const QgsProcessingModelChildAlgorithmResult &other) const
bool operator==(const QgsProcessingModelChildAlgorithmResult &other) const
Encapsulates the results of running a Processing model.
QVariantMap & rawChildOutputs()
Returns a reference to the map of raw child algorithm outputs.
QSet< QString > executedChildIds() const
Returns the set of child algorithm IDs which were executed during the model execution.
QVariantMap & rawChildInputs()
Returns a reference to the map of raw child algorithm inputs.
QSet< QString > & executedChildIds()
Returns a reference to the set of child algorithm IDs which were executed during the model execution.
QMap< QString, QgsProcessingModelChildAlgorithmResult > & childResults()
Returns a reference to the map of child algorithm results.
QMap< QString, QgsProcessingModelChildAlgorithmResult > childResults() const
Returns the map of child algorithm results.
#define SIP_SKIP
Definition qgis_sip.h:126