Previous Table of Contents Next


3.19 CORBA Module

   See the CORBA Components specification, Component Model chapter, “Factory operations? section for further details.

   Finder operations

   The syntax of a finder operation is as follows:

   <finder_dcl> ::= “finder? <identifier>

   “(“ [ <init_param_decls> ] “)?

   [ <raises_expr> ]

   A finder operation declaration consists of the following elements:

   A finder declaration has an implicit return value of type reference to component.

   See the CORBA Components specification, Component Model chapter, “Finder operations? section for further details.

   Names defined by the CORBA specification are in a module named CORBA. In an OMG IDL specification, however, OMG IDL keywords such as Object must not be preceded by a “CORBA::? prefix. Other interface names such as TypeCode are not OMG IDL keywords, so they must be referred to by their fully scoped names (e.g., CORBA::TypeCode) within an OMG IDL specification.

   For example in:

   #include <orb.idl>

   module M {

   typedef CORBA::Object myObjRef; // Error: keyword Object scoped

   typedef TypeCode myTypeCode; // Error: TypeCode undefined

   typedef CORBA::TypeCode TypeCode;// OK };

   The file orb.idl contains the IDL definitions for the CORBA module. Except for CORBA::TypeCode, the file orb.idl must be included in IDL files that use names defined in the CORBA module. IDL files that use CORBA::TypeCode may obtain its definition by including either the file orb.idl or the file TypeCode.idl.

   The exact contents of TypeCode.idl are implementation dependent. One possible implementation of TypeCode.idl may be:

   // PIDL #ifndef _TYPECODE_IDL_ #define _TYPECODE_IDL_ #pragma prefix "omg.org" module CORBA {

   interface TypeCode; }; #endif // _TYPECODE_IDL_

   For IDL compilers that implicitly define CORBA::TypeCode, TypeCode.idl could consist entirely of a comment as shown below:

   // PIDL // CORBA::TypeCode implicitly built into the IDL compiler // Hence there are no declarations in this file

   Because the compiler implicitly contains the required declaration, this file meets the requirement for compliance.

   The version of CORBA specified in this release of the specification is version <x.y>, and this is reflected in the IDL for the CORBA module by including the following pragma version (see Section 10.7.5.3, “The Version Pragma,? on page 10-71):

   #pragma version CORBA <x.y>

   as the first line immediately following the very first CORBA module introduction line, which in effect associates that version number with the CORBA entry in the IR. The version number in that version pragma line must be changed whenever any changes are made to any remotely accessible parts of the CORBA module in an officially released OMG standard.