OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
Topic-Definition Module
TopicModule_UML.png
Class model of the DCPS Topic-Definition Module

The Topic-Definition Module is comprised of the following classes:

  • TopicDescription
  • Topic
  • ContentFilteredTopic
  • MultiTopic
  • TopicListener
  • TypeSupport

TopicDescription represents the fact that both publications and subscriptions are tied to a single data-type. Its attribute type_name defines a unique resulting type for the publication or the subscription and therefore creates an implicit association with a TypeSupport. TopicDescription has also a name that allows it to be retrieved locally.

Topic

Topic is identified by its name, which must be unique in the whole Domain. In addition (by virtue of extending TopicDescription) it fully specifies the type of the data that can be communicated when publishing or subscribing to the Topic.

Topic is the only TopicDescription that can be used for publications and therefore associated to a DataWriter. All operations except for the base-class operations set_qos, get_qos, set_listener, get_listener, enable, and get_status_condition may return the value NOT_ENABLED.

Applicable QoS

QoS Brief
TOPIC_DATA User data
DURABILITY Expresses the lifetime of a sample
DURABILITY_SERVICE Specifies the configuration of the durability service
DEADLINE Sets the period in which a sample must be sent/received
LATENCY_BUDGET Sets the maximum delay the sample is in transit
LIVELINESS Set the method by which an instance is considered alive
OWNERSHIP Specifies if the DataWriters is shared or exclusive
RELIABILITY Set the required reliability of a DataReader/DataWriter pair, reliable or best effort
DESTINATION_ORDER Controls the logical order of the samples by reception time-stamp or source time-stamp
HISTORY Specify how many generations of the same instance to keep
RESOURCE_LIMITS Specify the amount of resources the DataReader/DataWriter pair can consume
TRANSPORT_PRIORITY A hint to the underlying transport for prioritization
LIFESPAN Specifies the maximum duration of validity of the data written

Default QoS values

QoS Attribute Value
TOPIC_DATA value.length 0
DURABILITY kind VOLATILE
DURABILITY_SERVICEservice_cleanup_delay
history_kind
history_depth
max_samples
max_instances
max_samples_per_instance
0
KEEP_LAST
1
LENGTH_UNLIMITED
LENGTH_UNLIMITED
LENGTH_UNLIMITED
DEADLINE period DURATION_INFINITE
LATENCY_BUDGET duration 0
LIVELINESS kind
lease_duration
AUTOMATIC
DURATION_INFINITE
OWNERSHIP kind SHARED
RELIABILITY kind
max_blocking_time
synchronous
BEST_EFFORT
100 ms
FALSE
DESTINATION_ORDER kind BY_RECEPTION_TIMESTAMP
HISTORY kind
depth
KEEP_LAST
1
RESOURCE_LIMITS max_samples
max_instances
max_samples_per_instance
LENGTH_UNLIMITED
LENGTH_UNLIMITED
LENGTH_UNLIMITED
TRANSPORT_PRIORITYvalue 0
LIFESPAN duration DURATION_INFINITE

Related Status Conditions

Status Brief
INCONSISTENT_TOPIC Another topic exists with the same name but different characteristics

Related Listeners

Listener Brief
on_inconsistent_topic() Another topic exists with the same name but different characteristics

Content Filtered Topic

ContentFilteredTopic is a specialization of TopicDescription that allows for content-based subscriptions. ContentFilteredTopic describes a more sophisticated subscription that indicates the subscriber does not want to necessarily see all values of each instance published under the Topic. Rather, it wants to see only the values whose contents satisfy certain criteria. This class therefore can be used to request content-based subscriptions.

The selection of the content is done using the filter_expression with parameters expression_parameters:

  • The filter_expression attribute is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE part of an SQL clause.
  • The expression_parameters attribute is a sequence of strings that give values to the ‘parameters’ (i.e., "%n" tokens) in the filter_expression. The number of supplied parameters must fit with the requested values in the filter_expression (i.e., the number of n tokens).