[omniORB] omniORBpy-3.0 "casting" inout Parameters (solved)

aaaa bbbb yxcv2000 at yahoo.com
Mon Aug 20 00:25:50 BST 2007


--- Luke Deller <ldeller at iress.com.au> wrote:

> ....
> > > >   struct Attr {
> > > >     string name;
> > > >     SomeType type;
> > > >     long numericv;
> > > >     string textv;
> > > >     SomeType2 state;
> > > >   };
> > > >   typedef sequence<Attr> AttrSeq;
> ...
> > That is exactly the problem. I don't know how to
> > create variables with the correct type.
> 
> > theList = A.AttrSeq()
> > will fail with an exception (__init__ method of
> > A.AttrSeq create by omniiorb is " raise
> > RuntimeError("Cannot construct objects of this
> > type.")")
> 
> Yes, CORBA sequences are mapped to Python lists (as
> per section 1.3.2 of the "Python Language Mapping
> Specification"), so you don't want to create AttrSeq
> instances.
> 
> CORBA structs are mapped to Python instances, so you
> will want to create A.Attr instances and put these
> into your list.
> 
> eg:
> theList = [
>    
>
A.Attr(name='foo',type=someVal,numericv=42,textv='foo',state=someVal2),
>    
>
A.Attr(name='bar',type=someVal,numericv=42,textv='bar',state=someVal2),
>     ]
Excellent! That solved the problem. Thanks a lot!


      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 





More information about the omniORB-list mailing list