struct

Bindgen::Crystal::Pass

Inherits Bindgen::TypeHelper < Struct < Value < Object

Methods for passing data from Crystal and Crystal bindings to C++.

This is a helper struct: Cheap to create and to pass around.

Constants

Log = ::Log.for(self)

Constructors

new(db : TypeDatabase)
Source

Instance methods

arguments_to_binding(list : Enumerable(Parser::Argument), outs = [] of Int32)

Turns the list of arguments into a list of Call::Arguments. The arguments at the indices outs, see Parser::Method#out_arguments, become Call::OutArguments, see #out_argument_to_binding.

Source
arguments_to_wrapper(list : Enumerable(Parser::Argument), outs = [] of Int32, block = true)

Turns the list of arguments into a list of Call::Arguments. Of the out arguments at the indices outs, see Parser::Method#out_arguments, the wrapper takes the in/out ones, the references, by value, and drops the out-only ones, the pointers: their values are part of the result, see #wrapper_result. A Proc argument is taken as a block if it is the last one, unless block is false: a setter can't have a block.

Source
from(type : Parser::Type, is_constructor = false, no_slice = false, &) : Call::Result
Source
from_binding(type : Parser::Type, qualified = false, is_constructor = false, no_slice = false) : Call::Result

Computes a result for passing type from C++ to Crystal.

If qualified is true, the type is assumed to be used outside the lib Binding, and will be qualified if required.

Source
from_wrapper(type : Parser::Type, is_constructor = false, no_slice = false, callback_argument = false, discover = true) : Call::Result

Computes a result for passing type from the wrapper to the user.

A pointer or reference to a class with Graph::Class#type_discovery? is wrapped by its DISCOVER_METHOD, in the wrapper class of the object's dynamic type, unless discover is false.

Source
to(type : Parser::Type, &) : Call::Result
Source
to_binding(type : Parser::Type, to_unsafe = false, qualified = false) : Call::Result

Computes a result for passing type from Crystal to C++. If to_unsafe is true, and the type is not built-in, the result will be wrapped in a call to to_unsafe - Except if a user-defined conversion is set.

Source
to_wrapper(type : Parser::Type) : Call::Result

Computes a result for passing type to the wrapper.

Source
wrapper_result(method : Parser::Method) : Call::Result

The result of the wrapper of method: that of its return type, see #from_wrapper, followed by the values of its out arguments, see Parser::Method#out_arguments, as a Call::TupleResult. Each value is read from the local of #out_argument_to_binding by the conversion of #from_binding.

Source