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
Path
Path the file was opened from.
public string Path { get; }
Property Value
Sections
All section entries.
public IReadOnlyCollection<SectionEntry> Sections { get; }
Property Value
Methods
Bytes(uint)
Raw bytes of a section.
public ReadOnlySpan<byte> Bytes(uint tag)
Parameters
taguint
Returns
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
taguint
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
taguint
Returns
Open(string)
Opens and validates a checkpoint file.
public static DfbFile Open(string path)
Parameters
pathstring
Returns
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
taguint
Returns
- T*
Type Parameters
T
Section(uint)
Returns the section entry, throwing if absent.
public SectionEntry Section(uint tag)
Parameters
taguint