Module: dds.domain

class dds.domain.DomainParticipant

Bases: object

DomainParticipant is the primary DDS domain entity

add_transport()

Adds the provided transport to the DomainParticipant.

The transport is registered with the DomainParticipant, and will be used for communication. If no transports are manually added, then the DomainParticipant will automatically add the default UDP transport.

The DomainParticipant takes ownership of the provided transport; when the DomainParticipant is deleted, it will release the resources of all added transports.

NOTE: Transports can be installed only before a DomainParticipant is enabled.

assert_liveliness()

This operation manually asserts the liveliness of the DomainParticipant. This operation indicates that the DomainParticipant is still alive. It is effective only if the DomainParticipant contains on or more DataWriter objects with Liveliness QoS set to MANUAL_BY_PARTICIPANT. In this case, the operation will assert the liveliness of those particular DataWriter objects.

NOTE: Writing data via the DataWriter  write operation implicitly asserts the liveliness of the DataWriter and its containing DomainParticipant. Therefore, the use of DomainParticipant.assert_liveliness() is needed only if the application is not writing data frequently enough to keep the DataWriter considered ‘alive’.

builtin_wait_for_acknowledgments()

Ensure that local discovery information has been received by all known peers.

Parameters:max_time (dds.core.Duration) – the amount of time the participant can wait
delete()

Destroys the DomainParticipant and cleans up all internal resources. This performs a ‘delete_contained_entities()’ and then destroys the Participant.

delete_contained_entities()

This operation deletes all the objects created by this DomainParticipant. This routine will recursively call the corresponding delete_contained_entities() operation on each of the contained objects (Publishers, Subscribers, Topics, ContentFilteredTopics, and MultiTopics). If successful, this operation will recursively delete all objects contained with this DomainParticipant. After successful execution, the application may delete the DomainParticipant by calling DomainParticipantFactory_delete_participant().

If any of the objects cannot be deleted, this routine will raise PreconditionNotMet.

do_work()

Transfer control to the DomainParticipant so it can do background processing. This function is to be called only if the DomainParticipant is configured to use NO threads via the thread_model QoS policy. The participant will continue to execute background processing until at least ‘time_slice’ time passes. This routine will attempt to use no more than ‘time_slice’ time, but this is not a guarantee. Note: If the DomainParticipant has threads (default case), then the Participant takes care of scheduling background work on its own, and this routine is not necessary and should not be called.

Parameters:timeslice (dds.core.Duration) – the amount of time the participant can spend doing work
enable()

Enables the DomainParticipant. A DomainParticipant is created either enabled or not based on the DomainParticipantFactoryQoS setting ‘entity_factory’. When a DomainPartcipant is not enabled, only the following sub-set of all DomainParticipant operations are legal:

  • operations to get and set QoS policies,
  • factory operations (create, delete),
  • get_statuscondition(),
  • get_status_changes(),
  • lookup operations

Any other DomainParticipant operation will return the DDS_NOT_ENABLED error. DDS_DomainParticipant_enable() may be called on an already enabled DomainParticipant [it will have no effect].

Raises Error if no transports initialize successfully. Raises BadParameter if a None ‘dp’ value is passed in.

get_current_time()

Returns a dds.core.Time object representing the current time as known by the Participant.

get_default_publisher_qos()

Returns the current default PublisherQos settings held in the factory. Note: the returned object is a copy, and subsequent changes will not be reflected.

Returns: (dds.pub.PublisherQos): the currently stored qos values

get_default_subscriber_qos()

Returns the current default SubscriberQos settings held in the factory. Note: the returned object is a copy, and subsequent changes will not be reflected.

Returns: (dds.sub.SubscriberQos): the currently stored qos values

get_default_topic_qos()

Returns the current default TopicQos settings held in the factory. Note: the returned object is a copy, and subsequent changes will not be reflected.

Returns: (dds.topic.TopicQos): the currently stored qos values

get_discovered_participant_data()

This operation returns data that describes a particular discovered participant identified by ‘handle’.

