[omniORB] Estimating Size of Ugly Nested Structs in Python

Duncan Grisby dgrisby@uk.research.att.com
Fri, 06 Jul 2001 11:44:27 +0100


On Thursday 5 July, "W. Eliot Kimber" wrote:

> I am generating large hideously ugly nested structs. I wanted to confirm
> that the only ways in Python to determine the size of the Struct I'm
> returning (before it goes across the wire) is to either pickle the thing
> and see how big the pickle is or capture the size of the data I'm
> putting into the struct (which I'm currently attempting to do). 

You can use omniORB.cdrMarshal to marshal the struct into a string.
The resulting string is exactly the data which will be transmitted, so
its length tells you what you need to know.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --