VariantAccessor

Accessor implementing logic for accessingstd.variant.

ImplSpec: The accessor can accept any variant of ComponentType. The restriction is that the underlying stored data should be of either associative array or dynamic array in order to access the contents of them. The return type is as well a variant that must be able to store associative's array field, or arrays elements.

@component
class VariantAccessor : PropertyAccessor!(ComponentType, FieldType, KeyType)(
ComponentType
FieldType = ComponentType
KeyType = ComponentType
) if (
is(ComponentType : VariantN!(ComponentSize, ComponentTypes),
size_t ComponentSize
ComponentTypes...
) &&
is(FieldType : VariantN!(FieldSize, FieldTypes),
size_t FieldSize
FieldTypes...
)
&&
is(KeyType : VariantN!(KeySize, KeyTypes),
size_t KeySize
KeyTypes...
)
) {}

Members

Functions

access
FieldType access(ComponentType component, KType key, RCIAllocator allocator)

Get a property out of component

access
FieldType access(ComponentType component, KeyType key, RCIAllocator allocator)

Get a property out of component

componentType
TypeInfo componentType(ComponentType component)

Identify the type of supported component.

has
bool has(ComponentType component, KType key, RCIAllocator allocator)

Check if requested property is present in component.

has
bool has(ComponentType component, KeyType key, RCIAllocator allocator)

Check if requested property is present in component.

Meta