1

I'm using openDDS pub/sun middleware. I have tested openDDS using complex structure.

e.g .

typedef struct DSMD
    {
          string a;           
          long b;

    } StandByModeData;

   struct DSMCD{        
    string SessionId;       
    DSMD Data;
  };

but now I have different structure.which is pass over the openDDS.

how can I use template in idl structure?

I need something like this.

template <struct T> 
struct array { 
  T typr;
};
Vishvesh Phadnis
  • 2,448
  • 5
  • 19
  • 35

3 Answers3

1

This is something that is currently not possible with OpenDDS. IDL3+ does define templated modules which is like your example, but that is not supported with OpenDDS or any other DDS vendor as far as I know.

Johnny Willemsen
  • 2,942
  • 1
  • 14
  • 16
0

Fast-RTPS from eProsima could support large variety of data types using DDS, aka the dynamic type builder, some sample dynamic builder could refer to here and the github repo refer to https://github.com/eProsima/Fast-RTPS . IMHO, when the data type support std::string type, it could be support any kind of data type, since std::string is a versatile choice. For uncertain data type, you could cast the data into a json formatted string to pass through the DDS. I've been working on such thing, further progress would be forwarded here later on.

TCH
  • 51
  • 1
  • 4
0

You can do your own VMF (variable message format) message type. Code I'm working on now uses this concept to pass messages between nodes/participants using eprosima FastDDS. The same idl file can be used for OpenDDS and FastDDS. We use both DDS implementations concurrently in some instances.

@topic
struct VariableMessageType
{
   /* Message id */
   long msg_id; 

   /* Number of bytes in the data vector */
   /* units: none */
   long num_bytes; 

   /* num_bytes sized array of bytes */
   /* units: none */
   sequence<octet> data; 
};
WeekendWar
  • 16
  • 1