QGIS API Documentation 4.1.0-Master (31622b25bb0)
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.h"
22#include "qgis_core.h"
23
24#include <QSet>
25
33{
34 public:
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 && mHtmlLog == other.mHtmlLog && mInputs == other.mInputs && mOutputs == other.mOutputs;
96 }
97 bool operator!=( const QgsProcessingModelChildAlgorithmResult &other ) const { return !( *this == other ); }
98
99 private:
101 QVariantMap mInputs;
102 QVariantMap mOutputs;
103 QString mHtmlLog;
104};
105
107
115{
116 public:
118
122 void clear();
123
129 void mergeWith( const QgsProcessingModelResult &other );
130
136 QMap< QString, QgsProcessingModelChildAlgorithmResult > childResults() const { return mChildResults; }
137
145 QMap< QString, QgsProcessingModelChildAlgorithmResult > &childResults() SIP_SKIP { return mChildResults; }
146
155 QVariantMap &rawChildInputs() SIP_SKIP { return mRawChildInputs; }
156
165 QVariantMap &rawChildOutputs() SIP_SKIP { return mRawChildOutputs; }
166
173 QSet< QString > &executedChildIds() SIP_SKIP { return mExecutedChildren; }
174
178 QSet< QString > executedChildIds() const { return mExecutedChildren; }
179
180 private:
181 QMap< QString, QgsProcessingModelChildAlgorithmResult > mChildResults;
182
183 QSet< QString > mExecutedChildren;
184 QVariantMap mRawChildInputs;
185 QVariantMap mRawChildOutputs;
186};
187
188
189#endif // QGSPROCESSINGMODELRESULT_H
ProcessingModelChildAlgorithmExecutionStatus
Reflects the status of a child algorithm in a Processing model.
Definition qgis.h:4047
@ NotExecuted
Child has not been executed.
Definition qgis.h:4048
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
void clear()
Clears any existing results.
QVariantMap & rawChildOutputs()
Returns a reference to the map of raw child algorithm outputs.
void mergeWith(const QgsProcessingModelResult &other)
Merges this set of results with an other set of results.
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:133
Q_DECLARE_METATYPE(QgsProcessingModelChildAlgorithmResult)