Restrict

Restrict — Restrict.

Synopsis


#include <libhrel/relation.h>


            HRelationRestrict;
gboolean    (*HTuplePredFunc)               (HTuple *tuple,
                                             gpointer user_data);
HRelation*  h_relation_restrict             (HRelation *relation,
                                             HTuplePredFunc predicate_func,
                                             gpointer user_data);
HRelation*  h_relation_restrict_attrs       (HRelation *relation,
                                             ...);

Object Hierarchy


  GObject
   +----HRelation
         +----HRelationRestrict

Description

Details

HRelationRestrict

typedef struct _HRelationRestrict HRelationRestrict;

A HRelation representing a restricted relation.


HTuplePredFunc ()

gboolean    (*HTuplePredFunc)               (HTuple *tuple,
                                             gpointer user_data);

A HTuple predicate function.

tuple : a HTuple
user_data : user data
Returns : either TRUE or FALSE

h_relation_restrict ()

HRelation*  h_relation_restrict             (HRelation *relation,
                                             HTuplePredFunc predicate_func,
                                             gpointer user_data);

Restricts relation to the set of tuples evaluating to TRUE with predicate_func.

relation : a HRelation to perform restrict on
predicate_func : tuple predicate function
user_data : Custom data to pass to predicate_func
Returns : restricted HRelation

h_relation_restrict_attrs ()

HRelation*  h_relation_restrict_attrs       (HRelation *relation,
                                             ...);

Restricts relation to the set of tuples which contain the attribute values listed.

relation : relation to restrict
... : name and value of an attribute, followed by another and so on, then a NULL.
Returns : restricted relation