[omniORB] More on any's...

vonWedel@lfpt.rwth-aachen.de vonWedel@lfpt.rwth-aachen.de
Mon, 22 Jan 2001 15:46:21 +0100


Dies ist eine mehrteilige Nachricht im MIME-Format.
--=_alternative 00525F0FC12569DC_=
Content-Type: text/plain; charset="us-ascii"

Hi,

I'm experiencing another problem using the any type.

The patch from last week (bug #7) worked fine, now it seems
that there is a problem in coercing an any into a certain type
using the proprietary omniORB way, giving a type code
as an argument to the value function of the any. However,
it returns None when I call it the first time and returns an
object reference (in this case) only when calling it a second
time...

        # obtain an any called 'item' from somewhere

        mc = item.value(CORBA.TypeCode(CORBA.id(X.Y)))
        mc = item.value(CORBA.TypeCode(CORBA.id(X.Y)))
        if mc is not None:
                pass
        else:
                print 'Hello!'

Is it possible that there is some initialization not working?

Lars



--=_alternative 00525F0FC12569DC_=
Content-Type: text/html; charset="us-ascii"




<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I'm experiencing another problem using the any type.</font>
<br>
<br><font size=2 face="sans-serif">The patch from last week (bug #7) worked fine, now it seems</font>
<br><font size=2 face="sans-serif">that there is a problem in coercing an any into a certain type</font>
<br><font size=2 face="sans-serif">using the proprietary omniORB way, giving a type code</font>
<br><font size=2 face="sans-serif">as an argument to the value function of the any. However,</font>
<br><font size=2 face="sans-serif">it returns None when I call it the first time and returns an</font>
<br><font size=2 face="sans-serif">object reference (in this case) only when calling it a second</font>
<br><font size=2 face="sans-serif">time...</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; # obtain an any called 'item' from somewhere</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; mc = item.value(CORBA.TypeCode(CORBA.id(X.Y)))</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; mc = item.value(CORBA.TypeCode(CORBA.id(X.Y)))</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if mc is not None:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pass</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; else:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print 'Hello!'</font>
<br>
<br><font size=2 face="sans-serif">Is it possible that there is some initialization not working?</font>
<br>
<br><font size=2 face="sans-serif">Lars</font>
<br>
<br>
<br>
--=_alternative 00525F0FC12569DC_=--