![]() | ![]() | ![]() | Libmergeant Reference Manual | ![]() |
---|
MgServerFunctionMgServerFunction — Represents a function in the DBMS. |
MgServerFunction; MgServerFunctionPrivate; guint mg_server_function_get_type (void); GObject* mg_server_function_new (MgServer *srv); void mg_server_function_set_dbms_id (MgServerFunction *func, const gchar *id); const gchar* mg_server_function_get_dbms_id (MgServerFunction *func); void mg_server_function_set_sqlname (MgServerFunction *func, const gchar *sqlname); const gchar* mg_server_function_get_sqlname (MgServerFunction *func); void mg_server_function_set_arg_types (MgServerFunction *func, const GSList *arg_types); const GSList* mg_server_function_get_arg_types (MgServerFunction *func); void mg_server_function_set_ret_type (MgServerFunction *func, MgServerDataType *dt); MgServerDataType* mg_server_function_get_ret_type (MgServerFunction *func); gboolean mg_server_function_accepts_args (MgServerFunction *func, const GSList *arg_types);
"templ-signal" void user_function (MgServerFunction *mgserverfunction, gpointer user_data);
The MgServerFunction 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 MgXmlStorage interface.
GObject* mg_server_function_new (MgServer *srv);
Creates a new MgServerFunction object
srv : | a MgServer object |
Returns : | the new object |
void mg_server_function_set_dbms_id (MgServerFunction *func, const gchar *id);
Set the DBMS identifier of the function
func : | a MgServerFunction object |
id : | the DBMS identifier |
const gchar* mg_server_function_get_dbms_id (MgServerFunction *func);
Get the DBMS identifier of the function
func : | a MgServerFunction object |
Returns : | the function's id |
void mg_server_function_set_sqlname (MgServerFunction *func, const gchar *sqlname);
Set the SQL name of the data type.
func : | a MgServerFunction object |
sqlname : |
const gchar* mg_server_function_get_sqlname (MgServerFunction *func);
Get the DBMS's name of a data type.
func : | a MgServerFunction object |
Returns : | the name of the data type |
void mg_server_function_set_arg_types (MgServerFunction *func, const GSList *arg_types);
Set the arguments types of a function
func : | a MgServerFunction object |
arg_types : | a list of MgServerDataType objects or NULL values ordered to represent the data types of the function's arguments . |
const GSList* mg_server_function_get_arg_types (MgServerFunction *func);
To consult the list of arguments types (and number) of a function.
func : | a MgServerFunction object |
Returns : | a list of MgServerDataType objects, the list MUST NOT be modified. |
void mg_server_function_set_ret_type (MgServerFunction *func, MgServerDataType *dt);
Set the return type of a function
func : | a MgServerFunction object |
dt : | a MgServerDataType object or NULL |
MgServerDataType* mg_server_function_get_ret_type (MgServerFunction *func);
To consult the return type of a function.
func : | a MgServerFunction object |
Returns : | a MgServerDataType object. |
gboolean mg_server_function_accepts_args (MgServerFunction *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 MgServerFunction object |
arg_types : | a list of MgServerDataType objects or NULL values, ordered |
Returns : | TRUE if accepted |
void user_function (MgServerFunction *mgserverfunction, gpointer user_data);
mgserverfunction : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
<< MgServerDataType | MgServerAggregate >> |