Only last topic created from IDL?

3 posts / 0 new
Last post
Offline
Last seen: 8 years 2 months ago
Joined: 07/08/2015
Posts: 5
Only last topic created from IDL?

Hello, 

I am creating two topics in IDL but in code only one topic is getting created ,i am posting the screen shots.

Please guide me how to create more than one topic in code using IDL ?

Regards 

Dhawal

 

 

 

 

 

AttachmentSize
Image icon cfile2.png272.66 KB
Image icon cfile.png277.47 KB
Image icon idl.png63.8 KB
Organization:
Gerardo Pardo's picture
Offline
Last seen: 1 day 7 hours ago
Joined: 06/02/2010
Posts: 601

Hello Dhawal,

What you are seeing is the expected behavior of rtiddsgen.  The IDL file can contain many data-types, in this case rtiddsgen will generate the code needed to serialize/deserialize all the data-types defined in the IDL (this is the XXXPlugin.cxx file) as well as the Type-specifc, Writer and Reader objects (this is the XXXSupport.cxx and the XXX.cxx files). However the example code generated (XXX_publisher.cxx and XXX_subscriber.cxx) registers only one of the data types and one Topic and creates an example of publishing and subscribing that one Topic.  We made the arbitrary choice to select the last type declared in the IDL as the one to use in the example.

This is just intended to show an example on how to use the API on a complete application. It is expected that can repeat that process for the other data-types and Topics you want to publish/subcribe.  Note that the choice of using separate files (one to publish and one to subscribe) is also arbitrary as you could publish and subscribe from the same application. You could also create multiple Topics of the same data-type, there are many possible variations and the example just shows one way to do things.

If you want to minimize the ammount of "boilerplate" code to write. You could use the XML-Based Application Creation as described in this Getting started.

Regards,

Gerardo

Offline
Last seen: 8 years 2 months ago
Joined: 07/08/2015
Posts: 5

Thanks for the help sir,I got it.