Orber and out-parameters in idl

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Orber and out-parameters in idl

Erik Reitsma (RY/ETM)-2
Hi all,

I was looking in the orber documentation for a description of how I should return values when they have been defined in idl as out-parameters. I have an idl-spec where all methods are void, and return the results in out-parameters. The documentation does mention how such a method could be called with an inout parameter, but there is no example of the server side, where the method is implemented.
Does anyone have experience or examples of using out-parameters?
If this is supported but not in the documentation, perhaps it should be added...
Any tips would be appreciated!
I have tried a naive approach, just returning what should be an out-parameter, but then my java client gets an exception...

*Erik.


Reply | Threaded
Open this post in threaded view
|

Orber and out-parameters in idl

Niclas Eklund-2

Hello!

If we have the following function (IDL):

module M {
  interface I {
     void foo(out long MyLong);
  };
};


To invoke the function on the client-side you write:

{ok, MyLong} = 'M_I':foo(ObjectRef),

The server should be implemented using:

-module('M_I_impl').
foo(State) ->
  MyLong = ....,
  {reply, {ok, MyLong}, State}.

The above assumes that no extra IC-options have been used (see
Module_Interface in the reference manual).

The above is also descibed in section 6.7 Invocations of Operations
(User's Guide).

Just remember that you must return the atom 'ok' for void functions.

/Nick


> I was looking in the orber documentation for a description of how I
> should return values when they have been defined in idl as
> out-parameters. I have an idl-spec where all methods are void, and
> return the results in out-parameters. The documentation does mention how
> such a method could be called with an inout parameter, but there is no
> example of the server side, where the method is implemented.
> Does anyone have experience or examples of using out-parameters?
> If this is supported but not in the documentation, perhaps it should be added...
> Any tips would be appreciated!
> I have tried a naive approach, just returning what should be an
> out-parameter, but then my java client gets an exception...