Class DBComponentDefinition
Compiled description of a single component revision: its name, schema revision, storage layout, fields, and index metadata.
Built once from a [Component]-annotated struct (via CreateFromAccessor<T>()) and thereafter immutable.
public class DBComponentDefinition
- Inheritance
-
DBComponentDefinition
- Inherited Members
Properties
ComponentStorageOverhead
Bytes of per-chunk overhead stored alongside the field data: the inline entityPK (EntityPKOverheadSize) plus one back-reference
slot per multi-valued index (MultipleIndicesCount times sizeof(int)).
public int ComponentStorageOverhead { get; }
Property Value
ComponentStorageSize
Byte size of the component's field data (the largest field offset plus its size), excluding per-chunk overhead.
public int ComponentStorageSize { get; }
Property Value
ComponentStorageTotalSize
Total per-chunk stride: ComponentStorageSize plus ComponentStorageOverhead.
public int ComponentStorageTotalSize { get; }
Property Value
DefaultDiscipline
Default durability discipline (from [Component(DefaultDiscipline=…)]). Only meaningful for
SingleVersion; TickFence otherwise.
public DurabilityDiscipline DefaultDiscipline { get; }
Property Value
EntityPKOverheadSize
Size of the inline entityPK in the chunk overhead (8 bytes for all SV/Transient components, 0 for Versioned). Non-versioned components store the entityPK at chunk offset 0 to enable chunkId → entityPK resolution.
public int EntityPKOverheadSize { get; }
Property Value
FieldsByName
All fields of this component keyed by field name, including static (non-stored) fields.
public IReadOnlyDictionary<string, DBComponentDefinition.Field> FieldsByName { get; }
Property Value
FullName
public string FullName { get; }
Property Value
IndicesCount
Number of indexed fields on this component (fields carrying [Index]).
public int IndicesCount { get; }
Property Value
this[int]
The field with the given FieldId. Valid indices are 0 to MaxFieldId minus one.
public DBComponentDefinition.Field this[int index] { get; }
Parameters
indexint
Property Value
MaxFieldId
One past the highest non-static FieldId; equals the length of the FieldId-indexed array backing this[int].
public int MaxFieldId { get; }
Property Value
MultipleIndicesCount
Number of indexed fields whose index allows multiple entities per key (non-unique); each reserves a back-reference slot in the overhead.
public int MultipleIndicesCount { get; }
Property Value
Name
Component name — from Name, or the struct type name when unset.
public string Name { get; }
Property Value
POCOType
The unmanaged struct type this definition was built from, or the registered POCO type. May be null until set by the builder.
public Type POCOType { get; }
Property Value
Revision
Schema revision of this definition, from Revision. Distinct revisions of the same name coexist.
public int Revision { get; }
Property Value
SpatialField
Reference to the field with [SpatialIndex], or null if none.
public DBComponentDefinition.Field SpatialField { get; }
Property Value
StorageMode
How this component's data is stored, persisted, and recovered. See StorageMode.
public StorageMode StorageMode { get; }
Property Value
Methods
CreateField(int, string, FieldType, FieldType, int, Type)
Creates a field, registers it under name, and returns it.
public DBComponentDefinition.Field CreateField(int fieldId, string name, FieldType type, FieldType underlyingType, int offset, Type dotNetType)
Parameters
fieldIdintUnique field identifier within the component.
namestringField name; must be unique within the component.
typeFieldTypeField type as stored on the component.
underlyingTypeFieldTypeElement type when
typeis a collection; otherwise None.offsetintByte offset of the field within the component's storage.
dotNetTypeTypeThe backing CLR type of the field.
Returns
- DBComponentDefinition.Field
The newly created DBComponentDefinition.Field.
Exceptions
- ArgumentException
A field with the same name already exists on the component.
GetFieldId(string)
Returns the FieldId of the field with the given name, or -1 if no such field exists.
public int GetFieldId(string fieldName)
Parameters
fieldNamestring