[omniORB] python access to streams

Ted Horst Ted.Horst@wdr.com
Tue, 15 Feb 2000 16:50:30 -0600


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()

And to unarchive, I would do:

stream = CORBA.OctetStream.Encapsulation(encap_string)
cursor = stream.cursor()
foo = tc._fnorb_unmarshal_value(cursor)

It doesn't look like it would be too difficult to add this, but I thought I  
should check to see if I was missing something first.  I also wanted to  
know if other people thought this was a good idea, and, if so, to have some  
discussion on a proper interface.

Ted Horst <Ted.Horst@wdr.com>