class

Bindgen::Processor::VirtualOverride::JumptableHook

Inherits Bindgen::Call::Body < Reference < Object

Hook to set the jumptable in an initializer.

Constants

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

new(db : TypeDatabase, klass : Graph::Class, table : Graph::Struct, setter : Parser::Method)
Source

Instance methods

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

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

Source