Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CORBA IDL in, out and inout

Tags:

corba

idl

What exactly do in, out and inout - 'directional' operators mean in CORBA IDL function parameters?

like image 547
mihsathe Avatar asked Jun 07 '11 11:06

mihsathe


1 Answers

From Ciaran McHale's free online book, CORBA Explained Simply:

The parameters of an operation have a specified direction, which can be in (meaning that the parameter is passed from the client to the server), out (the parameter is passed from the server back to the client) or inout (the parameter is passed in both directions).

So an in parameter is very similar to "traditional" function parameters in that the caller must pass a value for them and that value is used by the server to do its work.

An out parameter is just like a return value, so the caller never populates it with a value. It just magically has a value when the function returns (assuming an exception wasn't thrown) because the server is responsible for putting a value inside it as part of its execution rules. You can have as many out parameters as you want, allowing you to return multiple distinct objects or values without having to first combine them into a struct.

An inout parameter combines the two concepts above. The caller must populate all inout parameters with valid data but those values may be different after the function returns because the server is free to put new data in there.

like image 189
Brian Kelly Avatar answered Sep 28 '22 00:09

Brian Kelly