Next Previous Up Top Contents Index

A.4.9 Mapping for operation

A.4.9.6 context

If the operation is specified to take a context (using the IDLcontext clause), the generated operation takes an extra optional parameter corresponding to acontext object generated using the normal IDL context manipulation operations.

For example, in IDL:

module example {
  interface face {
    long sample_method (in long arg);
    void voidmethod();
    void voidmethod2(out short arg);
    string method3 (out short arg1,inout string arg2,in boolean arg3);
  };
}

In generated Lisp:

(defpackage :example)
(defclass example:face (corba:object)())
...

And in use:

; Suppose x is bound to a value of class example:face.
(sample_method x 3)
> 24

(voidmethod x) > ; No values returned

(voidmethod2 x) > 905 ; This is the value corresponding to the out arg

(method3 x "Argument corresponding to arg2" T) > "The values returned" -23 "New arg2 value"

; The Lisp construct multiple-value-bind can also be used ; to recover these values. (multiple-value-bind (result arg1 arg2) (method3 x "Argument corresponding to arg2" T) (list result arg1 arg2)) > ("The values returned" -23 "New arg2 value")


Developing Component Software with CORBA - 22 Jan 1999

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker