9#include <FMEException/Exception.h>
10#include <FMEThirdPartyWarningsDisable.h>
12#include <FMEThirdPartyWarningsRestore.h>
100 std::string _message;
155 enum EOnInputChangeBehavior {
160 void _addUpdateControlFields();
161 void _addStatusFields();
162 void _addStatusCodeField();
164 bool _isFieldOnInputChangeBehavior(
Field*
field)
const;
165 bool _shouldUpdateOnInputChange()
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();
181 void _setImageInvalid(
PagedImage*
const image);
183 bool _hasValidatedInputAndInitiatedUpdate;
184 bool _wasOutputCleared;
185 bool _didSetOutputImagePropertiesFail;
215 BoolField* doNotClearOnFailedUpdateField;
#define ML_ALGORITHM_MODULE_EXPORT
Data structure to indicate an error within an AlgorithmModule derivative's implementation of interfac...
AlgorithmModule::EStatusCode getStatusCode() const
const std::string & getMessage() const
Error(const AlgorithmModule::EStatusCode statusCode, const std::string &message)
Data structure indicating an internally caused error.
InternalError(const std::string &message)
~InternalError() override
ML-Module base class to simplify development of modules encapsulating an algorithm with dedicated inp...
AlgorithmModule(int numInputImages, int numOutputImages)
Forwards given parameters to base class constructor.
void activateAttachments() override
Never overwrite this method in derivative!
void handleNotification(Field *field) override
Never overwrite this method in derivative!
virtual void setOutputImageProperties(int outputIndex, PagedImage *outputImage)
Sets properties of the output image at output outputIndex.
~AlgorithmModule() override
virtual void clear()=0
Clears the values of module's output fields (object and parameter fields).
virtual void update()=0
Executes the algorithm and updates the values of module's output fields with results.
EStatusCode
Contains possible values of field statusCode.
@ SC_ERROR_INTERNAL
An internal error caused abort of update.
@ SC_ERROR_INPUT_PARAMETER
An invalid input parameter caused abort of update.
@ SC_ERROR_INPUT_OBJECT
An invalid input object caused abort of update.
void calculateOutputImageProperties(int outputIndex, PagedImage *outputImage) override
Never overwrite this method in derivative!
virtual void validateInput()=0
Validates the values of module's input fields (object and parameter fields).
Field to encapsulate a boolean value.
Base class for all fields used in the ML.
Base class for an image processing module of the ML.
Field without value for notifications.
Class which represents an image, which manages properties of an image and image data which is located...
Field to encapsulate a string value.
TypedEnumField is used to encapsulate a C++ enum value and work with a real enum value instead of int...
#define ML_ABSTRACT_MODULE_CLASS_HEADER(className)
Like ML_ABSTRACT_CLASS_HEADER for the usage of derived classes from Module.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.