A domain participant is a component
element that indicates that the component contains elements that are
related to Data Distribution Service for Real-Time Systems (DDS).
In
this lesson, you generate an IDL file based on the definition of your
MyTopicStruct topicStruct element. Then, you generate code for it,
and create a library that stores the functions that are extracted
from the IDL file. That library can be used by future applications
that might want to share data that is based on the MyTopicStruct topicStruct
element.
- Right-click the TopicsPkg package and select .
- Open the Features window for the domain participant element
and enter the following information:
- On the General tab, enter the
following information:
- Name the domain participant element MyTopicStructLib
- In the Directory field, enter MyTopicStructLib
- In the Type area, select Library
- On the Scope tab, select TopicsPkg,
and then click OK
- Set the target environment:
- In the Configurations category
under the MyTopicStructLib domain participant, open the Features window
for the DefaultConfig configuration
- On the Settings tab, select the MSVC9 or Linux environment,
and then click OK
- Generate code: Select . If you are asked if you want to create a directory,
click Yes. One of the generated
files is DDSMyTopicStructLib.idl. To see the file,
in the browser, right-click the MyTopicStruct topicStruct and select Edit
topic Struct.
- If you selected Edit topic Struct in
the previous step, click in the browser before continuing with the
next step.
- If you are using the RTI DDS implementation, then before
building the application, verify that the RTI installation process
created an environment variable called NDDSHOME that points to the
directory named ndds.4.5d. (The makefiles generated by Rational® Rhapsody®use
this variable to locate the required header files.)
- Build the library: Select . Part of the build process is the
IDL generation of source files from the DDSMyTopicStructLib.idl file.
These files support the registration of your MyTopicStruct topicStruct
element and the definition of dataWriters and dataReaders in the future.
Note: If
you are using the RTI DDS implementation, and during the build process
you get the message "rtiddsgen is not recognized as an internal or
external command", it means that the RTI installation process did
not add the directory containing rtiddsgen.bat to your Path environment variable.
Add the directory containing rtiddsgen.bat to the Path variable and
run the build command again.
- For the purpose of this tutorial, in the Components category,
delete the DefaultComponent element from your
project: Right-click DefaultComponent and select Delete
from Model, as shown in the following figure. Confirm
the deletion.