Previous | Table of Contents | Next |
Operation declarations in OMG IDL are similar to C function declarations. The syntax is:
(87) <op_dcl> ::= [ <op_attribute> ] <op_type_spec> <identifier> <parameter_dcls> [ <raises_expr> ] [ <context_expr> ]
(88) <op_attribute> ::= “oneway?
(89) <op_type_spec> ::= <param_type_spec> | “void?
An operation declaration consists of:
• An optional operation attribute that specifies which invocation semantics the communication system should provide when the operation is invoked. Operation attributes are described in Section 3.13.1, “Operation Attribute,? on page 3-51.
• The type of the operation’s return result; the type may be any type that can be defined in OMG IDL. Operations that do not return a result must specify the void type.
• An identifier that names the operation in the scope of the interface in which it is defined.
• A parameter list that specifies zero or more parameter declarations for the operation. Parameter declaration is described in Section 3.13.2, “Parameter Declarations,? on page 3-51.
• An optional raises expression that indicates which exceptions may be raised as a result of an invocation of this operation. Raises expressions are described in Section 3.13.3, “Raises Expressions,? on page 3-52.
• An optional context expression that indicates which elements of the request context may be consulted by the method that implements the operation. Context expressions are described in Section 3.13.4, “Context Expressions,? on page 3-53.
Some implementations and/or language mappings may require operation-specific pragmas to immediately precede the affected operation
declaration.