Previous Table of Contents Next


3.11.5 Native Types


   OMG IDL provides a declaration for use by object adapters to define an opaque type whose representation is specified by the language mapping for that object adapter.

   The syntax is:

   This declaration defines a new type with the specified name. A native type is similar to an IDL basic type. The possible values of a native type are language-mapping dependent, as are the means for constructing them and manipulating them. Any interface that defines a native type requires each language mapping to define how the native type is mapped into that programming language.

   A native type may be used only to define operation parameters, results and exceptions. If a native type is used for an exception, it must be mapped to a type in a programming language that can be used as an exception. Native type parameters are permitted only in operations of local interfaces or valuetypes. Any attempt to transmit a value of a native type in a remote invocation may raise the MARSHAL standard system exception.

   It is recommended that native types be mapped to equivalent type names in each programming language, subject to the normal mapping rules for type names in that language. For example, in a hypothetical Object Adapter IDL module

   module HypotheticalObjectAdapter {native Servant;interface HOA {

   Object activate_object(in Servant x); }; };

   The IDL type Servant would map to HypotheticalObjectAdapter::Servant in C++ and the activate_object operation would map to the following C++ member function signature:

   CORBA::Object_ptr activate_object(HypotheticalObjectAdapter::Servant x);

   The definition of the C++ type HypotheticalObjectAdapter::Servant would be provided as part of the C++ mapping for the HypotheticalObjectAdapter module.

   Note – The native type declaration is provided specifically for use in object adapter interfaces, which require parameters whose values are concrete representations of object implementation instances. It is strongly recommended that it not be used in service or application interfaces. The native type declaration allows object adapters to define new primitive types without requiring changes to the OMG IDL language or to OMG IDL compiler.