[omniORB] Returning None Where Structs Are Required

Duncan Grisby dgrisby@uk.research.att.com
Tue, 29 May 2001 14:33:30 +0100


On Monday 28 May, "W. Eliot Kimber" wrote:

> I notice that OmniORBpy does not allow None where the IDL requires a
> struct. Is this a CORBA restriction or an OmniORB implementation choice?
> Have I missed some obvious way to get the equivalent of passing in or
> returning None for structs? I didn't see anything about this one way or
> the other in the language mapping, but I didn't read it that closely.

As Gary has already replied, the standard doesn't permit null
structs. If the IDL says struct, you must send a valid struct.

> Also, WRT some of our earlier questions about sequences of structs: I
> did determine that the variable was whether or not the struct class
> instance was an instance of the generated Python class or an arbitrary
> class that happens to have the correct member variables. OmniORB appears
> to be happy to pass around single instances of arbitrary classes but
> when you use the same object in a sequence, it complains. I can see the
[...]

When omniORBpy is expecting a struct, it does accept any Python object
with the right members names and types. It should do this regardless
as to whether the struct is on its own or inside a sequence. Do you
have an example which shows an error?

This behaviour is not required by the Python mapping specification, so
it may not be portable between ORBs.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --