Module GObject_introspection.Union_info

type t

Union_info represents a union type. A union has methods and fields. Unions can optionally have a discriminator, which is a field deciding what type of real union fields is valid for specified instance.

val unioninfo : t Ctypes.structure Ctypes.typ
val get_n_fields : t Ctypes.structure Ctypes.ptr -> int

Obtain the number of fields this union has.

val get_size : t Ctypes.structure Ctypes.ptr -> int

Obtain the total size of the union.

val get_alignment : t Ctypes.structure Ctypes.ptr -> int

Obtain the required alignment of the union.

val get_n_methods : t Ctypes.structure Ctypes.ptr -> int

Obtain the number of methods this union has.

val get_field : t Ctypes.structure Ctypes.ptr -> int -> Field_info.t Ctypes.structure Ctypes.ptr

Obtain the type information for field with specified index.

val get_method : t Ctypes.structure Ctypes.ptr -> int -> Function_info.t Ctypes.structure Ctypes.ptr

Obtain the type information for method with specified index.

val find_method : t Ctypes.structure Ctypes.ptr -> string -> Function_info.t Ctypes.structure Ctypes.ptr option

Obtain the type information for method named name .

val is_discriminated : t Ctypes.structure Ctypes.ptr -> bool

Return true if this union contains discriminator field.

val get_discriminator_offset : t Ctypes.structure Ctypes.ptr -> int

Returns offset of the discriminator field in the structure.

val get_discriminator_type : t Ctypes.structure Ctypes.ptr -> Type_info.t Ctypes.structure Ctypes.ptr

Obtain the type information of the union discriminator.

val get_discriminator : t Ctypes.structure Ctypes.ptr -> int -> Constant_info.t Ctypes.structure Ctypes.ptr

Obtain discriminator value assigned for n-th union field, i.e. n-th union field is the active one if discriminator contains this constant.

val cast_from_baseinfo : Base_info.t Ctypes.structure Ctypes.ptr -> t Ctypes.structure Ctypes.ptr

Just cast OCaml Ctypes base info to union info.

val cast_to_baseinfo : t Ctypes.structure Ctypes.ptr -> Base_info.t Ctypes.structure Ctypes.ptr

Just cast OCaml Ctypes union info to base info

val from_baseinfo : Base_info.t Ctypes.structure Ctypes.ptr -> t Ctypes.structure Ctypes.ptr

Return a Union_info.t from a Base_info.t, the underlying C structure ref count is increased and the value is Gc.finalis"ed" with Base_info.baseinfo_unref.

val to_baseinfo : t Ctypes.structure Ctypes.ptr -> Base_info.t Ctypes.structure Ctypes.ptr

Return a Base_info.t form a Union_info, the underlying C structure ref count is increased and the value is Gc.finalis"ed" with Base_info.baseinfo_unref.

val cast_from_registeredtypeinfo : Registered_type_info.t Ctypes.structure Ctypes.ptr -> t Ctypes.structure Ctypes.ptr

Just cast OCaml Ctypes registeredtype info to union info.

val cast_to_registeredtypeinfo : t Ctypes.structure Ctypes.ptr -> Registered_type_info.t Ctypes.structure Ctypes.ptr

Just cast OCaml Ctypes union info to registeredtype info

val from_registeredtypeinfo : Registered_type_info.t Ctypes.structure Ctypes.ptr -> t Ctypes.structure Ctypes.ptr

Return a Union_info.t from a Registered_type_info.t, the underlying C structure ref count is increased and the value is Gc.finalis"ed" with Registered_type_info.registeredtypeinfo_unref.

val to_registeredtypeinfo : t Ctypes.structure Ctypes.ptr -> Registered_type_info.t Ctypes.structure Ctypes.ptr

Return a Registered_type_info.t form a Union_info, the underlying C structure ref count is increased and the value is Gc.finalis"ed" with Registered_type_info.registeredtypeinfo_unref.