GdaDictFunction

GdaDictFunction — Represents a function in the DBMS.

Synopsis

                    GdaDictFunction;
GObject*            gda_dict_function_new               (GdaDict *dict);
void                gda_dict_function_set_dbms_id       (GdaDictFunction *func,
                                                         const gchar *id);
gchar*              gda_dict_function_get_dbms_id       (GdaDictFunction *func);
void                gda_dict_function_set_sqlname       (GdaDictFunction *func,
                                                         const gchar *sqlname);
const gchar*        gda_dict_function_get_sqlname       (GdaDictFunction *func);
void                gda_dict_function_set_arg_dict_types
                                                        (GdaDictFunction *func,
                                                         const GSList *arg_types);
const GSList*       gda_dict_function_get_arg_dict_types
                                                        (GdaDictFunction *func);
void                gda_dict_function_set_ret_dict_type (GdaDictFunction *func,
                                                         GdaDictType *dt);
GdaDictType*        gda_dict_function_get_ret_dict_type (GdaDictFunction *func);
gboolean            gda_dict_function_accepts_arg_dict_types
                                                        (GdaDictFunction *func,
                                                         const GSList *arg_types);

Object Hierarchy

  GObject
   +----GdaObject
         +----GdaDictFunction

Implemented Interfaces

GdaDictFunction implements GdaXmlStorage.

Description

The GdaDictFunction represents a function, it has zero or more input parameters, and one and only one return type. In this way it does not represent procedures which does not return any data type. Also the argument types are always of the IN kind (no OUT or IN OUT kinds); there may one day be a specific object for procedures. It does not either represent a function returning a SET OF a given data type; there may on day be a specific object for such functions.

Because functions can be polymorphic, the name is not enough to identify them, so the DBMS provides a unique id which can be used to uniquely identify a function.

It implements the GdaXmlStorage interface.

Details

GdaDictFunction

typedef struct _GdaDictFunction GdaDictFunction;


gda_dict_function_new ()

GObject*            gda_dict_function_new               (GdaDict *dict);

Creates a new GdaDictFunction object which rrpresents a function in the dictionary

dict :

a GdaDict object

Returns :

the new object

gda_dict_function_set_dbms_id ()

void                gda_dict_function_set_dbms_id       (GdaDictFunction *func,
                                                         const gchar *id);

Set the DBMS identifier of the function

func :

a GdaDictFunction object

id :

the DBMS identifier

gda_dict_function_get_dbms_id ()

gchar*              gda_dict_function_get_dbms_id       (GdaDictFunction *func);

Get the DBMS identifier of the function

func :

a GdaDictFunction object

Returns :

a new string with the function's id

gda_dict_function_set_sqlname ()

void                gda_dict_function_set_sqlname       (GdaDictFunction *func,
                                                         const gchar *sqlname);

Set the SQL name of the data type.

func :

a GdaDictFunction object

sqlname :


gda_dict_function_get_sqlname ()

const gchar*        gda_dict_function_get_sqlname       (GdaDictFunction *func);

Get the DBMS's name of a data type.

func :

a GdaDictFunction object

Returns :

the name of the data type

gda_dict_function_set_arg_dict_types ()

void                gda_dict_function_set_arg_dict_types
                                                        (GdaDictFunction *func,
                                                         const GSList *arg_types);

Set the arguments types of a function

func :

a GdaDictFunction object

arg_types :

a list of GdaDictType objects or NULL values ordered to represent the data types of the function's arguments .

gda_dict_function_get_arg_dict_types ()

const GSList*       gda_dict_function_get_arg_dict_types
                                                        (GdaDictFunction *func);

To consult the list of arguments types (and number) of a function.

func :

a GdaDictFunction object

Returns :

a list of GdaDictType objects, the list MUST NOT be modified.

gda_dict_function_set_ret_dict_type ()

void                gda_dict_function_set_ret_dict_type (GdaDictFunction *func,
                                                         GdaDictType *dt);

Set the return type of a function

func :

a GdaDictFunction object

dt :

a GdaDictType object or NULL

gda_dict_function_get_ret_dict_type ()

GdaDictType*        gda_dict_function_get_ret_dict_type (GdaDictFunction *func);

To consult the return type of a function.

func :

a GdaDictFunction object

Returns :

a GdaDictType object.

gda_dict_function_accepts_arg_dict_types ()

gboolean            gda_dict_function_accepts_arg_dict_types
                                                        (GdaDictFunction *func,
                                                         const GSList *arg_types);

Test if the proposed list of arguments (arg_types) would be accepted by the func function.

The non acceptance can be beause of data type incompatibilities or a wrong number of data types.

func :

a GdaDictFunction object

arg_types :

a list of GdaDictType objects or NULL values, ordered

Returns :

TRUE if accepted