Class BaseParallelEnumerator
- Namespace
- Garyon.Objects.Enumerators
- Assembly
- Garyon.dll
Provides the base mechanism for a parallel enumerator for two IEnumerator<T> objects.
public abstract class BaseParallelEnumerator
- Inheritance
-
BaseParallelEnumerator
- Derived
- Inherited Members
- Extension Methods
Methods
ConditionallyMoveNext<T>(IEnumerator<T>, ref bool)
Conditionally calls the MoveNext() method on
the provided enumerator, if alive is
true.
protected static void ConditionallyMoveNext<T>(IEnumerator<T> enumerator, ref bool alive)
Parameters
enumeratorIEnumerator<T>The enumerator.
aliveboolDetermines whether the enumerator should move to the next element. The result of the MoveNext() method is stored back to this variable.
Type Parameters
TThe type of the elements the IEnumerator<T> enumerates.
GetCurrentValue<T>(IEnumerator<T>, bool)
Gets the current value of the IEnumerator<T>.
protected static T? GetCurrentValue<T>(IEnumerator<T> enumerator, bool alive)
Parameters
enumeratorIEnumerator<T>The enumerator.
aliveboolDetermines whether the enumerator's current position is before the end of the collection, allowing it to retrieve the Current value.
Returns
- T
The current value of the IEnumerator<T>, if
aliveis true, otherwise default.
Type Parameters
TThe type of the elements the IEnumerator<T> enumerates.
GetCurrentValue<T>(int)
Gets the current value of the IEnumerator<T> at the specified index.
protected abstract T? GetCurrentValue<T>(int index)
Parameters
indexintThe zero-based index of the IEnumerator<T>.
Returns
- T
The current value of the IEnumerator<T>, if the given IEnumerator<T> is alive, otherwise default.
Type Parameters
TThe type of the current value.