Class QueryDefinitionDescribeEventCodec
Wire codec for QueryDefinitionDescribe (kind 247) — one-shot definition descriptor emitted once per ViewId/EcsQueryId per profiling session. Wire format owned here.
public static class QueryDefinitionDescribeEventCodec
- Inheritance
-
QueryDefinitionDescribeEventCodec
- Inherited Members
Remarks
Layout after the 12-byte common header:
offset 12 u8 Kind (0=View, 1=EcsQuery)
offset 13..16 u32 LocalId
offset 17..18 u16 TargetComponentType
offset 19..20 i16 PrimaryIndexFieldIdx
offset 21..22 i16 SortFieldIdx
offset 23 u8 SortDescending
offset 24..25 u16 DefinitionSourceFileId
offset 26..29 i32 DefinitionSourceLine
offset 30..31 u16 DefinitionSourceMethodId
offset 32..33 u16 EvaluatorCount
offset 34+ repeated { u16 fieldIdx; u8 op; u8 reserved } × EvaluatorCount
offset N..N+1 u16 FieldDependencyCount
offset N+2.. repeated u16 fieldDependency × FieldDependencyCount
Fields
EvaluatorEntrySize
Bytes per evaluator entry: u16 fieldIdx + u8 op + u8 reserved.
public const int EvaluatorEntrySize = 4
Field Value
FieldDependencyEntrySize
Bytes per field-dependency entry: u16.
public const int FieldDependencyEntrySize = 2
Field Value
FixedPrefixSize
Fixed-prefix size: 12 B common header + 22 B fixed fields + 2 B EvaluatorCount = 36 B.
public const int FixedPrefixSize = 34
Field Value
Methods
ComputeSize(int, int)
Compute the exact on-wire size for the given evaluator + field-dependency counts.
public static int ComputeSize(int evaluatorCount, int fieldDependencyCount)
Parameters
Returns
Read(ReadOnlyMemory<byte>)
Decode a QueryDefinitionDescribe record.
public static QueryDefinitionDescribeData Read(ReadOnlyMemory<byte> source)
Parameters
sourceReadOnlyMemory<byte>
Returns
Write(Span<byte>, byte, long, byte, uint, ushort, short, short, byte, ushort, int, ushort, ReadOnlySpan<byte>, ReadOnlySpan<byte>, out int)
Encode a QueryDefinitionDescribe record. evaluators is a packed blob of
EvaluatorEntrySize-byte entries (FieldIdx u16, Op u8, Reserved u8). fieldDependencies is a
packed blob of u16 field indices.
public static void Write(Span<byte> destination, byte threadSlot, long timestamp, byte kind, uint localId, ushort targetComponentType, short primaryIndexFieldIdx, short sortFieldIdx, byte sortDescending, ushort definitionSourceFileId, int definitionSourceLine, ushort definitionSourceMethodId, ReadOnlySpan<byte> evaluators, ReadOnlySpan<byte> fieldDependencies, out int bytesWritten)
Parameters
destinationSpan<byte>threadSlotbytetimestamplongkindbytelocalIduinttargetComponentTypeushortprimaryIndexFieldIdxshortsortFieldIdxshortsortDescendingbytedefinitionSourceFileIdushortdefinitionSourceLineintdefinitionSourceMethodIdushortevaluatorsReadOnlySpan<byte>fieldDependenciesReadOnlySpan<byte>bytesWrittenint