Table of Contents

Class SimpleReadingChunkCache

Namespace
PureHDF.VOL.Native
Assembly
PureHDF.dll

A simple reading chunk cache following the cache design principles of the HDF5 C-library.

public class SimpleReadingChunkCache : IReadingChunkCache
Inheritance
SimpleReadingChunkCache
Implements

Constructors

SimpleReadingChunkCache(int, ulong)

Initializes a new instance of the SimpleReadingChunkCache class.

public SimpleReadingChunkCache(int chunkSlotCount = 521, ulong byteCount = 1048576)

Parameters

chunkSlotCount int

The number of chunks that can be hold in the cache at the same time.

byteCount ulong

The maximum size of the chunk cache in bytes.

Properties

ByteCount

Gets the maximum size of the chunk cache in bytes.

public ulong ByteCount { get; }

Property Value

ulong

ChunkSlotCount

Gets the number of chunks that can be hold in the cache at the same time.

public int ChunkSlotCount { get; }

Property Value

int

ConsumedBytes

Gets the number of consumed bytes of the chunk cache.

public ulong ConsumedBytes { get; }

Property Value

ulong

ConsumedSlots

Gets the number of chunk slots that have already been consumed.

public int ConsumedSlots { get; }

Property Value

int

Methods

GetChunk(ulong, Func<Memory<byte>>)

Tries to get the chunk at the given index.

public Memory<byte> GetChunk(ulong chunkIndex, Func<Memory<byte>> chunkReader)

Parameters

chunkIndex ulong

The linear chunk index.

chunkReader Func<Memory<byte>>

The chunk reader is used whenever the chunk is not already cached.

Returns

Memory<byte>