Previous | Table of Contents | Next |
CORBA defines a number of different kinds of pseudo-objects. Pseudo-objects differ from other objects in that they cannot
be invoked with the Dynamic Invocation Interface (DII) and do not have object references. Most pseudo-objects cannot be used
as general arguments. Currently, only the TypeCode and Principal pseudo-objects can be used as general arguments to a request
in CORBA.
The CORBA NamedValue and NVList are not mapped into COM as arguments to COM operation signatures.
18.2.12.1 Mapping for TypeCode pseudo-object
CORBA TypeCodes represent the types of arguments or attributes and are typically retrieved from the interface repository.
The mapping of the CORBA TypeCode interface follows the same rules as mapping any other CORBA interface to COM. The result
of this mapping is as follows.
// Microsoft IDL or ODLtypedef struct { } TypeCodeBounds;typedef struct { } TypeCodeBadKind;
[uuid(9556EA20-3889-11cf-9586-AA0004004A09), object,pointer_default(unique)]
interface ICORBA_TypeCodeUserExceptions : IUnknown
{HRESULT _get_Bounds( [out] TypeCodeBounds *pExceptionBody);HRESULT _get_BadKind( [out] TypeCodeBadKind * pExceptionBody );
};
typedef struct
{ ExceptionType type; LPTSTR repositoryId; long minorCode; CompletionStatus completionStatus; ICORBA_SystemException * pSystemException; ICORBA_TypeCodeExceptions * pUserException;
} CORBATypeCodeExceptions;
typedef LPTSTR RepositoryId;typedef LPTSTR Identifier;
typedef [v1_enum]
enum tagTCKind { tk_null = 0, tk_void, tk_short,tk_long, tk_ushort, tk_ulong,tk_float, tk_double, tk_octet,tk_any, tk_TypeCode,tk_principal, tk_objref,tk_struct, tk_union, tk_enum,tk_string, tk_sequence,tk_array, tk_alias, tk_except
} CORBA_TCKind;
[uuid(9556EA21-3889-11cf-9586-AA0004004A09), object,pointer_default(unique)]
interface ICORBA_TypeCode : IUnknown{
HRESULT equal( [in] ICORBA_TypeCode * piTc,[out] boolean * pbRetVal,[out] CORBA_TypeCodeExceptions** ppUserExceptions);
HRESULT kind( [out] TCKind * pRetVal,[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT id( [out] RepositoryId * pszRetVal,[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT name( [out] Identifier * pszRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT member_count(
[out] unsigned long * pulRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT member_name(
[in] unsigned long ulIndex,
[out] Identifier * pszRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions );
HRESULT member_type(
[in] unsigned long ulIndex,
[out] ICORBA_TypeCode ** ppRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions );
HRESULT member_label(
[in] unsigned long ulIndex,
[out] ICORBA_Any ** ppRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions );
HRESULT discriminator_type(
[out] ICORBA_TypeCode ** ppRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions );
HRESULT default_index(
[out] long * plRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT length(
[out] unsigned long * pulRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT content_type(
[out] ICORBA_TypeCode ** ppRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT param_count(
[out] long * plRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions);
HRESULT parameter(
[in] long lIndex,
[out] ICORBA_Any ** ppRetVal,
[out] CORBA_TypeCodeExceptions ** ppUserExceptions
);}
Note – Use of the methods param_count() and parameter() is deprecated.
18.2.12.2 Mapping for context pseudo-object
This specification provides no mapping for CORBA’s Context pseudo-object into COM. Implementations that choose to provide
support for Context could do so in the following way. Context pseudo-objects should be accessed through the ICORBA Context
interface. This would allow clients (if they are aware that the object they are dealing with is a CORBA object) to set a single
Context pseudo-object to be used for all subsequent invocations on the CORBA object from the client process space until such
time as the ICORBA_Context interface is released.
// Microsoft IDL and ODLtypedef struct
{ unsigned long cbMaxSize; unsigned long cbLengthUsed; [size_is(cbMaxSize), length_is(cbLengthUsed), unique]
LPTSTR * pszValue; } ContextPropertyValue;
[ object, uuid(74105F51-3C68-11cf-9588-AA0004004A09), pointer_default(unique) ]interface ICORBA_Context: IUnknown
{HRESULT GetProperty( [in]LPTSTR Name,[out] ContextPropertyValue ** pValues );HRESULT SetProperty( [in] LPTSTR,[in] ContextPropertyValue
* pValues); };
If a COM client application knows it is using a CORBA object, the client application can use QueryInterface to obtain an interface
pointer to the ICORBA_Context interface. Obtaining the interface pointer results in a CORBA context pseudo-object being created
in the View, which is used with any CORBA request operation that requires a reference to a CORBA context object. The context
pseudo-object should be destroyed when the reference count on the ICORBA_Context interface reaches zero.
This interface should only be generated for CORBA interfaces that have operations defined with the context clause.
18.2.12.3 Mapping for principal pseudo-object
The CORBA Principal is not currently mapped into COM. As both the COM and CORBA security mechanisms solidify, security interworking
will need to be defined between the two object models.