Table of Contents

Class ParallelBulkReader<TData>

Namespace
Hi.Common.ParallelBulkUtils
Assembly
HiGeom.dll

Parallel bulk reader that provides efficient data access with caching capabilities. Manages reading data in parallel with forward and backward caching to optimize performance.

public class ParallelBulkReader<TData> : IDisposable where TData : class

Type Parameters

TData

The type of data to read.

Inheritance
ParallelBulkReader<TData>
Implements
Inherited Members
Extension Methods

Constructors

ParallelBulkReader(int, int, int, ReadBulkDelegate<TData>, Func<TData, int?>, Func<int>)

Initializes a new instance of the ParallelBulkReader<TData> class.

public ParallelBulkReader(int cacheBackwardDistance, int cacheForwardDistance, int cacheQueueLimit, ReadBulkDelegate<TData> readBulkFunc, Func<TData, int?> getIndexFunc, Func<int> countFunc)

Parameters

cacheBackwardDistance int

The distance to cache backward from the current index.

cacheForwardDistance int

The distance to cache forward from the current index.

cacheQueueLimit int

The maximum number of cache entries to maintain in the queue.

readBulkFunc ReadBulkDelegate<TData>

The function used to read bulk data.

getIndexFunc Func<TData, int?>

The function used to extract an index from a data item.

countFunc Func<int>

The function that returns the total count of available data items.

Properties

GetIndexFunc

Gets the function used to extract an index from a data item.

public Func<TData, int?> GetIndexFunc { get; }

Property Value

Func<TData, int?>

Methods

ClearCache()

Clears all cached data and disposes of all cache entries.

public void ClearCache()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the ParallelBulkReader<TData> and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetStep(int)

Gets a data item at the specified step index, with automatic caching.

public TData GetStep(int stepIndex)

Parameters

stepIndex int

The index of the step to retrieve.

Returns

TData

The data item at the specified index.