NcmObjArray

NcmObjArray — GObjects array with serialization support.

Functions

NcmObjArray * ncm_obj_array_new ()
NcmObjArray * ncm_obj_array_sized_new ()
NcmObjArray * ncm_obj_array_ref ()
void ncm_obj_array_unref ()
void ncm_obj_array_clear ()
void ncm_obj_array_add ()
void ncm_obj_array_set ()
GObject * ncm_obj_array_get ()
GObject * ncm_obj_array_peek ()
guint ncm_obj_array_len ()
NcmObjDictStr * ncm_obj_dict_str_new ()
NcmObjDictStr * ncm_obj_dict_str_ref ()
void ncm_obj_dict_str_unref ()
void ncm_obj_dict_str_clear ()
void ncm_obj_dict_str_add ()
void ncm_obj_dict_str_set ()
GObject * ncm_obj_dict_str_get ()
GObject * ncm_obj_dict_str_peek ()
guint ncm_obj_dict_str_len ()
GStrv ncm_obj_dict_str_keys ()
NcmObjDictInt * ncm_obj_dict_int_new ()
NcmObjDictInt * ncm_obj_dict_int_ref ()
void ncm_obj_dict_int_unref ()
void ncm_obj_dict_int_clear ()
void ncm_obj_dict_int_add ()
void ncm_obj_dict_int_set ()
GObject * ncm_obj_dict_int_get ()
GObject * ncm_obj_dict_int_peek ()
guint ncm_obj_dict_int_len ()
GArray * ncm_obj_dict_int_keys ()
NcmVarDict * ncm_var_dict_new ()
NcmVarDict * ncm_var_dict_ref ()
void ncm_var_dict_unref ()
void ncm_var_dict_clear ()
void ncm_var_dict_set_string ()
void ncm_var_dict_set_int ()
void ncm_var_dict_set_double ()
void ncm_var_dict_set_boolean ()
void ncm_var_dict_set_int_array ()
void ncm_var_dict_set_double_array ()
void ncm_var_dict_set_boolean_array ()
void ncm_var_dict_set_variant ()
gboolean ncm_var_dict_has_key ()
gboolean ncm_var_dict_get_string ()
gboolean ncm_var_dict_get_int ()
gboolean ncm_var_dict_get_double ()
gboolean ncm_var_dict_get_boolean ()
gboolean ncm_var_dict_get_int_array ()
gboolean ncm_var_dict_get_double_array ()
gboolean ncm_var_dict_get_boolean_array ()
gboolean ncm_var_dict_get_variant ()
guint ncm_var_dict_len ()
GStrv ncm_var_dict_keys ()

Object Hierarchy

    GBoxed
    ├── NcmObjArray
    ├── NcmObjDictInt
    ├── NcmObjDictStr
    ╰── NcmVarDict

Description

A NcmObjArray is a GPtrArray that holds GObject's. It is used to store GObject's that can be serialized to a GVariant.

Functions

ncm_obj_array_new ()

NcmObjArray *
ncm_obj_array_new (void);

Creates a new NcmObjArray.

Returns

a new NcmObjArray.

[transfer full]


ncm_obj_array_sized_new ()

NcmObjArray *
ncm_obj_array_sized_new (guint n);

Creates a new NcmObjArray with n elements preallocated.

Parameters

n

initial allocation size.

 

Returns

a new NcmObjArray.

[transfer full]


ncm_obj_array_ref ()

NcmObjArray *
ncm_obj_array_ref (NcmObjArray *oa);

Increases the reference count of oa by one.

Parameters

oa

a NcmObjArray.

 

Returns

oa .

[transfer full]


ncm_obj_array_unref ()

void
ncm_obj_array_unref (NcmObjArray *oa);

Decreases the reference count of oa by one. If the reference count reaches zero, all objects in the array are unreferenced.

Parameters

oa

a NcmObjArray.

 

ncm_obj_array_clear ()

void
ncm_obj_array_clear (NcmObjArray **oa);

If *oa is not NULL, unreferences it and sets *oa to NULL.

Parameters

oa

a pointer to a NcmObjArray.

 

ncm_obj_array_add ()

void
ncm_obj_array_add (NcmObjArray *oa,
                   GObject *obj);

Adds a GObject to a NcmObjArray.

Parameters

oa

a NcmObjArray.

 

obj

a GObject.

 

ncm_obj_array_set ()

void
ncm_obj_array_set (NcmObjArray *oa,
                   guint i,
                   GObject *obj);

