| Holyrel Library Reference Manual |
|---|
RelationRelation — Base class of all relations. |
#include <libhrel/relation.h>
HRelation;
HAttribute;
void (*HAttrFunc) (HAttribute *attr,
gpointer user_data);
void (*HTupleFunc) (HTuple *tuple,
gpointer user_data);
#define h_relation_ref (relation)
#define h_relation_unref (relation)
GType h_relation_get_type (void);
void h_relation_set_name (HRelation *relation,
const gchar *name);
void h_relation_set_desc (HRelation *relation,
const gchar *desc);
gchar* h_relation_get_name (HRelation *relation);
gchar* h_relation_get_desc (HRelation *relation);
void h_relation_print (HRelation *relation);
void h_relation_for_each_attr (HRelation *relation,
HAttrFunc func,
gpointer user_data);
void h_relation_for_each_tuple (HRelation *relation,
HTupleFunc func,
gpointer user_data);
guint h_relation_get_size (HRelation *relation);
guint h_relation_get_n_attrs (HRelation *relation);
GObject +----HRelation +----HRelationBase +----HRelationSort +----HRelationRestrict
"delete-tuple" void user_function (HRelation *hrelation, HTuple *arg1, gpointer user_data); "insert-tuple" void user_function (HRelation *hrelation, HTuple *arg1, gpointer user_data);
typedef struct {
gchar *name;
GType type;
} HAttribute;
Holds the complete description of an attribute.
void (*HAttrFunc) (HAttribute *attr, gpointer user_data);
HAttribute function.
attr : |
an HAttribute |
user_data : |
user data |
void (*HTupleFunc) (HTuple *tuple, gpointer user_data);
HTuple function.
tuple : |
a HTuple |
user_data : |
user data |
#define h_relation_ref(relation) g_object_ref (relation)
Increases the reference count of relation.
relation : |
a HRelation |
#define h_relation_unref(relation) g_object_unref (relation)
Decreases the reference count of relation. relation will be
destroyed when its reference count goes to 0.
relation : |
a HRelation |
GType h_relation_get_type (void);
Returns the Glib type ID of HRelation.
| Returns : | type ID |
void h_relation_set_name (HRelation *relation, const gchar *name);
Set the name of relation.
relation : |
a HRelation |
name : |
name |
void h_relation_set_desc (HRelation *relation, const gchar *desc);
Set the description of relation.
relation : |
a HRelation |
desc : |
description |
gchar* h_relation_get_name (HRelation *relation);
Returns the name of relation.
relation : |
a HRelation |
| Returns : | a copy of the name string, or NULL if no name is
set.
|
gchar* h_relation_get_desc (HRelation *relation);
Returns the description of relation.
relation : |
a HRelation |
| Returns : | a copy of the description string, or NULL if no
description exists
|
void h_relation_print (HRelation *relation);
Prints relation to stdout.
relation : |
a HRelation |
void h_relation_for_each_attr (HRelation *relation, HAttrFunc func, gpointer user_data);
Performs a function over each attribute in relation.
relation : |
a HRelation |
func : |
function called for each attribute in relation
|
user_data : |
custom data to pass to func
|
void h_relation_for_each_tuple (HRelation *relation, HTupleFunc func, gpointer user_data);
Performs a function over each tuple in relation.
relation : |
a HRelation |
func : |
function called for each tuple in relation
|
user_data : |
custom data to pass to func
|
guint h_relation_get_size (HRelation *relation);
Returns the number of tuples in relation.
relation : |
a HRelation |
| Returns : | number of tuples |
description" property"description" gchararray : Read / Write
Description of relation.
Default value: NULL
| << Relations | Restricted Relation >> |