Calling SIDL methods from C

The names of the C functions used to call SIDL methods are a concatenation of the package name, the class or interface name and the method name(s) with the period characters changed to underscores . If the method is specified as being overloaded (i.e., has a name extension) , the full method name is the concatenation of the package name, the class or interface name, the method name, and the type extension. For non-static methods, the object or interface pointer is passed as the first parameter before any of the formal parameters. This parameter operates like an in parameter.

Examples of calls to SIDL overloaded methods are based on the overload_sample.sidl file shown in Section 5.6. Recall that the file describes three versions of the getValue method. The first takes no arguments, the second takes an integer argument, and the third takes a boolean. Each is called in the code snippet below:


  int b1, i1, iresult, nresult;

  Overload_Sample t  = Overload_Sample__create ();

  nresult = Overload_Sample_getValue(t);
  iresult = Overload_Sample_getValueInt(t, i1);
  bresult = Overload_Sample_getValueBool(t, b1);

Here are the C bindings for the critical addRef and deleteRef methods from sidl.BaseInterface. These methods are mentioned in particular because C clients must manage object reference counts themselves.


void
sidl_BaseInterface_addRef(
  sidl_BaseInterface self);

void
sidl_BaseInterface_deleteRef(
  sidl_BaseInterface self);

These same methods can be called from the sidl.BaseClass bindings. In fact, every C binding for an interface or class will have entries for addRef and deleteRef.


void
sidl_BaseClass_addRef(
  sidl_BaseClass self);

void
sidl_BaseClass_deleteRef(
  sidl_BaseClass self);



babel-0.10.2
users_guide Last Modified 2005-03-23

http://www.llnl.gov/CASC/components
components@llnl.gov