MidgardObject parameters

MidgardObject parameters

Synopsis

#include <midgard/midgard.h>

const GValue *      midgard_object_get_parameter        (MidgardObject *self,
                                                         const gchar *domain,
                                                         const gchar *name);
gboolean            midgard_object_set_parameter        (MidgardObject *self,
                                                         const gchar *domain,
                                                         const gchar *name,
                                                         GValue *value);
MidgardObject **    midgard_object_list_parameters      (MidgardObject *self,
                                                         const gchar *domain);
MidgardObject **    midgard_object_find_parameters      (MidgardObject *self,
                                                         guint n_params,
                                                         const GParameter *parameters);
gboolean            midgard_object_has_parameters       (MidgardObject *self);
gboolean            midgard_object_delete_parameters    (MidgardObject *self,
                                                         guint n_params,
                                                         const GParameter *parameters);
gboolean            midgard_object_purge_parameters     (MidgardObject *self,
                                                         guint n_params,
                                                         const GParameter *parameters);

Description

Details

midgard_object_get_parameter ()

const GValue *      midgard_object_get_parameter        (MidgardObject *self,
                                                         const gchar *domain,
                                                         const gchar *name);


midgard_object_set_parameter ()

gboolean            midgard_object_set_parameter        (MidgardObject *self,
                                                         const gchar *domain,
                                                         const gchar *name,
                                                         GValue *value);

Creates object's parameter object if it doesn't exists, updates otherwise.

self :

MidgardObject instance

domain :

parameter's domain string

name :

parameter's name string

value :

a GValue value which should be set for domain&name pair

Returns :

TRUE on success, FALSE otherwise

midgard_object_list_parameters ()

MidgardObject **    midgard_object_list_parameters      (MidgardObject *self,
                                                         const gchar *domain);

Returned objects are midgard_parameter class. Parameter objects are fetched from database unconditionally if domain i sexplicitly set to NULL. That is, only those which parent guid property matches object's guid.

Returned array should be freed when no longer needed.

self :

a MidgardObject self instance

domain :

optional paramaters' domain

Returns :

Newly allocated and NULL terminated array of midgard_parameter objects. [transfer full]

midgard_object_find_parameters ()

MidgardObject **    midgard_object_find_parameters      (MidgardObject *self,
                                                         guint n_params,
                                                         const GParameter *parameters);

Find object's parameter(s) with matching given properties. parameters argument is optional. All object's parameters are returned ( if exist ) if parameters is explicitly set to NULL.

self :

MidgardObject instance

n_params :

number of properties

parameters :

properties list

Returns :

newly created, NULL terminated array of MidgardObject ( midgard_parameter class ) or NULL on failure. [transfer full]

midgard_object_has_parameters ()

gboolean            midgard_object_has_parameters       (MidgardObject *self);

self :

MidgardObject instance

Returns :

TRUE if object has paramateres, FALSE otherwise.

midgard_object_delete_parameters ()

gboolean            midgard_object_delete_parameters    (MidgardObject *self,
                                                         guint n_params,
                                                         const GParameter *parameters);

Delete object's parameter(s) which match given properties' values. Properties list in parameters is optional. All object's parameters are deleted ( if exist ) if parameters is explicitly set to NULL.

self :

MidgardObject instance

n_params :

number of properties

parameters :

properties list

Returns :

TRUE on success, FALSE if at least one of the parameters could not be deleted

midgard_object_purge_parameters ()

gboolean            midgard_object_purge_parameters     (MidgardObject *self,
                                                         guint n_params,
                                                         const GParameter *parameters);

Purge object's parameter(s) which match given properties' values. Properties list in parameters is optional. All object's parameters are purged ( if exist ) if parameters is explicitly set to NULL.

self :

MidgardObject instance

n_params :

number of properties

parameters :

properties list

Returns :

TRUE on success, FALSE if at least one of the parameters could not be purged