Sets a GObject to a NcmObjArray. If there is already a GObject at position i , it is unreferenced.

Parameters

oa

a NcmObjArray.

 

i

object index.

 

obj

a GObject.

 

ncm_obj_array_get ()

GObject *
ncm_obj_array_get (NcmObjArray *oa,
                   guint i);

Gets a GObject from a NcmObjArray at position i .

Parameters

oa

a NcmObjArray

 

i

object index

 

Returns

the GObject at position i .

[transfer full]


ncm_obj_array_peek ()

GObject *
ncm_obj_array_peek (NcmObjArray *oa,
                    guint i);

Peeks a GObject from a NcmObjArray at position i without increasing its reference count.

Parameters

oa

a NcmObjArray.

 

i

object index.

 

Returns

the GObject at position i .

[transfer none]


ncm_obj_array_len ()

guint
ncm_obj_array_len (NcmObjArray *oa);

Gets the length of a NcmObjArray.

Parameters

oa

a NcmObjArray

 

Returns

array length


ncm_obj_dict_str_new ()

NcmObjDictStr *
ncm_obj_dict_str_new (void);

Creates a new NcmObjDictStr.

Returns

a new NcmObjDictStr.

[transfer full]


ncm_obj_dict_str_ref ()

NcmObjDictStr *
ncm_obj_dict_str_ref (NcmObjDictStr *ods);

Increases the reference count of ods by one.

Parameters

ods

a NcmObjDictStr.

 

Returns

ods .

[transfer full]


ncm_obj_dict_str_unref ()

void
ncm_obj_dict_str_unref (NcmObjDictStr *ods);

Decreases the reference count of ods by one. If the reference count reaches zero, all objects in the dictionary are unreferenced.

Parameters

ods

a NcmObjDictStr.

 

ncm_obj_dict_str_clear ()

void
ncm_obj_dict_str_clear (NcmObjDictStr **ods);

If *ods is not NULL, unreferences it and sets *ods to NULL.

Parameters

ods

a pointer to a NcmObjDictStr.

 

ncm_obj_dict_str_add ()

void
ncm_obj_dict_str_add (NcmObjDictStr *ods,
                      const gchar *key,
                      GObject *obj);

Adds a GObject to a NcmObjDictStr.

Parameters

ods

a NcmObjDictStr.

 

key

a string.

 

obj

a GObject.

 

ncm_obj_dict_str_set ()

void
ncm_obj_dict_str_set (NcmObjDictStr *ods,
                      const gchar *key,
                      GObject *obj);

Sets a GObject to a NcmObjDictStr. If there is already a GObject with key key , it is unreferenced.

Parameters

ods

a NcmObjDictStr.

 

key

a string.

 

obj

a GObject.

 

ncm_obj_dict_str_get ()

GObject *
ncm_obj_dict_str_get (NcmObjDictStr *ods,
                      const gchar *key);

Gets a GObject from a NcmObjDictStr with key key .

Parameters

ods

a NcmObjDictStr

 

key

a string.

 

Returns

the GObject with key key .

[transfer full]


ncm_obj_dict_str_peek ()

GObject *
ncm_obj_dict_str_peek (NcmObjDictStr *ods,
                       const gchar *key);

Peeks a GObject from a NcmObjDictStr with key key without increasing its reference count.

Parameters

ods

a NcmObjDictStr.

 

key

a string.

 

Returns

the GObject with key key .

[transfer none]


ncm_obj_dict_str_len ()

guint
ncm_obj_dict_str_len (NcmObjDictStr *ods);

Gets the length of a NcmObjDictStr.

Parameters

ods

a NcmObjDictStr

 

Returns

dictionary length


ncm_obj_dict_str_keys ()

GStrv
ncm_obj_dict_str_keys (NcmObjDictStr *ods);

Gets the keys of a NcmObjDictStr.

Parameters

ods

a NcmObjDictStr

 

Returns

the keys of a NcmObjDictStr.

[transfer container]


ncm_obj_dict_int_new ()

NcmObjDictInt *
ncm_obj_dict_int_new (void);

Creates a new NcmObjDictInt.

Returns

a new NcmObjDictInt.

[transfer full]


ncm_obj_dict_int_ref ()

NcmObjDictInt *
ncm_obj_dict_int_ref (NcmObjDictInt *odi);

Increases the reference count of odi by one.

Parameters

odi

a NcmObjDictInt.

 

Returns

odi .

[transfer full]


ncm_obj_dict_int_unref ()

void
ncm_obj_dict_int_unref (NcmObjDictInt *odi);

