[omniORB] Complex numbers

Duncan Grisby duncan at grisby.org
Fri Oct 10 14:43:07 BST 2003


On Thursday 9 October, Marc Eberhard wrote:

> That's a very interesting option. Looking at the output from omniidl, my
> Complex struct reads

[...]
> which results in the same binary data structure as long as CORBA::Double
> equals _Tp.

And as long as the use of the template doesn't cause the C++ compiler
to do anything unexpected.

> Now would it do the trick, if I modify the output from omniidl to
> 
>   class Complex : public complex<double> {

[...]
> this? The implementation of the stream operators needs to be cahnged too to
> use the native fields as defined in the C++ complex type.
> 
> Is it considered dangerous to fiddle around with these definitions in such a
> way? More or less dangerous than casting the types directly?

Less dangerous than just casting types, since at least you're using
the C++ type system rather than abusing it. However, what I had in
mind was to dispense with the IDL generated Complex struct altogether
and modify the call descriptors, object references and skeleton
classes to use the STL complex type directly.

Regardless, like I said before, I don't think you should be thinking
about any of this unless you find doing the easy translation function
is too slow.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list