Skip to content

ElemSig

Raymond Chen edited this page Apr 1, 2019 · 2 revisions

A xlang::meta::reader::ElemSig structure represents a single fixed argument in a custom attribute. See CustomAttributeSig for an example.

Nested types

value_type

using value_type = std::variant<
    bool,             // index 0
    char16_t,         // index 1
    uint8_t,          // index 2
    int8_t,           // index 3
    uint16_t,         // index 4
    int16_t,          // index 5
    uint32_t,         // index 6
    int32_t,          // index 7
    uint64_t,         // index 8
    int64_t,          // index 9
    float,            // index 10
    double,           // index 11
    std::string_view, // index 12
    SystemType,       // index 13
    EnumValue>;       // index 4

The type of the fixed argument. Types 0 through 11 are self-explanatory.

The std::string_view represents a string literal.

The EnumValue represents a constant value of an enumerated type.

The SystemType represents an instance of some other type.

SystemType

struct SystemType
{
    std::string_view name;
};

This represents the name of the type.

EnumValue

struct EnumValue
{
    EnumDefinition type;
    value_type value;
};

The type represents the enumeration type that provides the value for this parameter, and value is its value.

value_type

using value_type = std::variant<
    bool,      // index 0 (disallowed in metadata files)
    char16_t,  // index 1 (disallowed in metadata files)
    uint8_t,   // index 2 (disallowed in metadata files)
    int8_t,    // index 3 (disallowed in metadata files)
    uint16_t,  // index 4 (disallowed in metadata files)
    int16_t,   // index 5 (disallowed in metadata files)
    uint32_t,  // index 6
    int32_t,   // index 7
    uint64_t,  // index 8 (disallowed in metadata files)
    int64_t>;  // index 9 (disallowed in metadata files)

The value_type is a variant of the various underlying types of enumerations. Although ECMA-335 permits a wide variety of underlying types, the Xlang type system requires enumerations to have an underlying type of either int32_t or uint32_t

equals_enumerator

bool equals_enumerator(std::string_view const& name) const;

Determines whether the value of the argument is equal to named field of the underlying enumerator.

The named field must exist in the underlying enumerator. if not, the behavior is undefined.

Clone this wiki locally