where can I find IDL file that is used in examples/connext_dds/c++/hello_simple ?

4 posts / 0 new
Last post
Offline
Last seen: 8 years 4 months ago
Joined: 11/15/2015
Posts: 5
where can I find IDL file that is used in examples/connext_dds/c++/hello_simple ?

Hello:

I am new to RTI but somewhat familiar w/ DDS and middleware concepts. I have been able to download RTI and build and run the example under:

~/rti_workspace/5.2.0/examples/connext_dds/c++/hello_simple/objs/i86Linux3gcc4.8.2

My question is that from reading the Makefile.common I can NOT figure out which IDL file actually gets used in this example. In particular, I want to modify the IDL to send a double rather than a string. So, where in the example structure can I change the IDL and shoud a  make at "hello_simple/" level be able to find and recompile the IDL as needed and rebuild my example?

(Though not important I have noticed that "make -f make/Makefile.i86Linux3gcc4.8.2" relinks the app each time though nothing has changed; though this is a minor quibble.)

Gautam

 

Organization:
Gerardo Pardo's picture
Offline
Last seen: 1 day 10 hours ago
Joined: 06/02/2010
Posts: 601

Hello Gautam,

There is no IDL associated with the hello_simple example because it uses one of the Connext DDS built-in types.  These are already built into Connext DDS for conveneience so a developer does not need to generate any code to use them. You can find details on using the built-in String type here.  The IDL description of the builtin types can be found here.

If you want an example where you can start with an IDL and modify it from there, a better place to start would be ~/rti_workspace/5.2.0/examples/connext_dds/c++/hello_idl.

It is even better to just use the RTI Launcher, click on the "Utilities" tab, then select the "Code Generation" and this will guide you though the whole process, creating an example IDL file that you can edit and a simple makefile for the platform and language you select.

Regards,

Gerardo

Offline
Last seen: 8 years 4 months ago
Joined: 11/15/2015
Posts: 5

OK, I used RTI Launcher and indeed that is a very good tool that makes life easy.  My objective is to do a small interoperability test between RTI and OpenDDS where only a single "double" is in the IDL, I suspect some potential 4-byte/8-byte alignment issues but I need to do the tests.  In code that RTI tools generated for me I see lines below:

// Create a Topic -- and automatically register the type
dds::topic::Topic<Test1> topic (participant, "Example Test1");

I assume that "Example Test1" is the topic. What is the "type" string? I need it so that I provide it to OpenDDS code:

// Create a topic for the Quote type...
DDS::Topic_var quote_topic =
participant->create_topic (QUOTER_QUOTE_TOPIC,
                           QUOTER_QUOTE_TYPE,
                           default_topic_qos,
                           DDS::TopicListener::_nil(),
                           ::OpenDDS::DCPS::DEFAULT_STATUS_MASK);

Thank you again for all the help. BTW, IDL is:

struct Test1 {
        double x;
};

Gautam

Gerardo Pardo's picture
Offline
Last seen: 1 day 10 hours ago
Joined: 06/02/2010
Posts: 601

Hi,

I see you are using he modern C++ API.  You can take two approaches here:

(1) Once you have created the Topic, you can call the operation  type_name() on the Topic object to retrieve the default name assigned for the data-type.  This will probably be just the name of the structure qualified by any nested modules. In your example IDL it will probably be "Test1".

(2) You can construct the Topic<Test1> with one of the other overloaded constructors that allows you to specify the name of the type (registered type name to be precise). For example using this constructor the topic would be created like this:

dds::topic::Topic topic (participant, "Example Test1", "My Desired Type Name");

You can pick any type name you like as long as you choose the same on both sides. Also it may be a good idea to run the rtiddsspy utility (also from teh RTI Launcher) to see what the names of types actually are for the RTI and the OpenDDS application. This can help debug in case something is not geing set as you think it should...

Gerardo