Skip to content

CustomAttributeSig

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

A xlang::meta::reader::CustomAttributeSig structure represents a custom attribute.

Example:

[contract(Windows.Foundation.UniversalApiContract, 5)] is represented as follows:

  • FixedArgs() is a vector of two FixedArgSig elements.
    • Value is an ElemSig whose type is either std::string_view or SystemType, and whose value or name is Windows.Foundation.UniversalApiContract. (Both variations occur in practice.)
    • Value is an ElemSig of type uint32_t whose value is 0x00050000. (Major version in high 16 bits, minor version in low 16 bits.)
  • NamedArgs() is empty.

The std::string_view case tends to be used for interfaces associated with a runtimeclass.

Methods

FixedArgs()

std::vector<xlang::meta::reader::FixedArgSig> const& FixedArgs() const noexcept;

Returns a vector of FixedArgSig objects which represent the fixed arguments to the attribute.

The lifetime of this vector is tied to the lifetime of the enclosing CustomAttributeSig.

Complexity: O(1)

NamedArgs

std::vector<xlang::meta::reader::NamedArgSig> const& NamedArgs() const noexcept;

Returns a vector of NamedArgSig objects which represent the named arguments to the attribute.

The lifetime of this vector is tied to the lifetime of the enclosing CustomAttributeSig.

Complexity: O(1)

Clone this wiki locally