obj_method
[object]

Collaboration diagram for obj_method:

Detailed Description

Module for manage Object methods handling

TO COMPLETE

Obj_Method Meta Information

Contact:
Daniele Rondina aka Ge@@ru <geaaru@gmail.com>
Status:
EasyDbus Core Library
License:
GPL
Contributor(s):


Data Structures

struct  EasyDbus_obj_method
 EasyDbus_obj_method object User for manage object method callback and informations for introspectable interface. More...

Functions

EasyDbus_obj_methodeasydbus_obj_method_create (char *method)
 Create EasyDbus_obj_method object.
void easydbus_obj_method_free (EasyDbus_obj_method *method)
 Free EasyDbus_obj_method object.
int easydbus_obj_method_set_callback (EasyDbus_obj_method *method, easydbus_obj_method_callback_f method_callback)
 Set obj_method callback.


Function Documentation

EasyDbus_obj_method* easydbus_obj_method_create ( char *  method  ) 

Create EasyDbus_obj_method object.

Parameters:
method name of method
Returns:
NULL on error

pointer to a new EasyDbus_obj_method.

Definition at line 58 of file register_method.c.

References EASYDBUS_MEMCOPY, EasyDbusDebug, EasyDbus_obj_method::input_info, EasyDbus_obj_method::name, EasyDbus_obj_method::next, and EasyDbus_obj_method::output_info.

00059 {
00060    int string_length;
00061    struct EasyDbus_obj_method *method_skeleton = NULL;
00062 
00063    if (!method)
00064       return NULL;
00065 
00066    method_skeleton = (struct EasyDbus_obj_method *)
00067       malloc (sizeof (struct EasyDbus_obj_method));
00068 
00069    if (!method_skeleton)
00070       return NULL;
00071 
00072    method_skeleton->input_info = method_skeleton->output_info = NULL;
00073    method_skeleton->next = NULL;
00074 
00075    string_length = strlen (method) + 1;
00076    method_skeleton->name = (char *) malloc (string_length);
00077 
00078    if (!method_skeleton->name)
00079       goto out_of_memory;
00080 
00081    EASYDBUS_MEMCOPY (method_skeleton->name, method,
00082                      string_length);
00083 
00084    EasyDbusDebug ("Create method_core %s", method_skeleton->name);
00085 
00086    return method_skeleton;
00087 
00088  out_of_memory:
00089    free (method_skeleton);
00090    return NULL;
00091 }

void easydbus_obj_method_free ( EasyDbus_obj_method method  ) 

Free EasyDbus_obj_method object.

Precondition:
method != NULL
Parameters:
method EasyDbus_obj_method object pointer.

Definition at line 99 of file register_method.c.

References easydbus_free_introspect_info_arg(), EasyDbusDebug, EasyDbus_obj_method::input_info, EasyDbus_obj_method::name, easydbus_introspect_arg_info::next, and EasyDbus_obj_method::output_info.

Referenced by easydbus_obj_interface_free_skeleton().

00100 {
00101    struct easydbus_introspect_arg_info *el = NULL;
00102 
00103    if (!method)
00104       return;
00105 
00106    el = method->output_info;
00107    while (el) {
00108       method->output_info = el->next;
00109       easydbus_free_introspect_info_arg (el);
00110       el = method->output_info;
00111       EasyDbusDebug ("Free of output arg element");
00112    }
00113 
00114    el = method->input_info;
00115    while (el) {
00116       method->input_info = el->next;
00117       easydbus_free_introspect_info_arg (el);
00118       el = method->input_info;
00119       EasyDbusDebug ("Free of input arg element");
00120    }
00121 
00122    free (method->name);
00123 
00124    free (method);
00125 }

Here is the call graph for this function:

int easydbus_obj_method_set_callback ( EasyDbus_obj_method method,
easydbus_obj_method_callback_f  method_callback 
)

Set obj_method callback.

Returns:
-1 on error

0 ok

Note:
See if set method_callback directly on struct instead of call this function.
Parameters:
method EasyDbus_obj_method object pointer.
method_callback method callback

Definition at line 138 of file register_method.c.

References EasyDbus_obj_method::method_callback.

00140 {
00141    if (!method || !method_callback)
00142       return -1;
00143 
00144    method->method_callback = method_callback;
00145 
00146    return 0;
00147 }


Generated on Thu Apr 10 10:03:22 2008 for EasyDbus-0.2 by  doxygen 1.5.4