An appropriate handle can be obtained through a call to DomainParticipant.get_discovered_participants().

If ‘handle’ does not identify a known DomainParticipant, this routine will raise dds.core.PreconditionNotMet.

get_discovered_participants()

This operation returns the list of handles identifying the DomainParticipants that have been discovered.

The returned list will include only participants which are in the same domain as the participant, and which are not explicitly ignored.

Returns: list of InstanceHandles

get_discovered_publication_data()

This operation returns data that describes a particular known DataWriter identified by ‘handle’.

An appropriate handle can be obtained through a call to dds.sub.DataReader.get_matched_publications().

If ‘handle’ does not identify a known DataWriter, this routine will raise dds.core.PreconditionNotMet.

get_discovered_subscription_data()

This operation returns data that describes a particular known DataReader identified by ‘handle’.

An appropriate handle can be obtained through a call to dds.pub.DataWriter.get_matched_subscriptions().

If ‘handle’ does not identify a known DataReader, this routine will raise dds.core.PreconditionNotMet.

get_discovered_topic_data()

This operation returns data that describes a particular discovered topic identified by ‘handle’.

An appropriate handle can be obtained through a call to DomainParticipant.get_discovered_topics().

If handle does not identify a known Topic, this routine will raise dds.core.PreconditionNotMet

get_discovered_topics()

Unsupported This operation returns the list of handles identifying the Topic objects that have been discovered.

The returned list will include only topics which are in the same domain as the participant, and which are not explicitly ignored as a result of a call to DomainParticipant.ignore_topic().

get_domain_id()

Returns the DomainId (int) of the domain to which the Participant belongs.

get_guid()

Returns the 16 byte GUID (dds.core.GUID) that identifies this Participant within its domain.

get_instance_handle()

This operation returns the InstanceHandle_t that identifies the DomainParticipant.

get_listener()

Returns the currently installed DomainParticipantListener or None

get_qos()

Returns the current DomainParticipantQos settings

get_status_changes()

This returns the list of  triggered communication statuses in the DomainParticipant.

If the DomainParticipant 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 Participant itself and does not include statuses from contained entities.

get_statuscondition()

This operation allows access to the StatusCondition associated with the DomainParticipant. The returned condition can be added to a WaitSet.

ignore_participant()

Instructs the DomainParticipant to ignore the external DomainParticipant identified by handle.

This will cause the infrastructure to behave as if the external participant handle did not exist. The handle can be discovered by accessing the built-in topic DCPSParticipant via the appropriate built-in DataReader.

There is no mechanism to reverse this operation.

is_enabled()

Returns True if the participant is currently enabled; False otherwise.

set_default_publisher_qos()

Sets the default PublisherQos held in the DomainParticipant. This default qos will be used during subsequent calls to create a Publisher if the special ‘None’ value is provided for the publisher qos. This routine may fail if the provided qos argument is not internally consistent. In this case, InconsistentPolicy will be raised, and no changes will be made to the DomainParticipant.

Parameters:qos (dds.pub.PublisherQos) – the qos values to store
set_default_subscriber_qos()

Sets the default SubscriberQos held in the DomainParticipant. This default qos will be used during subsequent calls to create a Subscriber if the special ‘None’ value is provided for the subscriber qos. This routine may fail if the provided qos argument is not internally consistent. In this case, InconsistentPolicy will be raised, and no changes will be made to the DomainParticipant.

Parameters:qos (dds.sub.SubscriberQos) – the qos values to store
set_default_topic_qos()

Sets the default TopicQos held in the DomainParticipant. This default qos will be used during subsequent calls to create a Topic if the special ‘None’ value is provided for the topic qos. This routine may fail if the provided qos argument is not internally consistent. In this case, InconsistentPolicy will be raised, and no changes will be made to the DomainParticipant.

Parameters:qos (dds.topic.TopicQos) – the qos values to store
set_listener()

This operation installs a DomainParticipantListener on the DomainParticipant. Only one listener may be attached to a DomainParticipant at a time. A call to set_listener() will replace any current listener with the provided listener. <p> a_listener can be ‘None’, which indicates a listener that does nothing.

