[omniORB] Complex numbers

Duncan Grisby duncan at grisby.org
Thu Oct 9 18:39:44 BST 2003


On Thursday 9 October, Marc Eberhard wrote:

> I've tried to overcome this by casting the C++ mapped IDL type to the native
> C++ type

[...]
> This works, but I'm far from convinced, that it is a really good idea... 

As others have pointed out, it's basically luck that it works. Any
number of things could cause it to break.

The best, and simplest thing to do is just to use conversion functions
that convert to and from the types you need. If (and only if) you find
that the copying overhead is too high, the best thing to do would be
to modify the omniidl output so it used the types you need rather than
the CORBA types. That's fragile in that the layout of the generated
code can change between omniORB versions, but it avoid second-guessing
the way the C++ compiler arranges things.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list