Previous Table of Contents Next


10.7.7 RepositoryIDs for OMG-Specified Types


   Interoperability between implementations of official OMG specifications, including but not limited to CORBA, CORBA Services, and CORBA Facilities, depends on unambiguous specification of RepositoryIds for all IDL-defined types in such specifications.

   All official OMG IDL files shall contain the following pragma prefix directive:

   #pragma prefix “omg.org?

   unless said file already contains a pragma prefix identifying the original source of the file (e.g., “w3c.org?).

   Revisions to existing OMG specifications must not change the definition of an existing type in any way. Two types with different repository Ids are considered different types, regardless of which part of the repository Id differs.

   If an implementation must extend an OMG-specified interface, interoperability requires it to derive a new interface from the standard interface, rather than modify the standard definition.

   10.7.8 Uniqueness Constraints on Repository IDs

   Within an IDL definition, a module must have the same repository ID throughout. For example:

   #pragma prefix "A"module M {// ...};

   #pragma prefix "B"module M { // Error, inconsistent repository ID // ...};

   This definition attempts to use the same type name M with two different repository IDs in the same compilation unit. Compilers shall issue a diagnostic for this error.

   The same error can arise through inclusion of source files in the same compilation unit. For example:

   // File1.idlmodule M {module N { // ...

   };#pragma ID N "abc"};

   // File2.idlmodule M {module N {// ...};};

   // File3.idl#include "File1.idl#include "File2.idl // Error, inconsistent repository ID

   Similarly:

   // File1.idl module M { // ... };

   // File2.idl#include File1.idl#pragma prefix "X"module M { // Error, inconsistent repository ID

    // ...};

   Such errors are detectable only if they occur in a single compilation unit (or in files included in a single compilation unit); if, in different compilation units, different repository IDs are used for the same module, and these compilation units are combined into a single executable, the behavior is undefined.