Table of Contents

Class DfbFile

Namespace
DotFly.Core.Checkpoints
Assembly
DotFly.Core.dll

A memory-mapped .dfb file. Sections are exposed as spans over the mapping — nothing is copied to the managed heap. The file must stay open while any span obtained from it is in use.

public sealed class DfbFile : IDisposable
Inheritance
DfbFile
Implements
Inherited Members

Properties

Length

Total file length in bytes as recorded in the header.

public long Length { get; }

Property Value

long

Path

Path the file was opened from.

public string Path { get; }

Property Value

string

Sections

All section entries.

public IReadOnlyCollection<SectionEntry> Sections { get; }

Property Value

IReadOnlyCollection<SectionEntry>

Methods

Bytes(uint)

Raw bytes of a section.

public ReadOnlySpan<byte> Bytes(uint tag)

Parameters

tag uint

Returns

ReadOnlySpan<byte>

Column<T>(uint)

A fixed-width column as a typed span over the mapping.

public ReadOnlySpan<T> Column<T>(uint tag) where T : unmanaged

Parameters

tag uint

Returns

ReadOnlySpan<T>

Type Parameters

T

Dispose()

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

public void Dispose()

Has(uint)

Whether the file has a section with the given tag.

public bool Has(uint tag)

Parameters

tag uint

Returns

bool

Open(string)

Opens and validates a checkpoint file.

public static DfbFile Open(string path)

Parameters

path string

Returns

DfbFile

Exceptions

InvalidDataException

Bad magic, version or section table.

Pointer<T>(uint)

Raw pointer to a section start (for kernels that outlive a span scope).

public T* Pointer<T>(uint tag) where T : unmanaged

Parameters

tag uint

Returns

T*

Type Parameters

T

Section(uint)

Returns the section entry, throwing if absent.

public SectionEntry Section(uint tag)

Parameters

tag uint

Returns

SectionEntry