Bruce
Bruce

Reputation: 2310

Given a DDS topic name, can the topic type information be determined at run-time?

I am evaluating RTI ConnextDDS, working in C++. At run-time, on reading a DDS message and extracting the topic name, is there an API that offers run-time type information concerning that topic? That is can I get the name and type of each element in the topic?

Upvotes: 1

Views: 943

Answers (1)

Reinier Torenbeek
Reinier Torenbeek

Reputation: 17373

Yes, this is possible, although not straightforward.

Doing this in a completely dynamic way requires inspection of the so-called built-in Topics, which contain information about the different DDS Entities discovered. See Chapter 17 "Built-In Topics" in the Core Libraries User's Manual. This RTI community example on built-in Topics might help as well.

In particular, the PublicationBuiltinTopic and the SubscriptionBuiltinTopic contain the fields type and type_code, which are both intended to contain a description of the type associated with the Topic for the DataWriter or DataReader in question. The type field is of a TypeObject which is standardized in the OMG DDS-XTypes specification. The type_code field is a proprietary format, as explained in the User's Manual.

Before going down this entire path, I would make sure that this is something you actually want to do, and why? Ideally, the tooling that comes with the product should provide you with all the information you need.

Upvotes: 2

Related Questions