-
Notifications
You must be signed in to change notification settings - Fork 2
TypeRef
A xlang::meta::reader::TypeRef structure introduces a level of indirection to a TypeDef.
Since it is a row in a database table, TypeRef derives from xlang::meta::reader::row_base<TypeRef>, and all row operations are available, although in practice you won't use them directly, preferring to use the accessors defined here.
Some methods return a TypeRef that may be empty, as reported by operator bool(). All method calls are invalid on an empty TypeRef. (Except for operator bool(), of course.)
xlang::meta::reader::coded_index<ResolutionScope> ResolutionScope() const;Returns a coded_index<ResolutionScope> that identifies a row in the Module, ModuleRef, AssemblyRef or TypeRef table. This is column 0 in the database schema.
Complexity: O(1)
Exceptions: Throws std::invalid_argument if the database is corrupted.
std::string_view TypeName() const;Returns the name of the type being referred to. This is column 1 in the database schema.
Complexity: O(n) in the size of the returned string view.
Exceptions: Throws std::invalid_argument if the database is corrupted.
std::string_view TypeNamespace() const;Returns the namespace of the type being referred to. This is column 2 in the database schema.
Complexity: O(n) in the size of the returned string view.
Exceptions: Throws std::invalid_argument if the database is corrupted.
xlang::meta::reader::CustomAttributeSig Value() const;Returns the value of the custom attribute.
Complexity: O(n) where n is the "size" of the attribute's value. This is the number of parameters, plus the size of those parameters.
Exceptions: Throws std::invalid_argument if the database is corrupted. Throws std::bad_alloc if out of memory.
std::pair<std::string_view const, std::string_view>
TypeNamespaceAndName() const;Returns the namespace and name of the type of the custom attribute. This parses the Type() into a namespace and name.
Complexity: O(1).
Exceptions: Throws std::invalid_argument if the database is corrupted.
std::pair<xlang::meta::reader::CustomAttribute, xlang::meta::reader::CustomAttribute>
CustomAttribute() const;Returns a range (pair of iterators) that represents the custom attributes associated with this type. If this range is empty, then the type has no custom attributes.
See also the get_attribute() helper function.
Although TypeRefs can in theory possess attributes, in practice they do not. The attributes reside on the corresponding TypeDef.
Complexity: O(log n), where n is the size of the CustomAttributes table.
Exceptions: Throws std::invalid_argument if the database is corrupted.