QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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:
35
37
44
50 void setExecutionStatus( Qgis::ProcessingModelChildAlgorithmExecutionStatus status ) { mExecutionStatus = status; }
51
57 QVariantMap inputs() const { return mInputs; }
58
64 void setInputs( const QVariantMap &inputs ) { mInputs = inputs; }
65
71 QVariantMap outputs() const { return mOutputs; }
72
78 void setOutputs( const QVariantMap &outputs ) { mOutputs = outputs; }
79
85 QString htmlLog() const { return mHtmlLog; }
86
92 void setHtmlLog( const QString &log ) { mHtmlLog = log; }
93
95 {
96 return mExecutionStatus == other.mExecutionStatus
97 && mHtmlLog == other.mHtmlLog
98 && mInputs == other.mInputs
99 && mOutputs == other.mOutputs;
100 }
102 {
103 return !( *this == other );
104 }
105
106 private:
107
109 QVariantMap mInputs;
110 QVariantMap mOutputs;
111 QString mHtmlLog;
112
113};
114
122{
123 public:
124
126
130 void clear();
131
137 void mergeWith( const QgsProcessingModelResult &other );
138
144 QMap< QString, QgsProcessingModelChildAlgorithmResult > childResults() const { return mChildResults; }
145
153 QMap< QString, QgsProcessingModelChildAlgorithmResult > &childResults() SIP_SKIP { return mChildResults; }
154
163 QVariantMap &rawChildInputs() SIP_SKIP { return mRawChildInputs; }
164
173 QVariantMap &rawChildOutputs() SIP_SKIP { return mRawChildOutputs; }
174
181 QSet< QString > &executedChildIds() SIP_SKIP { return mExecutedChildren; }
182
186 QSet< QString > executedChildIds() const { return mExecutedChildren; }
187
188 private:
189
190 QMap< QString, QgsProcessingModelChildAlgorithmResult > mChildResults;
191
192 QSet< QString > mExecutedChildren;
193 QVariantMap mRawChildInputs;
194 QVariantMap mRawChildOutputs;
195
196};
197
198
199#endif // QGSPROCESSINGMODELRESULT_H
200
201
202
203
ProcessingModelChildAlgorithmExecutionStatus
Reflects the status of a child algorithm in a Processing model.
Definition qgis.h:3863
@ NotExecuted
Child has not been executed.
Definition qgis.h:3864
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:134