4.5.2 Participant Library

A participant library provides a way to organize a set of participants belonging to the same system. A participant configuration specifies all the entities that a DomainParticipant created from this configuration will contain.

Figure 4.6: Participant Library Tag

Figure 4.6: Participant Library Tag, Table 4.7 Participant Library Tag, and Table 4.8 Domain Participant Tag show the description of a <domain_participant_library> and the tags it contains.

A <domain_participant> can be associated with a domain where topics and their associated types are already defined. The elements <register_type> and <topic> may also be defined in a <domain_participant>—the same way it is done in a <domain>. This makes it possible to add Topics, data-types, etc. beyond the ones defined in the domain, or alternatively redefine the elements that are already in the <domain>.

A <domain_participant> is defined by specifying the set of Entities it contains. This is done using tags such as <publisher>, <subscriber>, <data_writer> and <data_reader>, which specify an Entity of their corresponding type. These Entities are created within the DomainParticipant instantiated from the configuration profile that contains the definitions.

Table 4.7 Participant Library Tag

Tags within <domain_participant_library>

Description

Number of Tags Allowed

<domain_participant>

Specifies a participant configuration.

Attributes:

1 or more

name

Participant configuration name.

base_name (optional)

Base participant name. It specifies another participant from which to inherit the configuration.

domain_ref (optional)

Reference (fully qualified name) to a defined <domain> in the domain library.

domain_id (optional)

Domain ID. If specified, overrides the id in the domain it refers to.

If no domain_id is specified directly or in the referenced domain then the default domain_id is 0.

A <domain_participant> may inherit its configuration from another “base participant” specified using the base_name attribute. In this case, overriding applies to the base <domain_participant> as well as to the referred <domain>.

Note that in DataWriters always belong to a Publisher and DataReaders to a Subscriber. For this reason the <data_writer> and <data_reader> typically appear nested inside the corresponding <publisher> and <subscriber> tags. However, for convenience, it is possible to define <data_writer> and <data_reader> tags directly under the <domain_participant> tag. In this case, the DataWriters and DataReaders are created inside the implicit Publisher and Subscriber, respectively.

Table 4.8 Domain Participant Tag

Tags within <domain_participant >

Description

Number of Tags Allowed

<memory_management>

Configures certain aspects of how Connext allocates internal memory. The configuration is per DomainParticipant and therefore affects all the contained DataReaders and DataWriters. For example:

<domain_participant name="test">
    <memory_management>
	<sample_buffer_min_size>
		X
	</sample_buffer_min_size>
	<sample_buffer_trim_to_size>
		true
	</sample_buffer_trim_to_size>
    </memory_management>
    ...

The <memory_management> tag can include the following tags:

sample_buffer_min_size: For all DataReaders and DataWriters, the way Connext allocates memory for samples is as follows: Connext pre-allocates space for samples up to size X in the reader and writer queues. If a sample has an actual size greater than X, the memory is allocated dynamically for that sample. The default size is DDS_LENGTH_UNLIMITED (meaning no dynamic memory is used; the maximum sample size is pre-allocated).

sample_buffer_trim_to_size: If set to true, after allocating dynamic memory for very large samples, that memory will be released when possible. If false, that memory will not be released but kept for future samples if needed. The default is false.

This feature is useful when a data type has a very high maximum size (e.g., megabytes) but most of the samples sent are much smaller than the maximum possible size (e.g., kilobytes). In this case, the memory footprint is dramatically reduced, while still correctly handling the rare cases in which very large samples are published.

0 or more

<register_type>

Specifies how a type is registered. Same as within the <domain> tag

0 or more

<topic>

Specifies a topic. Same as within the <domain> tag

0 or more

<publisher>

Specifies a configuration.

Attributes:

0 or more

name

Publisher configuration name.

multiplicity (optional)

Number of Publishers that are created with this configuration.

Default is 1.

<subscriber>

Specifies a Subscriber configuration.

Attributes:

0 or more

name

Subscriber configuration name.

multiplicity (optional)

Number of Subscribers that are created with this configuration.

Default is 1.

<data_writer>

Specifies a DataWriter configuration. The DataWriter will be created inside the implicit Publisher.

