AbstractListSorter
Short summary
Abstract base class for list sorters. Provides functionality to set the execution limits, size and list changes.
| Access | Abstract | Final | Extends | Implements |
|---|---|---|---|---|
| INTERNAL | Yes | No | AbstractDisposableContainer | CNM_CollectionInterfaces.IListSorter |
UML Diagram
Parameters
none
Properties
className
Type: CNM_AbstractObject.ClassName
This abstract property returns the class name of the concrete object, …
maxCycleCompares
Type: UDINT
This property defines the maximum amount of compares that should be done per Cycle. Is optional as default should be set by class.…
Methods
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. …
compareElements
- Parameters:
object1(CNM_AbstractObject.IObject): first object to compareobject2(CNM_AbstractObject.IObject): second object to compare
- Return type: CNM_ReturnTypes.ComparationResult
Compares two objects, if set uses the comparator, else uses the built in comparator of object1.…
deepClone
- Return type: CNM_AbstractObject.CNM_ReturnTypes.CloneResult
This method is used to create a new instance…
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.…
prepareClonedSorter
- Parameters:
newSorter(CNM_CollectionInterfaces.IListSorter): The cloned sorter to init
- Return type:
VOID
Does the basic initialization for a new sorter that was cloned from THIS^…
setComparator
- Parameters:
comparator(CNM_AbstractObject.IComparator): the instance of the comperator to be used for sorting
- Return type: CNM_CollectionInterfaces.IListSorter
This method can replace the default comperator for custom one.…
Abstract methods
clone
- Return type: CNM_AbstractObject.CNM_ReturnTypes.CloneResult
This method is used to create a new instance…
Code
Declaration
FUNCTION_BLOCK INTERNAL ABSTRACT AbstractListSorter EXTENDS AbstractDisposableContainer IMPLEMENTS CNM_CollectionInterfaces.IListSorter
VAR
(*The comparator used to sort, set by the List when setting sorter*)
elementComparator :CNM_AbstractObject.IComparator;
(*The maximum of comparisons that the sorter allows, may be overwruled by the bounds*)
maxOperationsPerCycle :UDINT;
(*The maximum of compares done per cycle to prevent very long lists to take up to much time*)
upperCompareBound :UDINT := GeneralParameters.DEFAULT_OPERATIONS_PER_CYCLE;
(* Comparator used for inverse Sort *)
reverseComparator :InvertComparator;
(* the current change index of the list *)
listChangeIndex :REFERENCE TO __XWORD;
END_VAR