![]() |
![]() |
![]() |
Holyrel Library Reference Manual | ![]() |
---|
RelationRelation — 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) 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_degree (HRelation *relation); #define h_relation_get_n_attrs (relation)
GObject +----HRelation +----HRelationBase +----HRelationSort +----HRelationRestrict +----HRelationProject
"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.
gchar *name ; |
name |
GType type ; |
type ID |
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 |
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 |
guint h_relation_get_degree (HRelation *relation);
Returns the degree of relation
.
relation : |
a HRelation |
Returns : | degree |
#define h_relation_get_n_attrs(relation) h_relation_get_degree (relation)
Returns the number of attributes in relation
. This is an
alternative name for h_relation_get_degree()
.
relation : |
a HRelation |
Returns : | number of attributes |
description
" property"description" gchararray : Read / Write
Description of relation.
Default value: NULL
<< Relations | Base Relation >> |