GDExtensionInterfaceGetVariantGetInternalPtrFunc typedef

GDExtensionInterfaceGetVariantGetInternalPtrFunc = Pointer<NativeFunction<GDExtensionInterfaceGetVariantGetInternalPtrFuncFunction>>

@name variant_get_ptr_internal_getter @since 4.4

Provides a function pointer for retrieving a pointer to a variant's internal value. Access to a variant's internal value can be used to modify it in-place, or to retrieve its value without the overhead of variant conversion functions. It is recommended to cache the getter for all variant types in a function table to avoid retrieval overhead upon use.

@note Each function assumes the variant's type has already been determined and matches the function. Invoking the function with a variant of a mismatched type has undefined behavior, and may lead to a segmentation fault.

@param p_type The Variant type.

@return A pointer to a type-specific function that returns a pointer to the internal value of a variant. Check the implementation of this function (gdextension_variant_get_ptr_internal_getter) for pointee type info of each variant type.

Implementation

typedef GDExtensionInterfaceGetVariantGetInternalPtrFunc =
    ffi.Pointer<
      ffi.NativeFunction<
        GDExtensionInterfaceGetVariantGetInternalPtrFuncFunction
      >
    >;