Parameter Passing

Each parameter in a method call obeys the following syntax

[ (modifier) ] (mode) (type) (name)
Where (mode) is one of in, out, or inout; (type) is any SIDL recognized type; and (name) is any non-reserved word4.2. The (modifier) is optional, and currently unimplemented. SIDL currently reserves the word copy for future use as an parameter modifier, and may add others in the future4.3.

For new users, the parameter's mode (e.g. in, out, or inout) is perhaps the most troublesome. On the surface, it's easy to explain that in parameters are passed into the code, out parameters come out, and inout parameters do both. However, there are some deeper issues that users need to be aware of.

  1. in does not mean const.
  2. inout may destroy the input instance and replace it with a completely new one.
  3. Types created on the stack should never be passed as an inout argument, since the implementation may want to destroy it.



babel-0.9.0
users_guide Last Modified 2004-01-29

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