Skip to main content

ChainedApplier

Short summary

An abstract class to implement the logic of Appliers for forEach. Users only need to implement apply in inherited class and should not change any other method.

AccessAbstractFinalExtendsImplements
NoYesAbstractDisposableContainerCNM_CollectionInterfaces.IChainedApplier

UML Diagram

Parameters

none

Properties

actions

Type: CNM_CollectionInterfaces.IApplierList

This property returns a list of actions/operations performed by this applier.

className

Type: CNM_AbstractObject.ClassName

This abstract property returns the class name of the concrete object,

Methods

accept

Method to accept an object.

andThen

Method to concat actions perfomed on an object. This way two (or more) Actions can be performed on data with one foreach.

apply

  • Parameters:
    • execute (BOOL): control bit to start or abort the application, should to be active until the CNM_ReturnTypes.SingleExecutionState is SUCCESS
  • Return type: CNM_ReturnTypes.SingleExecutionState

A method to apply the concrete action on the given object (THIS^.object)

clearContents

  • Return type: VOID

This method is called in the destruct method and is intended to zero all references and interfaces that should not be destructed.

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

The constructor FB_init is needed to create an unique hash code.

Code

Declaration

{attribute 'enable_dynamic_creation'}
FUNCTION_BLOCK FINAL ChainedApplier EXTENDS AbstractDisposableContainer IMPLEMENTS CNM_CollectionInterfaces.IChainedApplier
VAR
object :CNM_AbstractObject.IObject;
END_VAR
VAR
myactions :ApplierList();
END_VAR