Class SortedMetadataTableBuffer<TKey, TRow>
- Namespace
- AsmResolver.DotNet.Builder.Metadata
- Assembly
- AsmResolver.DotNet.dll
Represents a metadata stream buffer that sorts all added rows by one or two primary columns.
public class SortedMetadataTableBuffer<TKey, TRow> : ISortedMetadataTableBuffer<TKey, TRow>, IMetadataTableBuffer where TKey : notnull where TRow : struct, IMetadataRow
Type Parameters
TKey
The type of members that are assigned new metadata rows.
TRow
The type of rows to store.
- Inheritance
-
SortedMetadataTableBuffer<TKey, TRow>
- Implements
-
ISortedMetadataTableBuffer<TKey, TRow>
- Inherited Members
Constructors
SortedMetadataTableBuffer(MetadataTable<TRow>, int)
Creates a new metadata stream buffer that is sorted by a single primary column.
public SortedMetadataTableBuffer(MetadataTable<TRow> table, int primaryColumn)
Parameters
table
MetadataTable<TRow>The underlying table to flush to.
primaryColumn
intThe index of the primary column to use as a sorting key.
SortedMetadataTableBuffer(MetadataTable<TRow>, int, int)
Creates a new metadata stream buffer that is sorted by a primary and a secondary column.
public SortedMetadataTableBuffer(MetadataTable<TRow> table, int primaryColumn, int secondaryColumn)
Parameters
table
MetadataTable<TRow>The underlying table to flush to.
primaryColumn
intThe index of the primary column to use as a sorting key.
secondaryColumn
intThe index of the secondary column to use as a sorting key.
Properties
Count
Gets the number of rows that were added to the buffer.
public int Count { get; }
Property Value
Methods
Add(TKey, in TRow)
Adds a row to the metadata table.
public void Add(TKey originalKey, in TRow row)
Parameters
originalKey
TKeyrow
TRowThe row to add.
Clear()
Clears the table buffer.
public void Clear()
FlushToTable()
Submits all rows to the underlying table stream.
public void FlushToTable()
GetMembers()
Gets all the members that were added to the buffer.
public IEnumerable<TKey> GetMembers()
Returns
- IEnumerable<TKey>
The added members.
GetNewToken(TKey)
Gets the new metadata token that was assigned to the member.
public MetadataToken GetNewToken(TKey member)
Parameters
member
TKeyThe member.
Returns
- MetadataToken
The new metadata token.
Sort()
Sorts the metadata table buffer, and determines all new metadata tokens of the added members.
public void Sort()