Decreases the reference count of odi by one. If the reference count reaches zero, all objects in the dictionary are unreferenced.

Parameters

odi

a NcmObjDictInt.

 

ncm_obj_dict_int_clear ()

void
ncm_obj_dict_int_clear (NcmObjDictInt **odi);

If *odi is not NULL, unreferences it and sets *odi to NULL.

Parameters

odi

a pointer to a NcmObjDictInt.

 

ncm_obj_dict_int_add ()

void
ncm_obj_dict_int_add (NcmObjDictInt *odi,
                      gint key,
                      GObject *obj);

Adds a GObject to a NcmObjDictInt.

Parameters

odi

a NcmObjDictInt.

 

key

an integer.

 

obj

a GObject.

 

ncm_obj_dict_int_set ()

void
ncm_obj_dict_int_set (NcmObjDictInt *odi,
                      gint key,
                      GObject *obj);

Sets a GObject to a NcmObjDictInt. If there is already a GObject with key key , it is unreferenced.

Parameters

odi

a NcmObjDictInt.

 

key

an integer.

 

obj

a GObject.

 

ncm_obj_dict_int_get ()

GObject *
ncm_obj_dict_int_get (NcmObjDictInt *odi,
                      gint key);

Gets a GObject from a NcmObjDictInt with key key .

Parameters

odi

a NcmObjDictInt

 

key

an integer.

 

Returns

the GObject with key key .

[transfer full]


ncm_obj_dict_int_peek ()

GObject *
ncm_obj_dict_int_peek (NcmObjDictInt *odi,
                       gint key);

Peeks a GObject from a NcmObjDictInt with key key without increasing its reference count.

Parameters

odi

a NcmObjDictInt.

 

key

an integer.

 

Returns

the GObject with key key .

[transfer none]


ncm_obj_dict_int_len ()

guint
ncm_obj_dict_int_len (NcmObjDictInt *odi);

Gets the length of a NcmObjDictInt.

Parameters

odi

a NcmObjDictInt

 

Returns

dictionary length


ncm_obj_dict_int_keys ()

GArray *
ncm_obj_dict_int_keys (NcmObjDictInt *odi);

Gets the keys of a NcmObjDictInt.

Parameters

odi

a NcmObjDictInt

 

Returns

the keys of a NcmObjDictInt.

[transfer full][array][element-type int]


ncm_var_dict_new ()

NcmVarDict *
ncm_var_dict_new (void);

Creates a new NcmVarDict.

Returns

a new NcmVarDict.

[transfer full]


ncm_var_dict_ref ()

NcmVarDict *
ncm_var_dict_ref (NcmVarDict *vd);

Increases the reference count of vd by one.

Parameters

vd

a NcmVarDict.

 

Returns

vd .

[transfer full]


ncm_var_dict_unref ()

void
ncm_var_dict_unref (NcmVarDict *vd);

Decreases the reference count of vd by one. If the reference count reaches zero, all objects in the dictionary are unreferenced.

Parameters

vd

a NcmVarDict.

 

ncm_var_dict_clear ()

void
ncm_var_dict_clear (NcmVarDict **vd);

If *vd is not NULL, unreferences it and sets *vd to NULL.

Parameters

vd

a pointer to a NcmVarDict.

 

ncm_var_dict_set_string ()

void
ncm_var_dict_set_string (NcmVarDict *vd,
                         const gchar *key,
                         const gchar *value);

Sets a string to a NcmVarDict. If there is already a string with key key , it is unreferenced.

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a string

 

ncm_var_dict_set_int ()

void
ncm_var_dict_set_int (NcmVarDict *vd,
                      const gchar *key,
                      gint value);

Sets an integer to a NcmVarDict. If there is already an integer with key key , it is unreferenced.

Parameters

vd

a NcmVarDict

 

key

a string

 

value

an integer

 

ncm_var_dict_set_double ()

void
ncm_var_dict_set_double (NcmVarDict *vd,
                         const gchar *key,
                         gdouble value);

Sets a double to a NcmVarDict. If there is already a double with key key , it is unreferenced.

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a double

 

ncm_var_dict_set_boolean ()

void
ncm_var_dict_set_boolean (NcmVarDict *vd,
                          const gchar *key,
                          gboolean value);

Sets a boolean to a NcmVarDict. If there is already a boolean with key key , it is unreferenced.

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a boolean

 

ncm_var_dict_set_int_array ()

void
ncm_var_dict_set_int_array (NcmVarDict *vd,
                            const gchar *key,
                            GArray *value);

