set_qdata


Description:

[ CCode ( simple_generics = true ) ]
public void set_qdata<T> (Quark quark, owned T data)

This sets an opaque, named pointer on a miniobject.

The name is specified through a Quark (retrieved e.g. via g_quark_from_static_string), and the pointer can be gotten back from the this with get_qdata until the this is disposed. Setting a previously set user data pointer, overrides (frees) the old pointer set, using null as pointer essentially removes the data stored.

destroy may be specified which is called with data as argument when the this is disposed, or the data is being overwritten by a call to set_qdata with the same quark.

Parameters:

this

a MiniObject

quark

A Quark, naming the user data pointer

data

An opaque user data pointer

destroy

Function to invoke with data as argument, when data needs to be freed