struct

Bindgen::Cpp::MethodName

Inherits Bindgen::TypeHelper < Struct < Value < Object

Generator for calling methods by their name.

Constants

GLOBAL_SCOPE = "::"

Constructors

new(db : TypeDatabase)
Source

Instance methods

gc_wrapper_class?(class_name : String) : Bool

Do the constructors of class_name, but an aggregate constructor, allocate a CrystalGCWrapper? Not those of a copied type, a C++ union or a final class.

Source
gc_wrapper_constructor?(method : Parser::Method, type : Parser::Method::Type = method.type) : Bool

Is method a constructor allocating a CrystalGCWrapper of its class, instead of the class itself? See #generate.

Source
generate(method : Parser::Method, self_var : String, type : Parser::Method::Type | Nil = nil, exact_member = false)

Generates the C++ method name.

If this kind of method requires an instance, it will use self_var and use -> on it.

If the method is any constructor, and the type is copied, the constructor will be called without new, effectively returning a value. Otherwise, a normal new is used to return a pointer. An aggregate constructor allocates the class itself, so that the caller can brace-initialize it. So do the constructors of a C++ union or final class, which can't be wrapped as it can't be inherited from.

If exact_member is true and method is a member method, the qualified method is called, bypassing dynamic lookup.

Source