VariantAccessor.access

Get a property out of component

  1. FieldType access(ComponentType component, KType key, RCIAllocator allocator)
  2. FieldType access(ComponentType component, KeyType key, RCIAllocator allocator)
    class VariantAccessor(ComponentType, FieldType = ComponentType, KeyType = ComponentType)
    const
    FieldType
    access
    (
    ComponentType component
    ,
    in KeyType key
    ,
    RCIAllocator allocator = theAllocator
    )
    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...
    )
    )

Parameters

component ComponentType

a component which has some properties identified by property.

Return Value

Type: FieldType

FieldType accessed property.

Throws

NotFoundException in case when no requested property is available. InvalidArgumentException in case when passed arguments are somehow invalid for use.

Meta