Method signatures

All SIDL methods are implemented as FORTRAN 77 subroutines regardless of whether they have return values. The name of a subroutine used to call a SIDL method is a concatenation of the package, class (or interface), and method name, where each part is separated by an underscore. If the method is specified as overloaded (i.e., has a name extension), the extension is appended to the name part. An additional string is appended to further distinguish between client-side methods (to be invoked) and the implementation-side, where the former end in ``_f'' while the latter end in ``_fi''.

As for arguments, the object (or interface) pointer is automatically inserted as the first parameter in the signature of non-static methods. This parameter operates like an in parameter. When a method has a return value, a variable to hold the return value should be passed as an argument following the formally declared arguments. This extra argument behaves like an out parameter. With the addition of remote method invocation (RMI) support, all methods now implicitly throw exceptions. Hence, an extra out parameter for the exception is automatically added at the end of the signature.

The following SIDL method -- taken from regression tests -- is an example of a method that can throw multiple exception types$:$


int getFib(in int n, in int max_depth, in int max_value, in int depth)
    throws NegativeValueException, FibException;

The corresponding FORTRAN 77 API is$:$


        subroutine ExceptionTest_Fib_getFib_f(self, n, max_depth,
     &     max_value, depth, retval, exception)
        implicit none
C        in ExceptionTest.Fib self
        integer*8 self
C        in int n
        integer*4 n
C        in int max_depth
        integer*4 max_depth
C        in int max_value
        integer*4 max_value
C        in int depth
        integer*4 depth
C        out int retval
        integer*4 retval
C        out sidl.BaseInterface exception
        integer*8 exception
        end

Note the addition of the object (i.e., self), return (i.e., retval), and exception (i.e., exception) parameters.



babel-1.4.0
users_guide Last Modified 2008-10-16

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