Interface AlgorithmExecutor
- All Known Subinterfaces:
DataDecoder
,DataEncoder
- All Known Implementing Classes:
AbstractAlgorithmExecutor
,AbstractDataDecoder
,AbstractDataEncoder
,AbstractJavaExprExecutor
,BitMaskBooleanDecoder
,HexStringDecoder
,LeadingSizeBinaryDecoder
,LeadingSizeBinaryEncoder
,MathAlgorithmExecutor
,RemainingBinaryDecoder
,ReverseBinaryDecoder
,ReverseBinaryEncoder
,ScriptAlgorithmExecutor
An instance of this class will be created for each algorithm in each context.
The instance is reused upon each update of one or more of its InputParameters.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
dispose()
Called when this executor instance is no longer used.execute
(long acqTime, long genTime, ProcessingData data) Runs the associated algorithm with the latest InputParameters.default List<InputParameter>
Same as above but it returns the list of parameters that this algorithm uses as input.default List<OutputParameter>
Some algorithms have dynamic outputs which are not known until the algorithm is instantiated.boolean
update
(ProcessingData processingData) This method is called each time new parameters are received (for example extracting them from a packet).
-
Method Details
-
getAlgorithm
Algorithm getAlgorithm() -
update
This method is called each time new parameters are received (for example extracting them from a packet).The executor should copy its inputs if updated or should use the list to determine if it should run.
- Returns:
- true if the algorithm should run
-
execute
AlgorithmExecutionResult execute(long acqTime, long genTime, ProcessingData data) throws AlgorithmException Runs the associated algorithm with the latest InputParameters.Should throw an exception if there is an error within the algorithm.
The error message and error count will be remembered and available to external clients via the API.
The processing data parameter is passed if required to calibrate the output values. It shall not be updated by the executor as it is done in the
ActiveAlgorithm
- Parameters:
acqTime
-genTime
-- Returns:
- the output parameters, if any
- Throws:
AlgorithmException
-
getExecutionContext
AlgorithmExecutionContext getExecutionContext()- Returns:
- the execution context in which the executor activates
-
getOutputList
Some algorithms have dynamic outputs which are not known until the algorithm is instantiated.This method can be overridden to return the list of parameters those algorithms can provide as outputs.
The output list is used in the replays when only some parameters are to be extracted, in order to figure out which algorithms have to be run (only those providing the required parameters are run).
This list is used only if the algorithm definition includes no output list. If the algorithm definition includes an output list, this method is not called (and the algorithm executor will not be instantiated at all if the algorithm outputs are not required).
- Returns:
- list of parameters which can be provided as output
-
getInputList
Same as above but it returns the list of parameters that this algorithm uses as input.- Returns:
- list of parameters that this algorithm uses as input
-
dispose
default void dispose()Called when this executor instance is no longer used.The default implementation does nothing. Inheriting classes may override to clean-up any resources.
-