Class ComponentAttribute
- Namespace
- Typhon.Schema.Definition
- Assembly
- Typhon.Schema.Definition.dll
Marks a struct as an ECS component type and carries its schema identity (Name, Revision) plus its storage and durability defaults. The annotated struct must be blittable (unmanaged) so components can be stored and persisted zero-copy.
[AttributeUsage(AttributeTargets.Struct)]
public sealed class ComponentAttribute : Attribute
- Inheritance
-
ComponentAttribute
- Inherited Members
Constructors
ComponentAttribute(string, int)
Declares a component with the given schema name and revision.
public ComponentAttribute(string name, int revision)
Parameters
Properties
DefaultDiscipline
Default durability discipline for this component when its StorageMode is SingleVersion. Default is TickFence (batched, ≤1-tick loss). Set to Commit to make any transaction that writes this component commit-durable (zero-loss, atomic) for all of its writes (CM-02 uniformity). Ignored for Versioned (always commit-scoped) and Transient (never durable).
public DurabilityDiscipline DefaultDiscipline { get; set; }
Property Value
Name
Registered component name — the stable schema identity persisted with the data and matched by name when the database is reopened.
public string Name { get; }
Property Value
PreviousName
Former Name of this component, set when it is renamed so the persisted schema can be matched to the new name on reopen. null when never renamed.
public string PreviousName { get; set; }
Property Value
Revision
Component schema revision. Increment when the field set changes; migrations only run forward, so the target revision must exceed the persisted one.
public int Revision { get; }
Property Value
StorageMode
Storage mode for this component. Default is Versioned (full MVCC).
public StorageMode StorageMode { get; set; }