Attributes:

0 or more

name

DataWriter configuration name.

topic_ref

Reference (name) a <topic> within the <domain> referenced by its <participant> parent.

multiplicity (optional)

Number of DataWriters that are created with this configuration.

Default is 1.

<data_reader>

Specifies a data reader configuration. The DataReader will be created inside the implicit subscriber.

Attributes:

0 or more

name

Data reader configuration name.

topic_ref

Reference (name) a <topic> within the <domain> referenced by its <participant> parent.

multiplicity (optional)

Number of DataReaders that are created with this configuration.

Default is 1.

<domain_participant_qos>

DomainParticipant QoS configuration.

0 or 1

The <publisher>, <subscriber>, <data_writer>, and <data_reader> tags are described in Figure 4.7: Publisher and Subscriber Tags , Table 4.9 Publisher Tag, Table 4.10 Subscriber Tag, Table 4.11 DataWriter Tag and Table 4.12 DataReader Tags.

Figure 4.7: Publisher and Subscriber Tags

The <publisher> tag defines by default a Publisher. It may contain a QoS configuration and several DataWriters. Likewise, the <subscriber> tag defines by default a Subscriber. It may contain a QoS configuration and several DataReaders.

Table 4.9 Publisher Tag

Tags within <publisher >

Description

Number of Tags Allowed

<data_writer>

Specifies a DataWriter configuration. Same as within the <participant> tag.

0 or more

<publisher_qos>

Publisher QoS configuration.

0 or 1

 

Table 4.10 Subscriber Tag

Tags within <subscriber>

Description

Number of Tags Allowed

<data_reader>

Specifies a DataReader configuration. Same as within the <participant> tag.

0 or more

<subscriber_qos>

Subscriber QoS configuration.

0 or 1

 

Table 4.11 DataWriter Tag

Tags within <data_writer >

Description

Number of Tags Allowed

<datawriter_qos>

DataWriter QoS configuration

0 or 1

 

Table 4.12 DataReader Tags

Tags within <data_reader>

Description

Number of Tags Allowed

<datareader_qos>

DataReader QoS configuration.

0 or more

<filter>

Enables the creation of DataReader with this configuration from a ContentFilteredTopic.

Attributes:

0 or 1

name

Name of the ContentFilteredTopic. The ContentFilteredTopic will be associated with the same Topic referenced by the containing <data_reader>

filter_kind

Specifies which ContentFilter to use. It defaults to the builtin.sql filter.

The <filter> tag within a <data_reader> enables content filtering. It causes the corresponding DataReader to be created from a ContentFilteredTopic with the specified filter characteristics.

The ContentFilteredTopic name is generated as follows: xml_filter_name::xml_topic_name.

Where xml_filter_name is the value of the attribute name of the <filter> tag, and xml_topic_name is the value of the attribute name of the referred <topic> tag.

Table 4.13 Filter Tag

Tags within <filter >

Description

Number of Tags Allowed

<expression>

Filter expression

0 or 1

<parameter_list>

List of parameters. Parameters are specified using <param> tags.

The maximum number of parameters is 100.

<parameter_list>
    <param>param_0</param>
    <param>param_1</param>
    ...
</parameter_list>

0 or 1

For example:

<domain_participant name="MyParticipant" 
domain_ref="MyDomainLibrary::MyDomain"> <publisher name="MyPublisher"> <data_writer name="MyWriter" topic_ref="MyTopic"/> </publisher> <subscriber name="MySubscriber"> <data_reader name="MyReader" topic_ref="MyTopic"> <filter name="MyFilter" kind="builtin.sql"> <expression> count &gt; %0 </expression> <parameter_list> <param>10<param> </parameter_list> </filter> </data_reader> </subscriber> </domain_participant>

The above configuration defines a <domain_participant> that is bound to the <domain> “MyDomain”.

A DomainParticipant created from this configuration will contain:

  • A Publisher which has a DataWriter created from the Topic “MyTopic”.
  • A Subscriber which has DataReader created from a ContentFilteredTopic whose related Topic, “MyTopic”, uses a SQL filter. The ContentFilteredTopic has the name “MyTopic::MyFilter”.