Class UnsortedMetadataTableBuffer<TRow>
- Namespace
- AsmResolver.DotNet.Builder.Metadata
- Assembly
- AsmResolver.DotNet.dll
Represents a metadata stream buffer that adds every new row at the end of the table, without any further processing or reordering of the rows.
public class UnsortedMetadataTableBuffer<TRow> : IMetadataTableBuffer<TRow>, IMetadataTableBuffer where TRow : struct, IMetadataRow
Type Parameters
TRow
The type of rows to store.
- Inheritance
-
UnsortedMetadataTableBuffer<TRow>
- Implements
-
IMetadataTableBuffer<TRow>
- Inherited Members
Constructors
UnsortedMetadataTableBuffer(MetadataTable<TRow>)
Creates a new unsorted metadata table buffer.
public UnsortedMetadataTableBuffer(MetadataTable<TRow> table)
Parameters
table
MetadataTable<TRow>The underlying table to flush to.
Properties
Count
Gets the number of rows that were added to the buffer.
public int Count { get; }
Property Value
this[uint]
Gets or sets a row in the metadata table.
public virtual TRow this[uint rid] { get; set; }
Parameters
rid
uintThe identifier of the metadata row.
Property Value
- TRow
Methods
Add(in TRow)
Adds a row to the metadata table.
public virtual MetadataToken Add(in TRow row)
Parameters
row
TRowThe row to add.
Returns
- MetadataToken
The metadata token that this row was assigned to.
Clear()
Clears the table buffer.
public void Clear()
EnsureCapacity(int)
Ensures the capacity of the table buffer is at least the provided amount of elements.
public void EnsureCapacity(int capacity)
Parameters
capacity
intThe number of elements to store.
FlushToTable()
Submits all rows to the underlying table stream.
public void FlushToTable()
GetRowRef(uint)
Gets or sets a reference to a row in the metadata table.
public ref TRow GetRowRef(uint rid)
Parameters
rid
uintThe identifier of the metadata row.
Returns
- TRow
Insert(uint, in TRow)
Inserts a row into the metadata table at the provided row identifier.
public MetadataToken Insert(uint rid, in TRow row)
Parameters
rid
uintThe row identifier.
row
TRowThe row to add.
Returns
- MetadataToken
The metadata token that this row was assigned to.