PreviousNext

Operation Declarations

The IDL operation_declaration can take the following forms:

[[operation_attribute, ...]] [static] type_specifier operation_identifier (parameter_declaration, ...);

[[operation_attribute, ...]] [static] type_specifier operation_identifier ([void]);

Use the first form for an operation that has one or more parameters; use the second form for an operation that has no parameters. Use the static keyword if the operation is a static member function of the interface class (C++ output only).

An operation_attribute can take the following forms:

· idempotent: The operation is idempotent.

· broadcast: The operation is always to be broadcast.

· maybe: The caller of the operation does not require and will not receive any response.

· reflect_deletions: If rpc_ss_free( ) is applied by application code on the server side to memory used for the referent of a full pointer that is part of an [in] parameter, the storage occupied by that referent on the client side is released.

· ptr: The operation returns a full pointer. This attribute must be supplied if the operation returns a pointer result and reference pointers are the default for the interface.

· context_handle: The operation returns a context handle.

· string: The operation returns a string.

The type_specifier in an operation declaration specifies the data type that the operation returns, if any. This type must be either a scalar type or a previously defined type. If the operation does not return a result, its type_specifier must be void.

For information on the semantics of pointers as operation return values, refer to the discussion of pointers in Pointers.

The operation_identifier in an operation declaration is an identifier that names the operation.

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

Parameter declarations and the parameter attributes are described separately in the following topics.

More:

Operation Attributes

Operation Attributes: Execution Semantics

Operation Attributes: Memory Management