Sets an array of integers to a NcmVarDict. If there is already an array of integers with key key , it is unreferenced.

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a GArray of integers.

[array][element-type int]

ncm_var_dict_set_double_array ()

void
ncm_var_dict_set_double_array (NcmVarDict *vd,
                               const gchar *key,
                               GArray *value);

Sets an array of doubles to a NcmVarDict. If there is already an array of doubles with key key , it is unreferenced.

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a GArray of doubles.

[array][element-type double]

ncm_var_dict_set_boolean_array ()

void
ncm_var_dict_set_boolean_array (NcmVarDict *vd,
                                const gchar *key,
                                GArray *value);

Sets an array of booleans to a NcmVarDict. If there is already an array of booleans with key key , it is unreferenced.

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a GArray of booleans.

[array][element-type boolean]

ncm_var_dict_set_variant ()

void
ncm_var_dict_set_variant (NcmVarDict *vd,
                          const gchar *key,
                          GVariant *value);

Sets a GVariant to a NcmVarDict. If there is already a GVariant with key key , it is unreferenced.

Valid GVariant types are:

  • G_VARIANT_TYPE_STRING

  • G_VARIANT_TYPE_INT32

  • G_VARIANT_TYPE_DOUBLE

  • G_VARIANT_TYPE_BOOLEAN

  • G_VARIANT_TYPE_ARRAY (element-type int)

  • G_VARIANT_TYPE_ARRAY (element-type double)

  • G_VARIANT_TYPE_ARRAY (element-type boolean)

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a GVariant

 

ncm_var_dict_has_key ()

gboolean
ncm_var_dict_has_key (NcmVarDict *vd,
                      const gchar *key);

Checks if a NcmVarDict has a key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

Returns

whether the key key was found.


ncm_var_dict_get_string ()

gboolean
ncm_var_dict_get_string (NcmVarDict *vd,
                         const gchar *key,
                         gchar **value);

Gets a string from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a string.

[out][transfer full]

Returns

whether the string with key key was found.


ncm_var_dict_get_int ()

gboolean
ncm_var_dict_get_int (NcmVarDict *vd,
                      const gchar *key,
                      gint *value);

Gets an integer from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

an integer.

[out]

Returns

whether the integer with key key was found.


ncm_var_dict_get_double ()

gboolean
ncm_var_dict_get_double (NcmVarDict *vd,
                         const gchar *key,
                         gdouble *value);

Gets a double from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a double.

[out]

Returns

whether the double with key key was found.


ncm_var_dict_get_boolean ()

gboolean
ncm_var_dict_get_boolean (NcmVarDict *vd,
                          const gchar *key,
                          gboolean *value);

Gets a boolean from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a boolean.

[out]

Returns

whether the boolean with key key was found.


ncm_var_dict_get_int_array ()

gboolean
ncm_var_dict_get_int_array (NcmVarDict *vd,
                            const gchar *key,
                            GArray **value);

Gets an array of integers from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

an array of integers.

[out][transfer full][element-type int]

Returns

whether the array of integers with key key was found.


ncm_var_dict_get_double_array ()

gboolean
ncm_var_dict_get_double_array (NcmVarDict *vd,
                               const gchar *key,
                               GArray **value);

Gets an array of doubles from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

an array of doubles.

[out][transfer full][element-type double]

Returns

whether the array of doubles with key key was found.


ncm_var_dict_get_boolean_array ()

gboolean
ncm_var_dict_get_boolean_array (NcmVarDict *vd,
                                const gchar *key,
                                GArray **value);

Gets an array of booleans from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

an array of booleans.

[out][transfer full][element-type boolean]

Returns

whether the array of booleans with key key was found.


ncm_var_dict_get_variant ()

gboolean
ncm_var_dict_get_variant (NcmVarDict *vd,
                          const gchar *key,
                          GVariant **value);

Gets a GVariant from a NcmVarDict with key key .

Parameters

vd

a NcmVarDict

 

key

a string

 

value

a GVariant.

[out][transfer full]

Returns

whether the GVariant with key key was found.


ncm_var_dict_len ()

guint
ncm_var_dict_len (NcmVarDict *vd);

Gets the length of a NcmVarDict.

Parameters

vd

a NcmVarDict

 

Returns

dictionary length


ncm_var_dict_keys ()

GStrv
ncm_var_dict_keys (NcmVarDict *vd);

Gets the keys of a NcmVarDict.

Parameters

vd

a NcmVarDict

 

Returns

the keys of a NcmVarDict.

[transfer container]