[omniORB] omniORBpy-3.0 "casting" inout Parameters
aaaa bbbb
yxcv2000 at yahoo.com
Sun Aug 19 10:37:48 BST 2007
--- Duncan Grisby <duncan at grisby.org> wrote:
> On Friday 17 August, aaaa bbbb wrote:
>
> > I have to use the following interface:
> >
> > module A
> > {
> > [...]
> > struct Attr {
> > string name;
> > SomeType type;
> > long numericv;
> > string textv;
> > SomeType2 state;
> > };
> > typedef sequence<Attr> AttrSeq;
> > }
> >
> > module B
> > {
> > [...]
> >
> > A::RetType myFkt(
> > in A::Type1 ver, // Enumeration
> > inout A::Type2 obj,
> > inout A::AttrSeq theList)
> > raises (A::SomeException);
> >
> > }
> >
> > import A
> > import B
> >
> > [...]
> > ret, obj, theList=obj.myFkt(A.NUMBER1, obj,
> theList)
> >
> > will throw an BAD_PARAM_WrongPythonType exception.
> How
> > can I "cast" obj and theList to the correct type?
> > I have read the OMG "Python Language Mapping
> > Specification" but was not able to find any
> > information. Thanks for any help!
>
> You've missed out the important bit of the code
> where you populate the
> argument values. You are calling the operation with
> the right number of
> arguments, and extracting the right return values.
> The problem is that
> the arguments don't have the right types according
> to the IDL. It's
> nothing to do with the fact that they are declared
> inout.
Thanks for your reply!
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.")")
____________________________________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/
More information about the omniORB-list
mailing list