[omniORB] OmniORBpy and direct access to Any buffer

Duncan Grisby duncan@grisby.org
Wed Oct 16 21:00:02 2002


On Tuesday 15 October, Laurent Pointal wrote:

> I have a CORBA client (pyTango) which move large data (like sequence of
> integers representing an image) from an OmniORBpy Any to a
> Numeric.array.
> 
> Is there a way to avoid the cost of the intermediate Python list
> returned by Any.value(), and to directly get a list-like access to the
> internal buffer (which could be used in Numeric.array construction with
> only one data copy) ?

No. In fact, there is no internal buffer to access. In omniORBpy
(unlike in the C++ ORB), Anys are directly unmarshalled into the
correct Python data types. They are never stored as a marshalled
buffer. If you look at the implementation of value(), you'll see that
it just returns the already unmarshalled data.

The only way to do what you want would be to modify the C++
unmarshalling code in pyMarshal.cc to create the type you want, rather
than the normal Python language mapping. That would affect all data
with that type, not just the case when it's wrapped in an Any.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --