Hello,
I've started my research project by Rti DDS Connext,
I have 2 kind of data types :
struct bite_msg_t {
string<128> color; //@key
long x;
long y;
};
struct bite_iam_reply_t {
string<128> color; //@key
short a;
short b;
};
As i realized , for publishing these 2 kinds of data types , I should make 2 topics and 2 datawriters. and for subscribing , i should make 2 kinds of Listeners and 2 datareaders?
I've really confused to write the code for this simple project.
Would you please help me?
Hi,
If you know the collection of data-types that you may send then you can define a "union" type in IDL. A DataWriter of the "union" type can write any one type in the union. And similarly a DataReader of the "union" can read any of the types. The discriminator in the union defines which of the data-types you are actually writing, and in the reader side the DataReader first looks at the discriminator to determine the members of the union it should access.
The IDL union type for the two types that you describe above would be this:
Gerardo
Hi,
We have done the same thing but how to set the descriminator value in publisher.
Regards,
kenil.
The specific API depends on the programming language.
What programming language are you using?
Hello,
c++ Traditional.
I have another question. Is their anything to differentiate in subscriber if their is more than 1 publisher publishes the data?
Regards,
sudarshan.