8#include <mlModuleIncludes.h>
9#include <FMEException/Exception.h>
10#include <FMEThirdPartyWarningsDisable.h>
12#include <FMEThirdPartyWarningsRestore.h>
51 void handleNotification(Field* field)
override;
59 void activateAttachments()
override;
70 void calculateOutputImageProperties(
int outputIndex, PagedImage* outputImage)
override;
96 const std::string& getMessage()
const;
100 std::string _message;
152 virtual void setOutputImageProperties(
int outputIndex, PagedImage* outputImage);
155 enum EOnInputChangeBehavior {
160 void _addUpdateControlFields();
161 void _addStatusFields();
162 void _addStatusCodeField();
163 bool _isFieldUpdate(Field* field)
const;
164 bool _isFieldOnInputChangeBehavior(Field* field)
const;
165 bool _shouldUpdateOnInputChange()
const;
166 bool _isFieldClear(Field* field)
const;
167 bool _isInputField(
const Field* field)
const;
168 bool _hasNamePrefixIn(
const std::string& name)
const;
169 bool _hasNamePrefixInput(
const std::string& name)
const;
170 void _handleInputFieldNotification();
171 void _initiateUpdate();
172 void _validateInputAndUpdate();
174 bool _shouldClearOnFailedUpdate();
175 void _setStatusCodeAndMessageFieldValues(
const EStatusCode code,
const std::string& message);
177 void _initiateClear();
178 void _tryToSetOutputImageProperties(
int outputIndex, PagedImage* outputImage);
179 void _validateOutputImageValidity(
const PagedImage*
const outputImage)
const;
180 void _handleErrorDuringSetOutputImageProperties(PagedImage* outputImage,
const AlgorithmModule::Error& error);
181 void _setImageInvalid(PagedImage*
const image);
183 bool _hasValidatedInputAndInitiatedUpdate;
184 bool _wasOutputCleared;
185 bool _didSetOutputImagePropertiesFail;
188 TypedEnumField<EOnInputChangeBehavior>* onInputChangeBehaviorField;
191 NotifyField* updateField;
194 NotifyField* clearField;
201 NotifyField* updateDoneField;
204 TypedEnumField<EStatusCode>* statusCodeField;
207 StringField* statusMessageField;
210 BoolField* hasValidOutputField;
215 BoolField* doNotClearOnFailedUpdateField;
#define ML_ALGORITHM_MODULE_EXPORT
Definition MLAlgorithmModuleSystem.h:12
Data structure to indicate an error within an AlgorithmModule derivative's implementation of interfac...
Definition mlAlgorithmModule.h:91
Data structure indicating an internally caused error.
Definition mlAlgorithmModule.h:128
ML-Module base class to simplify development of modules encapsulating an algorithm with dedicated inp...
Definition mlAlgorithmModule.h:30
virtual void validateInput()=0
Validates the values of module's input fields (object and parameter fields).
virtual void update()=0
Executes the algorithm and updates the values of module's output fields with results.
virtual void clear()=0
Clears the values of module's output fields (object and parameter fields).
EStatusCode
Contains possible values of field statusCode.
Definition mlAlgorithmModule.h:74
@ SC_ERROR_INPUT_PARAMETER
An invalid input parameter caused abort of update.
Definition mlAlgorithmModule.h:80
@ SC_ERROR_INTERNAL
An internal error caused abort of update.
Definition mlAlgorithmModule.h:82
@ SC_ERROR_INPUT_OBJECT
An invalid input object caused abort of update.
Definition mlAlgorithmModule.h:78