Parameters:
set_qos()

Sets the DomainParticipantQoS values on this Participant. These QoS values affect the behavior of this DomainParticipant.

Parameters:qos (dds.domain.DomainParticipantQos) – QoS policy values to set in the Participant
class dds.domain.DomainParticipantFactory

Bases: object

DomainParticipantFactory is used to configure the creation of DomainParticipant instances

static get_default_participant_qos()

Provides access to the default Participant qos held in the factory. The returned qos object is populated with the current default qos settings.

static get_qos()

Returns the current DomainParticipantFactoryQos settings

static lookup_participant()

Returns a previously created DomainParticipant belonging to the specified domain_id. If there are multiple DomainParticipants in existence within the specified domain, one of them will be returned.

static set_default_participant_qos()

Sets the default DomainParticipantQos held in the factory. This provided qos will be used during subsequent calls to create a DomainParticipant, if the special ‘None’ value is provided for the qos in those calls. This routine may fail if the provided  qos argument is not internally consistent. this case, INCONSISTENT_POLICY will be raised, and no changes will be made to the DomainParticipantFactory.

static set_license()

Configure the license. Either a filename or an in-line license string.

static set_license_debug()

Turn on debuging of the license processing.

static set_qos()

Sets the DomainParticipantFactory QoS values. These QoS values affect the behavior of the factory.

class dds.domain.DomainParticipantFactoryQos

DomainParticipantFactoryQos holds QoS policies relevant for a DomainParticipantFactory

entity_factory

dds.qos.EntityFactoryQosPolicy

class dds.domain.DomainParticipantListener

Bases: object

DomainParticipantListener holds a set of callbacks that can be invoked by a DomainParticipant

on_data_available()

Invoked when the ‘data_available’ status is triggered on any contained DataReader

Parameters:reader (dds.sub.DataReader) – the DataReader of concern
on_data_on_readers()

Invoked when the ‘data_on_readers’ status is triggered on the Subscriber

Parameters:subscriber (dds.sub.Subscriber) – the subscriber of concern
on_inconsistent_topic()

Invoked when the ‘inconsistent_topic’ status is triggered on the Topic

Parameters:
on_liveliness_changed()

Invoked when the ‘liveliness_changed’ status is triggered on any contained DataReader

Parameters:
on_liveliness_lost()

Invoked when the ‘liveliness_lost’ status is triggered on any contained DataWriter

Parameters:
on_offered_deadline_missed()

Invoked when the ‘offered_deadline_missed’ status is triggered on any contained DataWriter

Parameters:
on_offered_incompatible_qos()

Invoked when the ‘offered_incompatible_qos’ status is triggered on any contained DataWriter

Parameters:
on_publication_matched()

Invoked when the ‘publication_matched’ status is triggered on any contained DataWriter

Parameters:
on_requested_deadline_missed()

Invoked when the ‘requested_deadline_missed’ status is triggered on any contained DataReader

Parameters:
on_requested_incompatible_qos()

Invoked when the ‘requested_incompatible_qos’ status is triggered on any contained DataReader

Parameters:
on_sample_lost()

Invoked when the ‘sample_lost’ status is triggered on any contained DataReader

Parameters:
on_sample_rejected()

Invoked when the ‘sample_rejected’ status is triggered on any contained DataReader

Parameters:
on_subscription_matched()

Invoked when the ‘subscription_matched’ status is triggered on any contained DataReader

Parameters:
class dds.domain.DomainParticipantQos

DomainParticipantQos holds QoS policies relevant for a DomainParticipant

user_data

dds.qos.UserDataQosPolicy

entity_factory

dds.qos.EntityFactoryQosPolicy

entity_name

dds.qos.EntityNameQosPolicy

logging

dds.qos.LoggingQosPolicy

peer_participants

dds.qos.PeerParticipantsQosPolicy

discovery

dds.qos.DiscoveryQosPolicy

thread_model

dds.qos.ThreadModelQosPolicy

properties

dds.qos.PropertyQosPolicy