When creating an interface (IDL) for RTI Connext - I can create an enumeration with constant values. To interface to users using openDDS this doesn't work - enums can't have values. Is there a recommended design idea to create an interface where I can use these constant values? It seems like if I want to use an enum portably then I need to carry an additional header with constants to map the enums to the values I want.
Hi Dominic,
Well, unfortunately, even though RTI's support of the IDL 4.0 standard includes the assignment of values to enums, the open source openDDS doesn't. You can try to get the maintainers of openDDS to do so...
A kludge is to define constants in IDL
const long ORANGE = 1;
const long APPLE = 2;
etc.
And then use a "long" as the datatype of the enumeration. You lose the type safety, but get defined values for symbols.