[Enterprise Extensions only]

IDL name scoping

An IDL file forms a naming scope (referred to, in short, as a scope). Modules, interface statements, structures, unions, methods (operations), and exceptions form nested scopes. An identifier can only be defined one time in a particular scope. Identifiers can be redefined in nested scopes.

Names can be used in an unqualified form within a scope, and the name will be resolved by successively searching the enclosing scopes. When an unqualified name is defined in an enclosing scope, that name cannot be redefined.

Fully-qualified names have the following form:

 scope-name::identifier

For example, the method name mymethod defined within the interface Test of module M1 has the fully-qualified name:

M1::Test::mymethod 

A qualified name is resolved by first resolving the scope-name to a particular scope, S, and then locating the definition of the identifier within that scope. Scopes that enclose the scope S are not searched.

Qualified names can also have the following form:

 ::identifier

These names are resolved by locating the definition of identifier within the outermost name scope.

Every name defined in an IDL specification is given a global name, constructed as follows:

The names of types, constants, and exceptions defined by base interfaces are accessible in a derived interface. References to these names must be unambiguous. Ambiguities can be resolved by using a scoped name (prefacing the name with the name of the interface that defines it, and the two colons (::), as in base-interface::identifier). Scope names can also be used to refer to a constant, type, or an exception name defined by a base interface but redefined by a derived interface.