This is in anticipation of decoupling BlueOrb from Spark. * Bts.Collections * Bts.Core * Bts.Disposables * Bts.Numerics
26 lines
870 B
C#
26 lines
870 B
C#
#nullable enable
|
|
namespace Spark.Core.Collections;
|
|
|
|
/// <summary>
|
|
/// Represents a unit of change that can be applied to a list. The only difference
|
|
/// between this struct and <see cref="BlockTrasaction{T}"/>, is that this has the
|
|
/// number of values to insert, while the latter has the actual list of values.
|
|
/// </summary>
|
|
public struct BlockTransactionMetadata {
|
|
public int SourceIndex;
|
|
public int DestIndex;
|
|
public int NumInserted;
|
|
public int NumRemoved;
|
|
public int CummulativeOffset;
|
|
|
|
public BlockTransactionMetadata(int sourceIndex, int destIndex, int numInserted, int numRemoved, int cummulativeOffset) {
|
|
SourceIndex = sourceIndex;
|
|
DestIndex = destIndex;
|
|
NumInserted = numInserted;
|
|
NumRemoved = numRemoved;
|
|
CummulativeOffset = cummulativeOffset;
|
|
}
|
|
|
|
public readonly int Offset => NumInserted - NumRemoved;
|
|
}
|