ForEachStrategyExecutor
Short summary
An class to implement parallel and serial foreach strategies.
Warning: Uses the iterate function of the attached collection and will thus conflict with other foreach and iterate statements of the same collection instance.
| Access | Abstract | Final | Extends | Implements |
|---|---|---|---|---|
| INTERNAL | No | Yes | CNM_AbstractObject.Object | CNM_CollectionInterfaces.IForEachStrategy |
UML Diagram
Parameters
none
Properties
className
Type: CNM_AbstractObject.ClassName
This abstract property returns the class name of the concrete object, …
instant
Type: CNM_CollectionInterfaces.IInstantForEachStrategy
This property returns a fluent interface for immediate (wihtin one call) operations of appliers.…
Methods
FB_Exit
- Parameters:
bInCopyCode(BOOL): TRUE: the exit method is called in order to leave the instance which will be copied afterwards (online change).
- Return type:
BOOL
Mark the object as deleted, as it staiys in the memory.…
FB_Init
- Parameters:
bInitRetains(BOOL): TRUE: the retain variables are initialized (reset warm / reset cold)bInCopyCode(BOOL): TRUE: the instance will be copied to the copy code afterward (online change)collection(CNM_CollectionInterfaces.ICollection)
- Return type:
BOOL
code. You can evaluate the return value.methods explicitly and provide additional code there with the standard initializationThe return value is not evaluated. For a specific influence, you can also declare theFB_Init is always available implicitly and it is used primarily for initialization.…
parallel
- Parameters:
execute(BOOL): control bit to start or abort the forEach loopapplier(CNM_CollectionInterfaces.IApplier): the applier (action) to be used on all obejcts in the collection
- Return type: CNM_ReturnTypes.SingleExecutionState
Method to perform a given action on all objects inside the collection.…
selectApplier
- Parameters:
nextStep(DINT)applier(CNM_CollectionInterfaces.IApplier)applierIndex(UDINT)nextApplier(CNM_CollectionInterfaces.IApplier)
- Return type:
DINT
serial
- Parameters:
execute(BOOL): control bit to start or abort the forEach loopapplier(CNM_CollectionInterfaces.IApplier): the applier (action) to be used on all obejcts in the collection
- Return type: CNM_ReturnTypes.SingleExecutionState
Method to perform a given action on all objects inside the collection.…
Code
Declaration
FUNCTION_BLOCK INTERNAL FINAL ForEachStrategyExecutor EXTENDS CNM_AbstractObject.Object IMPLEMENTS CNM_CollectionInterfaces.IForEachStrategy
VAR
usedCollection :CNM_CollectionInterfaces.ICollection;
{attribute 'no_copy'}
serialIterator :CNM_CollectionInterfaces.IIterator;
{attribute 'no_copy'}
parallelIterator :CNM_CollectionInterfaces.IIterator;
{attribute 'no_Copy'}
instantExecutor :ForEachInstantStrategyExecutor(THIS^.usedCollection);
END_VAR