javac++idldata-distribution-serviceopendds

DDS IDL Compiler


I am using IDLs to define data for an application using OpenDDS.

I also want to use IDLs to define interfaces for the application, but OpenDDS (and most other DDS implementations it seems) does not support interfaces in IDLs.

Are there any compilers that will generate simple stubs from IDL interfaces? I need it to support at least C++ and Java.

All of the IDL compilers that are a part of CORBA ORBs generate a lot of CORBA-specific code and boilerplate. I want something that does a simple mapping from IDL to C++/Java/etc. For example, if I have this IDL:

module sample_module {
  interface sample_interface {
    attribute char sample_field;
    boolean sample_func();
  };
};

I want the compiler to generate files like this in C++:

namespace sample_module {
  class sample_interface {
    char sample_field;
    boolean sample_func();
  };
};

Solution

  • You could use the local interface support, that results in a C++ base class with pure virtual methods to implement. This is for example used by LwCCM to define components, see for example AXCIOMA, there we use local interfaces combined with data defined in IDL. See one of our articles for some more information.

    As alternative you could also create your own custom generation based on IDL, in TAOX11/AXCIOMA/R2CORBA we are using RIDL, you could create a custom backend to generate some code specific for interfaces