There is an OMG standard called Remote Procedure Call over DDS (RPC over DDS) that defines how IDL interfaces can be mapped to code (it is in the family of DDS standards). CoreDX DDS does support this standard for several target languages (including C++, Java, and C#).
In addition to simply mapping the interface to the target language, the RPC over DDS standard provides a way to use DDS as the underlying transport for the RPC operations. It provides for both low-level interfacing (that is, dealing with sending a receiving requests manually), and high-level (invoking a method the 'interface') API's. In either case, the inter-process communication is handled via DDS in a way that is interoperable. In my opinion, it is a very powerful approach.
Here's some example IDL:
module robot {
exception TooFast {};
enum Command { START_COMMAND, STOP_COMMAND, TERMINATE_COMMAND };
struct Status
{
string msg;
};
@DDSService
interface RobotControl
{
void command(Command com);
float setSpeed(float speed) raises (TooFast);
float getSpeed();
void getStatus(out Status status);
};
};
NOTE: The '@DDSService' annotation informs an aware IDL compiler to generate RPC over DDS support for the interface.
Without @DDSService annotation, our code generator will simply generate a class declaration [which I think you are looking for] that looks something like this:
class RobotControl {
public:
RobotControl();
~RobotControl();
public:
virtual void command (
/* IN */ const enum robot::Command com ) = 0;
virtual float setSpeed (
/* IN */ const float speed ) = 0;
virtual float getSpeed ( ) = 0;
virtual void getStatus (
/* OUT */ struct robot::Status & status ) = 0;
};
With the @DDSService annotation, there is a lot more code generated that provides a full client-side implementation (robot.RobotControlClient) and an abstract server side ready for implementation (robot.RobotControlService). With that, your client application can simply do this:
RobotControlClient robotClient = new RobotControlClient( client_params );
robotClient.setSped( 10 );
The server application can extend robot.RobotControlService, and implement the service calls, something like this:
public class MyRobotControlService extends RobotControlService {
....
private static final float MAX_SPEED = (float)20.0;
public float
setSpeed ( /* in */ float speed ) throws TooFast
{
float retval = (float)0.0;
if (speed < MAX_SPEED)
{
current_speed = speed;
retval = this.current_speed;
}
else
{
/* EXCEPTION: */
throw new robot.TooFast();
/* not reached... */
}
return retval;
}