Class SimpleReadingChunkCache
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
chunkSlotCountintThe number of chunks that can be hold in the cache at the same time.
byteCountulongThe 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
ChunkSlotCount
Gets the number of chunks that can be hold in the cache at the same time.
public int ChunkSlotCount { get; }
Property Value
ConsumedBytes
Gets the number of consumed bytes of the chunk cache.
public ulong ConsumedBytes { get; }
Property Value
ConsumedSlots
Gets the number of chunk slots that have already been consumed.
public int ConsumedSlots { get; }
Property Value
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
chunkIndexulongThe linear chunk index.
chunkReaderFunc<Memory<byte>>The chunk reader is used whenever the chunk is not already cached.