Re: IDL->C mapping question
- From: Frank Rehberger <Frank Rehberger web de>
- To: Olivier Andrieu <oliv__a users sourceforge net>
- Cc: Michael Meeks <michael ximian com>, orbit <orbit-list gnome org>
- Subject: Re: IDL->C mapping question
- Date: Fri, 30 May 2003 16:45:55 +0200
Olivier Andrieu wrote:
> Frank Rehberger [Thursday 29 May 2003] :
> >
> > Olivier Andrieu wrote:
> >
> > >Hi,
> > >
> > >I'm writing ORBit2 bindings for the programming language Objective
> > >Caml and while testing things a bit, I noticed that the
> > >CORBA::ORB::get_service_information operation returns a NULL pointer
> > >for an out value of type struct.
> > >
> > >The IDL definition is :
> > >
> > > boolean get_service_information (
> > > in ServiceType service_type,
> > > out ServiceInformation service_information);
> > >
> > Just a thought, might it be the case that the operation throws an
> > exception? In this case the out value would be undefined.
>
>no, it does not throw an exception, it returns false and a NULL
>out_value. I guess it's kind of a bug in the interface, it would be
>better with a union as out value :
>
> union service switch (boolean) {
> case TRUE:
> ServiceInformation service_information;
> };
>
>
as this operation belongs to ORB interface specified by OMG we can not
change the signature or type declaration.
But, it seems you are right:
In case operation "ORB::get_service_information()" returns with
CORBA_false, the reference to out value 'service_information' should
point to some valid value, which must be CORBA_free'd by caller. In this
case the pseudo operation 'get_service_information()' would be
consistent to remote operation calls.
The question is, which value should it point to?
The OMG-CORBA-2.3 Spec. does not tell much about it:
-----------------------------------------------------------------
4.2.2 Getting Service Information
4.2.2.1 get_service_information
boolean get_service_information (
in ServiceType service_type;
out ServiceInformation service_information;
);
The get_service_information operation is used to obtain information
about CORBA
facilities and services that are supported by this ORB. The service type
for which
information is being requested is passed in as the in parameter
service_type, the
values defined by constants in the CORBA module. If service information
is available
for that type, that is returned in the out parameter
service_information, and the
operation returns the value TRUE. If no information for the requested
services type is
available, the operation returns FALSE (i.e., the service is not
supported by this ORB).
--------------------------------------------------------------
Best regards, Frank
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]