Previous | Table of Contents | Next |
Abstract interfaces differ from regular IDL interfaces in the following ways:
1. When used in an operation signature, they do not determine whether actual parameters are passed as an object reference
or by value. Instead, the type of the actual parameter (regular interface or value) is used to make this determination using
the following rules:
• The actual parameter is passed as an object reference if it is a regular interface type (or a subtype of a regular interface type), and that regular interface type is a subtype of the signature abstract interface type, and the object is already registered with the ORB/OA.
• The actual parameter is passed as a value if it cannot be passed as an object reference but can be passed as a value. Otherwise, a BAD_PARAM exception is raised.
2. Abstract interfaces do not implicitly inherit from CORBA::Object. This is because they can represent either value types or CORBA object references, and value types do not necessarily support the object reference operations (see Section 4.3, “Object Reference Operations,? on page 4-12). If an IDL abstract interface type can be successfully narrowed to an object reference type (a regular IDL interface), then the CORBA::Object operations can be invoked on the narrowed object reference.
3. Abstract interfaces implicitly inherit from CORBA::AbstractBase. This type is defined as native. It is the responsibility of each language mapping to specify the actual programming language type that is used for this type.
module CORBA {// IDLnative AbstractBase;};
4. Abstract interfaces do not imply copy semantics for value types passed as arguments to their operations. This is because their operations may be either CORBA invocations (for abstract interfaces that represent CORBA object references) or local programming language calls (for abstract interfaces that represent CORBA value types). See Section 5.2.2, “Operations,? on page 5-3 and Section 5.2.4, “Parameter Passing,? on page 5-4 for details of these differences.
5. Special inheritance rules that apply to abstract interfaces are described in Section 3.8.6, “Abstract Interface,? on page 3-26.
6. See Section 15.3.7, “Abstract Interfaces,? on page 15-30 for special consideration when transmitting an abstract interface using GIOP.
In other respects, abstract interfaces are identical to regular IDL interfaces.
For example, consider the following operation m1() in abstract interface foo.
abstract interface foo { void m1(in AnInterfaceType x, in AnAbstractInterfaceType y, in AValueType z); };
x’s are always passed by reference, z’s are:
• passed as copied values if foo refers to an ordinary interface.
• passed as non-copied values if foo refers to a value type
y’s are:
• passed as reference if their concrete type is an ordinary interface subtype of AnAbstractInterfaceType (registered with the ORB), no matter what foo’s concrete type is.
• passed as copied values if their concrete type is value and foo’s concrete type is ordinary interface.
• passed as non-copied values if their concrete type is value and foo’s concrete type is value.