class

Bindgen::Graph::Struct

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

A struct in Crystal (lib or not), or a plain struct in C++.

A structure can host both raw non-static variable fields (C-style) and other methods at once.

Constants

COPY_BASE_CONSTRUCTOR_TAG = "COPY_BASE_CONSTRUCTOR_TAG"

Used to signal the Generator::Cpp to generate a constructor copying an instance of the base class, which isn't inherited by the above.

INHERIT_CONSTRUCTORS_TAG = "INHERIT_CONSTRUCTORS_TAG"

Used to signal the Generator::Cpp to generate a using BASE::BASE;.

Constructors

new(fields : Hash(String, Bindgen::Call::Result), name, parent, base_class : Nil | String = nil, packed : Bool = false)
Source

Instance methods

base_class

Name of the base-class, if any. This is mainly useful for C++ to generate the jump-table.

Source
base_class=(base_class : String | Nil)

Name of the base-class, if any. This is mainly useful for C++ to generate the jump-table.

Source
bit_fields

Bit-fields of a lib struct, which get getter and setter methods.

Source
field_defaults

Default member initializers of fields, by name, as C++ expressions: nullptr. Only Generator::Cpp writes them.

Source
fields

Non-static fields in this structure.

Source
packed?

Are the fields packed without alignment, as in a @[Packed] struct?

Source

Nested types