OSF DCE Application Development Guide--Core Components

Developing a Simple RPC Application
The type_specifier constructs for structures and unions permit the application of
attributes to members. In the following example, one member of a structure is a
conformant array (an array without a fixed upper bound), and the size_is attribute names
another member of the structure that at runtime provides information about the size of
the array:
typedef struct {
long dsize;
[size_is(dsize)] float darray[];
} dataset;
11.2.8 Operation Declarations
Operation declarations specify the signature of each operation in the interface, including
the operation name, the type of data returned, and the types of all parameters passed (if
any) in a call.
The general form of an operation declaration is
[operation_attribute, ...] type_specifier operation_identifier ([parameter_declaration, ...]);
where the bracketed list of operation attributes is optional. Among the possible
attributes of an operation are idempotent, broadcast, and maybe, which specify
semantics to be applied by the RPC runtime mechanism when the operation is called. If
an operation when called once can safely be executed more than once, the IDL
declaration of the operation may specify the idempotent attribute; idempotent
semantics allow remote procedure calls to execute more efficiently by letting the
underlying RPC mechanism retry the procedure if it deems it necessary.
The type_specifier specifies the type of data returned by the operation.
The operation_identifier names the operation. Although operation names are arbitrary, a
common convention is to use the name of an interface as a prefix for the names of its
operations. For example, a bank interface may have operations named bank_open,
bank_close, bank_deposit, bank_withdraw, and bank_balance.
Each parameter_declaration in an operation declaration declares a parameter of the
operation. A parameter_declaration takes the following form:
[parameter_attribute, ...] type_specifier parameter_declarator
Every parameter attribute must have at least one of the parameter attributes in or out to
specify whether the parameter is passed as an input, as an output, or in both directions.
The type_specifier and parameter_declarator specify the type and name of the
parameter.
Output parameters must be passed by reference and therefore must be declared as
pointers via the pointer operator * (an asterisk) or an array.
124245 Tandem Computers Incorporated 11 15