[omniORB] python access to streams

Ted Horst Ted.Horst@wdr.com
Wed, 16 Feb 2000 09:25:13 -0600


On Wed, 16 Feb 2000, Duncan Grisby wrote:
> On Tuesday 15 February, Ted Horst wrote:
>
> > Is it possible to get access to GIOP encapsulations from python ?
> >
> > In Fnorb, to archive a struct to a stream, I would do something like:
> >
> > foo = MyIDLStructClass(....)
> > stream = CORBA.OctetStream.Encapsulation()
> > cursor = stream.cursor()
> > tc = CORBA.typecode(foo._FNORB_ID)
> > tc._fnorb_marshal_value(cursor, foo)
> > encap_string = cursor.stream().data()
>
> Is there any particular reason that you want these to be GIOP
> encapsulations?  Do you want to read them from another language?  I
> suppose there is some scope for using GIOP's CDR as a cross-language
> pickling format. Unless you want cross-platform capabilities, I would
> suggest that it is far better to use Python's normal pickle or marshal
> modules.

Yes, I am trying to use GIOP's CDR as a cross-language pickling format.  We  
are using CORBA to communicate between python, Objective-C, C++, and Java  
on a couple of different platforms, and we have some generic data structures  
defined in IDL that we pass around.  It thought it would be nice to  
leverage the CDR encoding of these structures to persist some of this data.

>
> It wouldn't be too hard to add GIOP stream access to omniORBpy, but it
> would require additions to the C++ code. As omniORBpy stands, Python
> never gets its hands on the marshalled GIOP stream.

Ok, I will take a shot at this and post to the list.

Thanks
>
> Cheers,
>
> Duncan.
>
> --
> -- Duncan Grisby  \  Research Engineer  --
> -- AT&T Laboratories Cambridge          --
> -- <http://www.uk.research.att.com/~dpg1 --
>
-----------------------------
Ted Horst <Ted.Horst@wdr.com>
"the day serious reasoning about programs becomes widespread is the day
most programmers abandon their craft to resume drug trafficking <wink>."
--Tim Peters on comp.lang.python