Ask Your Question
1

UNOIDL: [in] and [out] method parameter flag usage?

asked 2017-01-11 18:29:30 +0200

EasyTrieve gravatar image

updated 2017-01-15 22:45:43 +0200

What do [in] and [out] parameter flags mean?

I'm working with Basic (Star Office Basic and Libre Office Basic) and learning to use the MRI (My Reflection and Introspection) tool to view the Methods of a given target.

Where MRI lists Methods I'm seeing that those which require parameters have either an [in], [out], (or possibly even [inout]) prefixing a parameter's type. Here is an example display from MRI:

image description

Here's what I've learned so far:

  • The UNOIDL (the Unified Network Objects Interface Definition Language) mentions these as parameter flags, in the "Interface" syntax description:

<parameter> = "[" in | out | inout "]" <typename> <parametername> The parameter definition begins with the direction flag which is bound with [ ]. Valid flags for the direction are in ( in parameter), out (out parameter) or inout (in and out parameter). The direction follows an identifier for the parameter type and an identifier for the parameter name. More than one parameter definitions are separated by comma.

  • At the bottom of this page it talks about these flags:

There are also parameter flags. Each parameter definition begins with one of the direction flags in, out, or inout to specify the use of the parameter:

in specifies that the parameter will be used as an input parameter

only out specifies that the parameter will be used as an output parameter only inout specifies that the parameter will be used as an input and output parameter

These parameter flags do not appear in the API reference. The fact that a parameter is an [out] or [inout] parameter is explained in the method details.

Unfortunately when I refer to an example IDL reference manual page, it does not explain the [out] flag.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2017-02-11 08:47:59 +0200

EasyTrieve gravatar image

updated 2017-02-11 21:29:27 +0200

The whole point of UNOIDL was that it provides an interface to any language.

[in], [out], and [inout] defines the nature of each interface parameter.

(Note, interfaces are limited to only "method" calls, with any properties actually being simulated by using get and set method calls.)

Unlike C parameters which are generally inputs (unless they are pointers), or LO Basic parameters which are inputs (unless they are arrays), UNO parameters can be declared as bidirectional. A function can get and return multiple parameters, even the same parameters.

Parameters can be inputs, outputs, or both.

  • [in] parameters can only be read (they are read only).
  • [out] parameters can only be set (returned) but not read, and
  • [inout] parameters can be both read and set.

Also see this reference which is NOT the reference for UNOIDL, but does illustrate one example of a language interface using in/out/inout.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-01-11 18:29:30 +0200

Seen: 135 times

Last updated: Feb 11 '17