AbstractMergeBasedSorter
Short summary
Abstract Sorter for merge based sort methods. Provides a default implementation for an indexed merge function and a method to efficient copy elements.
Caution: Due to the characteristics of a merge, a merge must be performed atomically. As a merge of two lists l1 and l2 can take up to l1.size+l2.size-1 compares. That implies that at the last cycle of the merge, an atomic operation that requires up to list.size-1 compares must be performed. Therefore the maxCycleCompares may be exceeded and set the maxCycleCompares to a value smaller than list.size-1 may not have the desired effect.
| Access | Abstract | Final | Extends | Implements |
|---|---|---|---|---|
| INTERNAL | Yes | No | AbstractArrayListSorter | - |
UML Diagram
Methods
merge
- Parameters:
firstContainer(POINTER TO CNM_AbstractObject.IObject)secondContainer(POINTER TO CNM_AbstractObject.IObject)buffer(POINTER TO CNM_AbstractObject.IObject)firstContainerSize(UDINT)secondContainerSize(UDINT)
- Return type: CNM_ReturnTypes.SingleExecutionResult
Function that sorts specified parts using a merge mechanism.…
Code
Declaration
FUNCTION_BLOCK INTERNAL ABSTRACT AbstractMergeBasedSorter EXTENDS AbstractArrayListSorter