gobj_create_volatil()

gobj_create_volatil()#

Creates a new volatile gobj instance of the specified gclass_name with the given attributes and parent. A volatile gobj is automatically destroyed when its parent is destroyed.

Prototype

hgobj gobj_create_volatil(
    const char      *gobj_name,
    gclass_name_t   gclass_name,
    json_t          *kw, // owned
    hgobj           parent
);

Parameters

Key

Type

Description

gobj_name

const char *

The name of the gobj instance.

gclass_name

gclass_name_t

The name of the gclass to instantiate.

kw

json_t *

A JSON object containing the attributes for the gobj. The ownership of this object is transferred to the function.

parent

hgobj

The parent gobj to which the new gobj will be attached.


Return Value

Returns a handle to the newly created volatile gobj, or NULL if creation fails.

Notes

A volatile gobj is automatically destroyed when its parent is destroyed. Use gobj_create2() for more control over gobj creation.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples