Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CustomDebugInformationTableReader.cs
Go to the documentation of this file.
2
4
5internal readonly struct CustomDebugInformationTableReader
6{
7 internal readonly int NumberOfRows;
8
10
11 private readonly bool _isGuidHeapRefSizeSmall;
12
13 private readonly bool _isBlobHeapRefSizeSmall;
14
15 private readonly int _kindOffset;
16
17 private readonly int _valueOffset;
18
19 internal readonly int RowSize;
20
21 internal readonly MemoryBlock Block;
22
23 internal CustomDebugInformationTableReader(int numberOfRows, bool declaredSorted, int hasCustomDebugInformationRefSize, int guidHeapRefSize, int blobHeapRefSize, MemoryBlock containingBlock, int containingBlockOffset)
24 {
25 NumberOfRows = numberOfRows;
26 _isHasCustomDebugInformationRefSizeSmall = hasCustomDebugInformationRefSize == 2;
27 _isGuidHeapRefSizeSmall = guidHeapRefSize == 2;
28 _isBlobHeapRefSizeSmall = blobHeapRefSize == 2;
29 _kindOffset = hasCustomDebugInformationRefSize;
30 _valueOffset = _kindOffset + guidHeapRefSize;
31 RowSize = _valueOffset + blobHeapRefSize;
32 Block = containingBlock.GetMemoryBlockAt(containingBlockOffset, RowSize * numberOfRows);
33 if (numberOfRows > 0 && !declaredSorted)
34 {
35 Throw.TableNotSorted(TableIndex.CustomDebugInformation);
36 }
37 }
38
44
50
56
57 internal void GetRange(EntityHandle parentHandle, out int firstImplRowId, out int lastImplRowId)
58 {
60 if (startRowNumber == -1)
61 {
62 firstImplRowId = 1;
63 lastImplRowId = 0;
64 }
65 else
66 {
67 firstImplRowId = startRowNumber + 1;
68 lastImplRowId = endRowNumber + 1;
69 }
70 }
71}
static void TableNotSorted(TableIndex tableIndex)
Definition Throw.cs:250
unsafe MemoryBlock GetMemoryBlockAt(int offset, int length)
int PeekHeapReference(int offset, bool smallRefSize)
void BinarySearchReferenceRange(int rowCount, int rowSize, int referenceOffset, uint referenceValue, bool isReferenceSmall, out int startRowNumber, out int endRowNumber)
uint PeekTaggedReference(int offset, bool smallRefSize)
static BlobHandle FromOffset(int heapOffset)
Definition BlobHandle.cs:34
void GetRange(EntityHandle parentHandle, out int firstImplRowId, out int lastImplRowId)
CustomDebugInformationTableReader(int numberOfRows, bool declaredSorted, int hasCustomDebugInformationRefSize, int guidHeapRefSize, int blobHeapRefSize, MemoryBlock containingBlock, int containingBlockOffset)
static GuidHandle FromIndex(int heapIndex)
Definition GuidHandle.cs:18