midgard_reflection_property

midgard_reflection_property — MgdSchema reflection.

Synopsis


#include <midgard/midgard.h>

                    MidgardReflectionProperty;
MidgardReflectionProperty * midgard_reflection_property_new
                                                        (MidgardDBObjectClass *klass);
GType               midgard_reflection_property_get_midgard_type
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);
gboolean            midgard_reflection_property_is_link (MidgardReflectionProperty *self,
                                                         const gchar *propname);
gboolean            midgard_reflection_property_is_linked
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);
const MidgardDBObjectClass * midgard_reflection_property_get_link_class
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);
const gchar *       midgard_reflection_property_get_link_name
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);
const gchar *       midgard_reflection_property_get_link_target
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);
const gchar *       midgard_reflection_property_description
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);
const gchar *       midgard_reflection_property_get_user_value
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *property,
                                                         const gchar *name);

Description

MidgardReflectionProperty class lets developers write "reflected" applications and provides as many information defined in MgdSchema files as possible.

MidgardReflectionProperty provides information declared in schema files as attributes of types' properties: multilang, link, type, etc.

Details

MidgardReflectionProperty

typedef struct _MidgardReflectionProperty MidgardReflectionProperty;


midgard_reflection_property_new ()

MidgardReflectionProperty * midgard_reflection_property_new
                                                        (MidgardDBObjectClass *klass);

klass :

MidgardDBObjectClass pointer

Returns :

newly initialized MidgardReflectionProperty instance or NULL on failure.

midgard_reflection_property_get_midgard_type ()

GType               midgard_reflection_property_get_midgard_type
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);

self :

MidgardReflectionProperty instance

propname :

property name which is registered for MidgardDBObjectClass

Returns :

type (GType) of the property or NULL if property is not registered for given class.

midgard_reflection_property_is_link ()

gboolean            midgard_reflection_property_is_link (MidgardReflectionProperty *self,
                                                         const gchar *propname);

Checks whether property is a link.

self :

MidgardReflectionProperty instance

propname :

property name

Returns :

TRUE if property is registered as link, FALSE otherwise (or in case if property is not registered for given class.

midgard_reflection_property_is_linked ()

gboolean            midgard_reflection_property_is_linked
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);

Checks if property is linked with another type.

self :

MidgardReflectionProperty instance

propname :

property name

Returns :

TRUE if property is linked with another type (property of another class is defined as a link to given one). FALSE is returned if property is not linked or is not registered for given class.

midgard_reflection_property_get_link_class ()

const MidgardDBObjectClass * midgard_reflection_property_get_link_class
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);

self :

MidgardReflectionProperty instance

propname :

property name

Returns :

the pointer to the MidgardDBObjectClass, a given property is a link to. see midgard_reflection_property_get_link_name()

midgard_reflection_property_get_link_name ()

const gchar *       midgard_reflection_property_get_link_name
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);

self :

MidgardReflectionProperty instance

propname :

property name

Returns :

The name of the class, the given property is a link to. Or NULL if property is not a link or given property is not registered for given class.

midgard_reflection_property_get_link_target ()

const gchar *       midgard_reflection_property_get_link_target
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);

self :

MidgardReflectionProperty instance

propname :

property name

Returns :

The name of the property, the given one is a link to. Or NULL if property is not a link or it's not registered for given class.

midgard_reflection_property_description ()

const gchar *       midgard_reflection_property_description
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *propname);

self :

MidgardReflectionProperty instance

propname :

property name

Returns :

description of the given property or NULL.

midgard_reflection_property_get_user_value ()

const gchar *       midgard_reflection_property_get_user_value
                                                        (MidgardReflectionProperty *self,
                                                         const gchar *property,
                                                         const gchar *name);

self :

MidgardReflectionProperty instance

property :

property to look value for

name :

name of user defined field

Returns :

value for user defined field, or NULL if none found

Since 9.09