[Enterprise Extensions only]

CORBA C++ binding restrictions

When a forward reference to an interface appears within an IDL module, the IDL compiler issues an error message if the referenced interface is not defined within the module. When a similar unresolved forward reference appears at global (file) scope, a warning is issued that indicates the bindings being emitted will not include a mapping for the undefined interface. For information on the scope see IDL name scoping. The assumption is that the interface will be defined by other bindings than those being currently generated. This approach supports IDL files with mutually-referential interfaces (as long as they appear at global scope). The following example illustrates how to organize the IDL files for such cases:

// file foo.idl
#ifndef foo_idl
#define foo_idl
interface Foo; // declare Foo so bar.idl can refer to it
#include bar.idl
interface Foo 
{
   Bar foo1(); // notice the use of Bar
};
#endif // foo_idl
// file bar.idl
#ifndef bar_idl
#define bar_idl
interface Bar; // declare Bar so foo.idl can refer to it
#include foo.idl
interface Bar 
{
   Foo bar1(); // notice the use of Foo
};
#endif // bar_idl

Due to problems inherent to the CORBA 2.1 mapping for C++, there are currently two known limitations with respect to handling legal CORBA 2.1 IDL. The compiler provides informative error messages in these two cases, and indicates that C++ bindings cannot be generated. The cases are: