class

Bindgen::Graph::Class

Inherits Bindgen::Graph::Container < Bindgen::Graph::Node < Reference < Object

A class in Crystal, or a C++ struct. We use a struct in C++ due to it defaulting to public visibility.

Constants

CONTAINER_ELEMENTS_TAG = "CONTAINER_ELEMENTS_TAG"

With CONTAINER_TYPE_TAG: the Crystal types of the elements, comma separated as the wrapper names them: Int32, or String, Variant.

CONTAINER_KIND_TAG = "CONTAINER_KIND_TAG"

With CONTAINER_TYPE_TAG: the container kind, sequential, set or associative.

CONTAINER_TYPE_TAG = "CONTAINER_TYPE_TAG"

Set by Processor::InstantiateContainers on the wrapper class of a sequential, set or associative container instantiation: the C++ type, like QList<int>.

DISCOVER_METHOD = "bg_discover"

Name of the Crystal class method wrapping a pointer to this class in the wrapper class of the object's dynamic type, see Processor::Inheritance and SPEC.md §2.3.7.

FORCE_UNWRAP_VARIABLE_TAG = "FORCE_UNWRAP_VARIABLE_TAG"

When this tag is set, Processor::CrystalWrapper will emit the @unwrap instance variable and the #to_unsafe method. This overrides its default behaviour of deducing if these are required.

Constructors

new(origin : Bindgen::Parser::Class, name, parent = nil)
Source

Instance methods

abstract=(abstract __arg0 : Bool)

Is this class abstract?

Source
abstract?

Is this class abstract?

Source
base_class

Name of the base-class, if any. Used by both Crystal and C++, and may point at types outside the graph.

Source
base_class=(base_class : String | Nil)

Name of the base-class, if any. Used by both Crystal and C++, and may point at types outside the graph.

Source
cpp_sub_class

If this class is to be shadow sub-classed in C++, the full name of the structure. Processors make the assumption that if this is set, the class will be sub-classed, and may generate code different to what they would've done without. This affects Crystal #initialize methods, and the CONSTRUCT C++ wrappers.

Source
cpp_sub_class=(cpp_sub_class : String | Nil)

If this class is to be shadow sub-classed in C++, the full name of the structure. Processors make the assumption that if this is set, the class will be sub-classed, and may generate code different to what they would've done without. This affects Crystal #initialize methods, and the CONSTRUCT C++ wrappers.

Source
included_modules

List of included Crystal modules. Used by wrapper classes only, and may point at modules outside the graph. Ignored by C++ structs.

Source
instance_variables

Crystal instance vars in this class. Will be ignored by the C++ code paths.

Source
mangled_name

The mangled name of this class, used to build structures with a class name component.

Source
origin

The origin class

Source
structure

If the structure of this class is copied, the Struct or CppUnion node.

Source
structure=(structure : Struct | CppUnion | Nil)

If the structure of this class is copied, the Struct or CppUnion node.

Source
type_discovery=(type_discovery : Bool)

Does this class have a DISCOVER_METHOD? Set by Processor::Inheritance for every wrapper class, see SPEC.md §2.3.7. Crystal::Pass#from_wrapper then wraps a pointer to this class through it.

Source
type_discovery?

Does this class have a DISCOVER_METHOD? Set by Processor::Inheritance for every wrapper class, see SPEC.md §2.3.7. Crystal::Pass#from_wrapper then wraps a pointer to this class through it.

Source
wrap_class

If this is set, the class is assumed to be abstract. This property then contains the implementation class node.

Source
wrap_class=(wrap_class : Class | Nil)

If this is set, the class is assumed to be abstract. This property then contains the implementation class node.

Source
wrapped_class

Opposite direction of #wrap_class: From the Impl class back to its abstract parent.

Source
wrapped_class=(wrapped_class : Class | Nil)

Opposite direction of #wrap_class: From the Impl class back to its abstract parent.

Source