[omniORB] Returning None Where Structs Are Required

W. Eliot Kimber eliot@isogen.com
Mon, 28 May 2001 18:06:08 -0500


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.

For example, I have an iterator that returns a struct on each next()
call. It would be most convenient if I could return None when the
iterator is at the end of the list. I am using structs instead of
objects to take advantage of the efficiency of structs.

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
justification for this--the ORB has to do type checking on the members
of the sequence--but the fact that it also allows arbitrary classes in
the non-sequence case does lead to the confusion that threw me for a
while today. I guess the solution if you want to have you own
convenience struct objects (e.g., to provide more convenient
constructors) would be to simply subclass from the generated struct
classes. I seem to have difficulty remembering that struct classes are
not transmitted as object references and therefore can be used anywhere.

Thanks,

Eliot

-- 
. . . . . . . . . . . . . . . . . . . . . . . .

W. Eliot Kimber | Lead Brain

1016 La Posada Dr. | Suite 240 | Austin TX  78752
    T 512.656.4139 |  F 512.419.1860 | eliot@isogen.com

w w w . d a t a c h a n n e l . c o m