python connector topic name definition

3 posts / 0 new
Last post
Offline
Last seen: 2 years 4 months ago
Joined: 08/12/2021
Posts: 14
python connector topic name definition

The RTI Connector for Python site demonstrates defining a topic name in the connector.xml like this:

<register_type name=ShapeType" type_ref="ShapeType"/>
<topic name="Square" register_type_ref="ShapeType"/>

 

Is it possible to define this with a one-liner?

This does not work, but I'm wondering if there is similar syntax that is possible.

<topic name="Square" type_ref="ShapeType"/>

 

Thanks!

Bobby

 

 

Offline
Last seen: 1 week 6 days ago
Joined: 12/05/2019
Posts: 9

Hello Bobby, 

Unfortunately, I do not think this is feasible. The reason for this is that DomainParticipants require Types to be registered before these can be used, whether this is for Topics, DataReaders (Inputs) or DataWriters (Outputs).
This makes sense, as when you're registering a type, you're essentially associating a name with a type definition, e.g. number and type of fields, metadata annotations. 

Using the <register_type> XML element as an example, a DomainParticipant may be interested in only registering a subset of types defined in the <types> XML element.
Another possibility, is registering the same type definition (type_ref) with different names (name) to distinguish identical types. 

Regards,
Alejandro

Offline
Last seen: 2 years 4 months ago
Joined: 08/12/2021
Posts: 14

Ok, thanks for the help Alejandro.

 

Bobby