Module: dds.topic¶
-
class
dds.topic.
Topic
¶ Bases:
object
Topic is the basic description of data to be published or subscribed. A topic is identified by a name and a type. When a topic is created, it will automatically register (with the Participant) the TypeSupport (associated with the provided data type) under the provided type_name.
Parameters: - topic_type – a class object identifying the data type for the topic. The provided type must have an associated TypeSupport
- topic_name (str) – the name of the topic to create
- type_name (str) – the type_name to associate with the topic (can be None, in which case it is taken from the TypeSupport)
- dp (
dds.domain.DomainParticipant
) – the Participant in which to create the Topic (can be None, in which case one is created) - qos (
dds.topic.TopicQos
) – The qos to associate with the topic (can be None in which case the default from the Participant will be used) - listener (
dds.topic.TopicListener
) – The listener to associate with the topic (can be None) - mask (
dds.core.StatusMask
) – mask indicating which listener callback operations are enabled
-
delete
()¶ Destroys the Topic and cleans up all internal resources.
-
enable
()¶ This operation enables the Topic.
-
get_inconsistent_topic_status
()¶ Provides access to the InconsistentTopicStatus of the Topic. As a side-effect, this routine will reset the total_count_change status field to zero.
Returns: dds.core.InconsistentTopicStatus
-
get_instance_handle
()¶ This operation returns the
dds.core.InstanceHandle
that identifies the Publisher.
-
get_listener
()¶ This operation returns the currently installed TopicListener.
-
get_participant
()¶ This operation returns the
dds.domain.DomainParticipant
this Publisher belongs to.
-
get_qos
()¶ Returns:
dds.topic.TopicQos
: the current TopicQos settings
-
get_status_changes
()¶ This returns the list of triggered communication statuses in the Topic.
If the Topic is not enabled, all statuses will be untriggered. The list returned by get_status_changes may be empty. The list of statuses returned by get_status_changes operation contains statuses that are triggered on the Topic.
-
get_statuscondition
()¶ This operation allows access to the StatusCondition associated with the Topic. The returned condition can be added to a WaitSet.
-
is_enabled
()¶ Returns True if the topic is currently enabled; False otherwise.
-
set_listener
()¶ Installs a TopicListener on the Topic
Only one listener may be attached to a Topic at a time. A call to set_listener() will replace any current listener with the provided listener. <p>Parameter listener can be None, which indicates a listener that does nothing.
Parameters: - listener (
dds.topic.TopicListener
) – the listener to install - mask (
dds.core.StatusMask
) – set of bit values (in ‘int’ form) indicating which callbacks should be invoked
- listener (
-
set_qos
()¶ Sets the TopicQos values. These QoS values affect the behavior of the Topic
Parameters: qos ( dds.topic.TopicQos
) – QoS policy values to set in the topic
-
class
dds.topic.
TopicListener
¶ Bases:
object
TopicListener holds a set of callbacks that can be invoked by a Topic
-
on_inconsistent_topic
()¶ Invoked when the ‘inconsistent_topic’ status is triggered on the Topic
Parameters: status ( dds.core.InconsistentTopicStatus
) – provides a snapshot of the status at the time the listener was invoked
-
-
class
dds.topic.
TopicQos
¶ TopicQos holds QoS policies relevant for a dds.topic.Topic. It contains the following attributes:
-
topic_data
¶ dds.qos.UserDataQosPolicy
– A sequence of octets associated with the Topic.
-
durability
¶ dds.qos.DurabilityQosPolicy
– The durability policy requested by the DataWriter.
-
durability_service
¶ dds.qos.DurabilityServiceQosPolicy
– The durability service configuration offered by the DataWriter.
-
deadline
¶ dds.qos.DeadlineQosPolicy
– The requested update frequency for data instances.
-
latency_budget
¶ dds.qos.LatencyBudgetQosPolicy
– The latency requested by the DataWriter.
-
liveliness
¶ dds.qos.LivelinessQosPolicy
– The liveliness mechanism requested by the DataWriter.
-
reliability
¶ dds.qos.ReliabilityQosPolicy
– The transport reliability requested by the DataWriter.
-
destination_order
¶ dds.qos.DestinationOrderQosPolicy
– The destination order logic requested by the DataWriter.
-
history
¶ dds.qos.HistoryQosPolicy
– The data history requested by the DataWriter.
-
resource_limits
¶ dds.qos.ResourceLimitsQosPolicy
– The resource limits set on the DataWriter.
-
transport_priority
¶ dds.qos.TransportPriorityQosPolicy
– The transport priority supported by the DataWriter.
-
lifespan
¶ dds.qos.LifespanQosPolicy
– The expiration time for old samples managed by the DataWriter.
-
ownership
¶ dds.qos.OwnershipQosPolicy
– The type of ‘ownership’ offered by the DataWriter.
-
representation
¶ dds.qos.DataRepresentationQosPolicy
– Informs DataReaders(s) of the data representation(s) provided by this Writer. This must be consistent with the TypeSupport associated with the Writer’s Topic.
-
entity_name
¶ dds.qos.EntityNameQosPolicy
– entity name
-
logging
¶ dds.qos.LoggingQosPolicy
– logging
-