class
Bindgen::TypeDatabase::TypeConfig
- Bindgen::TypeDatabase::TypeConfig
- Reference
- Object
Overview
Configuration of types, used in Configuration#types (The types: map
in YAML). See TypeDatabase::Configuration.
Included Modules
- YAML::Serializable
Defined in:
bindgen/type_database.crConstructors
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(crystal_type : String | Nil = nil, cpp_type : String | Nil = nil, binding_type : String | Nil = nil, from_cpp : Bindgen::Template::Base = Template::None.new, to_cpp : Bindgen::Template::Base = Template::None.new, converter : Nil | String = nil, from_crystal : Bindgen::Template::Base = Template::None.new, to_crystal : Bindgen::Template::Base = Template::None.new, kind : Bindgen::Parser::Type::Kind = Parser::Type::Kind::Class, ignore : Bool = false, pass_by : Bindgen::TypeDatabase::PassBy = PassBy::Original, wrapper_pass_by : PassBy | Nil = nil, sub_class : Bool = true, copy_structure : Bool = false, bit_fields : Bindgen::TypeDatabase::BitFields = BitFields::Accessors, generate_wrapper : Bool = true, generate_binding : Bool = true, generate_superclass : Bool = true, builtin : Bool = false, ignore_methods : Array(String) = [] of String, superclass_ignore_methods : Regex = Util::FAIL_RX, keep_alive : Hash(Regex, Nil | Array(Int32)) = KeepAlive.new, instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig) = InstanceVariableConfig::Collection.new, graph_node : Bindgen::Graph::Node | Nil = nil, container_type : Nil | String = nil, kind_present : Bool = false)
Instance Method Summary
-
#anonymous? : Bool
Is this type anonymous?
-
#binding_type : String | Nil
The type used in Crystal, but only in the
libbinding. -
#binding_type=(binding_type : String | Nil)
The type used in Crystal, but only in the
libbinding. -
#bit_fields : Bindgen::TypeDatabase::BitFields
How the
lib structof a copied structure accesses its bit-fields. -
#bit_fields=(bit_fields : Bindgen::TypeDatabase::BitFields)
How the
lib structof a copied structure accesses its bit-fields. -
#builtin=(builtin : Bool)
Treat this type as built-in type in C++ and Crystal.
-
#builtin? : Bool
Treat this type as built-in type in C++ and Crystal.
-
#container_type : String | Nil
The name of the Crystal container module this type includes, if any.
-
#container_type=(container_type : String | Nil)
The name of the Crystal container module this type includes, if any.
-
#converter : String | Nil
Converter for this type in Crystal.
-
#converter=(converter : String | Nil)
Converter for this type in Crystal.
-
#copy_structure=(copy_structure : Bool)
If the structure (as in, its non-static fields) shall be tried to replicated in Crystal.
-
#copy_structure? : Bool
If the structure (as in, its non-static fields) shall be tried to replicated in Crystal.
-
#cpp_type : String | Nil
The C++ type to pass it around.
-
#cpp_type=(cpp_type : String | Nil)
The C++ type to pass it around.
-
#crystal_pass_by : PassBy
Pass-by configuration in wrapper code.
-
#crystal_type : String | Nil
The crystal name of this type.
-
#crystal_type=(crystal_type : String | Nil)
The crystal name of this type.
-
#from_cpp : Template::Base
Template code ran to turn the real C++ type into the crystal type.
-
#from_cpp=(from_cpp : Template::Base)
Template code ran to turn the real C++ type into the crystal type.
-
#from_crystal : Template::Base
Template code ran to turn the Crystal type for the binding.
-
#from_crystal=(from_crystal : Template::Base)
Template code ran to turn the Crystal type for the binding.
-
#generate_binding=(generate_binding : Bool)
If to generate bindings in C++ and Crystal.
-
#generate_binding? : Bool
If to generate bindings in C++ and Crystal.
-
#generate_superclass=(generate_superclass : Bool)
If to generate a superclass wrapper in Crystal.
-
#generate_superclass? : Bool
If to generate a superclass wrapper in Crystal.
-
#generate_wrapper=(generate_wrapper : Bool)
If to generate a wrapper in Crystal.
-
#generate_wrapper? : Bool
If to generate a wrapper in Crystal.
-
#graph_node : Graph::Node | Nil
The node this type is represented by in the graph, if any
-
#graph_node=(graph_node : Graph::Node | Nil)
The node this type is represented by in the graph, if any
-
#ignore=(ignore : Bool)
Ignore any and all methods using this type anywhere.
-
#ignore? : Bool
Ignore any and all methods using this type anywhere.
-
#ignore_methods : Array(String)
Which methods to filter out.
-
#ignore_methods=(ignore_methods : Array(String))
Which methods to filter out.
-
#instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig)
Instance variable configuration.
-
#instance_variables=(instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig))
Instance variable configuration.
-
#keep_alive : Hash(Regex, Array(Int32)?)
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. -
#keep_alive=(keep_alive : Hash(Regex, Nil | Array(Int32)))
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. -
#kind : Bindgen::Parser::Type::Kind
Semantics of the type (Kind overwrite)
-
#kind=(kind : Bindgen::Parser::Type::Kind)
Semantics of the type (Kind overwrite)
-
#kind_present? : Bool
Whether
kind:was given in the YAML configuration. -
#lib_type : String | Nil
Type name to use in the Crystal
libblock. -
#merge(other : self) : self
Merges the other rules with these rules.
-
#pass_by : Bindgen::TypeDatabase::PassBy
How to pass this type to C++?
-
#pass_by=(pass_by : Bindgen::TypeDatabase::PassBy)
How to pass this type to C++?
-
#sub_class=(sub_class : Bool)
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
-
#sub_class? : Bool
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
-
#superclass_ignore_methods : Regex
Which methods to filter out in the superclass wrapper.
-
#superclass_ignore_methods=(superclass_ignore_methods : Regex)
Which methods to filter out in the superclass wrapper.
-
#to_cpp : Template::Base
Template code ran to turn the crystal type into the real C++ type.
-
#to_cpp=(to_cpp : Template::Base)
Template code ran to turn the crystal type into the real C++ type.
-
#to_crystal : Template::Base
Template code ran to turn the binding type to Crystal.
-
#to_crystal=(to_crystal : Template::Base)
Template code ran to turn the binding type to Crystal.
-
#wrapper_pass_by : Bindgen::TypeDatabase::PassBy | Nil
How to pass this type from Crystal? Defaults to
#pass_by. -
#wrapper_pass_by=(wrapper_pass_by : Bindgen::TypeDatabase::PassBy | Nil)
How to pass this type from Crystal? Defaults to
#pass_by. -
#wrapper_type : String | Nil
Type name to use in the Crystal wrapper.
Constructor Detail
Instance Method Detail
The type used in Crystal, but only in the lib binding.
How the lib struct of a copied structure accesses its bit-fields.
How the lib struct of a copied structure accesses its bit-fields.
The name of the Crystal container module this type includes, if any.
Used by CrystalContainerOf.
The name of the Crystal container module this type includes, if any.
Used by CrystalContainerOf.
Converter for this type in Crystal. Takes precedence over the
#to_crystal and #from_crystal fields.
Converter for this type in Crystal. Takes precedence over the
#to_crystal and #from_crystal fields.
If the structure (as in, its non-static fields) shall be tried to
replicated in Crystal. Implies instance_variables: false, unless a
wrapper class hosts the structure (see TypeHelper#structure_hosted?).
This doesn't support inheritance!
If the structure (as in, its non-static fields) shall be tried to
replicated in Crystal. Implies instance_variables: false, unless a
wrapper class hosts the structure (see TypeHelper#structure_hosted?).
This doesn't support inheritance!
Pass-by configuration in wrapper code. Prefers the #wrapper_pass_by
value, and falls back to #pass_by.
Template code ran to turn the real C++ type into the crystal type.
Template code ran to turn the Crystal type for the binding.
If to generate a superclass wrapper in Crystal.
The node this type is represented by in the graph, if any
Instance variable configuration. Each hash key is a regex used to match instance variable names.
Instance variable configuration. Each hash key is a regex used to match instance variable names.
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. Each key is
a regex matched against the method name.
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. Each key is
a regex matched against the method name.
Type name to use in the Crystal lib block. Namespace operators (::)
are automatically converted into underscores for types defined in
lib Binding.
Merges the other rules with these rules. If a rule is set in both rule-sets, the value from other wins.
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
Which methods to filter out in the superclass wrapper. A method is ignored if it matches any of the regex patterns specified.
Which methods to filter out in the superclass wrapper. A method is ignored if it matches any of the regex patterns specified.
Template code ran to turn the crystal type into the real C++ type.
Template code ran to turn the binding type to Crystal.
How to pass this type from Crystal? Defaults to #pass_by.
How to pass this type from Crystal? Defaults to #pass_by.