class Bindgen::Processor::VirtualOverride::JumptableHook

Overview

Hook to set the jumptable in an initializer.

Defined in:

bindgen/processor/virtual_override.cr

Constant Summary

MATCH_OVERLOAD_MACRO = " methods.select { |m| m.name.stringify == sig[1] && !m.annotation(BindgenWrapper) }.each do |m|\n args = m.splat_index ? m.args[0...m.splat_index] : m.args\n ok = sig[2].size >= args.select { |a| a.default_value.is_a?(Nop) }.size && (m.splat_index || sig[2].size <= args.size)\n sig[2].each_with_index do |name, i|\n r = ok ? (i < args.size ? args[i] : m.args[m.splat_index]).restriction : nil\n if r.is_a?(Path) || r.is_a?(Generic) || r.is_a?(Union)\n r = r.resolve?\n t = parse_type(name).resolve?\n ok = false if r && t && !(t <= r) && !(r <= t)\n end\n end\n forwarded << sig[0] if ok && !forwarded.includes?(sig[0])\n end\n"

Macro code adding the mangled name sig[0] to forwarded if any method in methods named sig[1] accepts the argument types sig[2]. Unresolvable type restrictions are assumed to match.

Constructors

Instance Method Summary

Instance methods inherited from class Bindgen::Call::Body

to_code(call : Call, platform : Graph::Platform) : String to_code

Constructor Detail

def self.new(db : TypeDatabase, klass : Graph::Class, table : Graph::Struct, setter : Parser::Method) #

[View source]

Instance Method Detail

def to_code(call : Call, platform : Graph::Platform) : String #
Description copied from class Bindgen::Call::Body

Will be called by a Generator later on, passing in the call and the target platform.


[View source]