tags:

views:

279

answers:

1

Are there any free tools that convert c++ code to idl? I am thinking of something similar to java2idl.

A: 

Java2idl is a special case...it takes byte code as input, so it's using reflection to decide what the class looks like, then writes out a compatible IDL. Since C++ doesn't easily support reflection, you need a source parser/preprocessor instead.

Other than student class projects, I have never run into free generators of IDL. Most people need to go the other direction...define an interface or class to implement in both C++ and CORBA, and so they directly write it in IDL first.

If you are working with small amounts of code, do the conversion by hand. If it's large amounts, you'll need to spend money on tools or time on writing your own. You could potentially do your own "reflection" using something like boost serialization to help automate analyzing your structures (object data in, IDL layout out).

Rick Berge