|
virtual DDS_ReturnCode_t | get_liveliness_lost_status (DDS_LivelinessLostStatus &status) |
| Accesses the DDS_LIVELINESS_LOST_STATUS communication status. More...
|
|
virtual DDS_ReturnCode_t | get_offered_deadline_missed_status (DDS_OfferedDeadlineMissedStatus &status) |
| Accesses the DDS_OFFERED_DEADLINE_MISSED_STATUS communication status. More...
|
|
virtual DDS_ReturnCode_t | get_offered_incompatible_qos_status (DDS_OfferedIncompatibleQosStatus &status) |
| Accesses the DDS_OFFERED_INCOMPATIBLE_QOS_STATUS communication status. More...
|
|
virtual DDS_ReturnCode_t | get_publication_matched_status (DDS_PublicationMatchedStatus &status) |
| Accesses the DDS_PUBLICATION_MATCHED_STATUS communication status. More...
|
|
virtual DDS_ReturnCode_t | get_reliable_writer_cache_changed_status (DDS_ReliableWriterCacheChangedStatus &status) |
| <<extension>> Get the reliable cache status for this writer. More...
|
|
virtual DDS_ReturnCode_t | get_reliable_reader_activity_changed_status (DDS_ReliableReaderActivityChangedStatus &status) |
| <<extension>> Get the reliable reader activity changed status for this writer. More...
|
|
virtual DDS_ReturnCode_t | get_datawriter_cache_status (DDS_DataWriterCacheStatus &status) |
| <<extension>> Get the datawriter cache status for this writer. More...
|
|
virtual DDS_ReturnCode_t | get_datawriter_protocol_status (DDS_DataWriterProtocolStatus &status) |
| <<extension>> Get the datawriter protocol status for this writer. More...
|
|
virtual DDS_ReturnCode_t | get_matched_subscription_datawriter_protocol_status (DDS_DataWriterProtocolStatus &status, const DDS_InstanceHandle_t &subscription_handle) |
| <<extension>> Get the datawriter protocol status for this writer, per matched subscription identified by the subscription_handle. More...
|
|
virtual DDS_ReturnCode_t | is_matched_subscription_active (DDS_Boolean &is_active, const DDS_InstanceHandle_t &subscription_handle) |
| Check if a subscription currently matched with a DataWriter is active. More...
|
|
virtual DDS_ReturnCode_t | get_service_request_accepted_status (DDS_ServiceRequestAcceptedStatus &status) |
| Accesses the DDS_SERVICE_REQUEST_ACCEPTED_STATUS communication status. More...
|
|
virtual DDS_ReturnCode_t | get_matched_subscription_datawriter_protocol_status_by_locator (DDS_DataWriterProtocolStatus &status, const DDS_Locator_t &locator) |
| <<extension>> Get the datawriter protocol status for this writer, per matched subscription identified by the locator. More...
|
|
virtual DDS_ReturnCode_t | assert_liveliness () |
| This operation manually asserts the liveliness of this DDSDataWriter. More...
|
|
virtual DDS_ReturnCode_t | get_matched_subscription_locators (DDS_LocatorSeq &locators) |
| <<extension>> Retrieve the list of locators for subscriptions currently "associated" with this DDSDataWriter. More...
|
|
virtual DDS_ReturnCode_t | get_matched_subscriptions (DDS_InstanceHandleSeq &subscription_handles) |
| Retrieve the list of subscriptions currently "associated" with this DDSDataWriter. More...
|
|
virtual DDS_ReturnCode_t | get_matched_subscription_data (DDS_SubscriptionBuiltinTopicData &subscription_data, const DDS_InstanceHandle_t &subscription_handle) |
| This operation retrieves the information on a subscription that is currently "associated" with the DDSDataWriter. More...
|
|
virtual DDS_ReturnCode_t | get_matched_subscription_participant_data (DDS_ParticipantBuiltinTopicData &participant_data, const DDS_InstanceHandle_t &subscription_handle) |
| This operation retrieves the information on the discovered DDSDomainParticipant associated with the subscription that is currently matching with the DDSDataWriter. More...
|
|
virtual DDSTopic * | get_topic () |
| This operation returns the DDSTopic associated with the DDSDataWriter. More...
|
|
virtual DDSPublisher * | get_publisher () |
| This operation returns the DDSPublisher to which the DDSDataWriter belongs. More...
|
|
virtual DDS_ReturnCode_t | wait_for_acknowledgments (const DDS_Duration_t &max_wait) |
| Blocks the calling thread until all data written by reliable DDSDataWriter entity is acknowledged, or until timeout expires. More...
|
|
virtual DDS_ReturnCode_t | is_sample_app_acknowledged (DDS_Boolean &is_app_ack, const struct DDS_SampleIdentity_t &identity) |
| This method can be used to see if a sample has been application acknowledged. More...
|
|
virtual DDS_ReturnCode_t | wait_for_asynchronous_publishing (const DDS_Duration_t &max_wait) |
| <<extension>> Blocks the calling thread until asynchronous sending is complete. More...
|
|
virtual DDS_ReturnCode_t | set_qos (const DDS_DataWriterQos &qos) |
| Sets the writer QoS. More...
|
|
virtual DDS_ReturnCode_t | set_property (const char *property_name, const char *value, bool propagate) |
| Set the value for a property that applies to a DataWriter. More...
|
|
virtual DDS_ReturnCode_t | set_qos_with_profile (const char *library_name, const char *profile_name) |
| <<extension>> Change the QoS of this writer using the input XML QoS profile. More...
|
|
virtual DDS_ReturnCode_t | get_qos (DDS_DataWriterQos &qos) |
| Gets the writer QoS. More...
|
|
virtual DDS_ReturnCode_t | set_listener (DDSDataWriterListener *l, DDS_StatusMask mask=DDS_STATUS_MASK_ALL) |
| Sets the writer listener. More...
|
|
virtual DDSDataWriterListener * | get_listener () |
| Get the writer listener. More...
|
|
virtual DDS_ReturnCode_t | flush () |
| <<extension>> Flushes the batch in progress in the context of the calling thread. More...
|
|
virtual DDS_ReturnCode_t | take_discovery_snapshot () |
| Take a snapshot of the compatible and incompatible remote readers matched by a local writer. More...
|
|
virtual DDS_ReturnCode_t | take_discovery_snapshot (const char *file_name) |
| Take a snapshot of the compatible and incompatible remote readers matched by a local writer. More...
|
|
virtual DDS_ReturnCode_t | enable () |
| Enables the DDSEntity. More...
|
|
virtual DDSStatusCondition * | get_statuscondition () |
| Allows access to the DDSStatusCondition associated with the DDSEntity. More...
|
|
virtual DDS_StatusMask | get_status_changes () |
| Retrieves the list of communication statuses in the DDSEntity that are triggered. More...
|
|
virtual DDS_InstanceHandle_t | get_instance_handle () |
| Allows access to the DDS_InstanceHandle_t associated with the DDSEntity. More...
|
|
virtual DDS_ReturnCode_t | enable ()=0 |
| Enables the DDSEntity. More...
|
|
virtual DDSStatusCondition * | get_statuscondition ()=0 |
| Allows access to the DDSStatusCondition associated with the DDSEntity. More...
|
|
virtual DDS_StatusMask | get_status_changes ()=0 |
| Retrieves the list of communication statuses in the DDSEntity that are triggered. More...
|
|
virtual DDS_InstanceHandle_t | get_instance_handle ()=0 |
| Allows access to the DDS_InstanceHandle_t associated with the DDSEntity. More...
|
|
<<interface>> Allows an application to set the value of the data to be published under a given DDSTopic.
- QoS:
- DDS_DataWriterQos
- Status:
- DDS_LIVELINESS_LOST_STATUS, DDS_LivelinessLostStatus;
DDS_OFFERED_DEADLINE_MISSED_STATUS, DDS_OfferedDeadlineMissedStatus;
DDS_OFFERED_INCOMPATIBLE_QOS_STATUS, DDS_OfferedIncompatibleQosStatus;
DDS_PUBLICATION_MATCHED_STATUS, DDS_PublicationMatchedStatus;
DDS_RELIABLE_READER_ACTIVITY_CHANGED_STATUS, DDS_ReliableReaderActivityChangedStatus;
DDS_RELIABLE_WRITER_CACHE_CHANGED_STATUS, DDS_ReliableWriterCacheChangedStatus.
- Listener:
- DDSDataWriterListener
A DDSDataWriter is attached to exactly one DDSPublisher, that acts as a factory for it.
A DDSDataWriter is bound to exactly one DDSTopic and therefore to exactly one data type. The DDSTopic must exist prior to the DDSDataWriter's creation.
DDSDataWriter is an abstract class. It must be specialized for each particular application data-type (see USER_DATA). The additional methods or functions that must be defined in the auto-generated class for a hypothetical application type Foo
are specified in the example type DDSDataWriter.
The following operations may be called even if the DDSDataWriter is not enabled. Other operations will fail with DDS_RETCODE_NOT_ENABLED if called on a disabled DDSDataWriter:
- The base-class operations DDSDataWriter::set_qos, DDSDataWriter::get_qos, DDSDataWriter::set_listener, DDSDataWriter::get_listener, DDSEntity::enable, DDSEntity::get_statuscondition and DDSEntity::get_status_changes
- DDSDataWriter::get_liveliness_lost_status, DDSDataWriter::get_offered_deadline_missed_status, DDSDataWriter::get_offered_incompatible_qos_status, DDSDataWriter::get_publication_matched_status, DDSDataWriter::get_reliable_writer_cache_changed_status, DDSDataWriter::get_reliable_reader_activity_changed_status DDSDataWriter::get_service_request_accepted_status
Several DDSDataWriter may operate in different threads. If they share the same DDSPublisher, the middleware guarantees that its operations are thread-safe.
- See also
- FooDataWriter
-
Operations Allowed in Listener Callbacks
- Examples
- HelloWorldSupport.cxx, and HelloWorld_publisher.cxx.
Retrieve the list of subscriptions currently "associated" with this DDSDataWriter.
A subscription is considered to be matching if all of the following criteria are true:
- The subscription is within the same domain as this publication.
- The subscription has a matching DDSTopic.
- The subscription has compatible QoS.
- If the applications are using partitions, the subscription shares a common partition with this publication.
- The DDSDomainParticipant has not indicated that the subscription's DDSDomainParticipant should be "ignored" by means of the DDSDomainParticipant::ignore_publication API.
- If the publication is using the DDS_MultiChannelQosPolicy and the subscription is using a DDSContentFilteredTopic, there is an intersection between at least one of the associated filters.
- If the endpoints need to exchange key material to communicate (i.e., they are securing their communications), the writer has completed the key exchange with reader.
The handles returned in the subscription_handles
list are the ones that RTI Connext uses to locally identify the corresponding matched DDSDataReader entities. These handles match the ones that appear in the DDS_SampleInfo::instance_handle field of the DDS_SampleInfo when reading the DDS_SUBSCRIPTION_TOPIC_NAME builtin topic.
This API may return the subscription handles of subscriptions that are inactive. DDSDataWriter::is_matched_subscription_active can be used to check this.
- Parameters
-
subscription_handles | <<inout>>. The handles of all the matched subscriptions. |
The sequence will be grown if the sequence has ownership and the system has the corresponding resources. Use a sequence without ownership to avoid dynamic memory allocation. If the sequence is too small to store all of the matches and the system cannot resize the sequence, this method will fail with DDS_RETCODE_OUT_OF_RESOURCES.
The maximum number of matches possible is configured with DDS_DomainParticipantResourceLimitsQosPolicy. You can use a zero-maximum sequence without ownership to quickly check whether there are any matches without allocating any memory. .
- Exceptions
-
This operation retrieves the information on a subscription that is currently "associated" with the DDSDataWriter.
The subscription_handle
must correspond to a subscription currently associated with the DDSDataWriter. Otherwise, the operation will fail and fail with DDS_RETCODE_BAD_PARAMETER. Use DDSDataWriter::get_matched_subscriptions to find the subscriptions that are currently matched with the DDSDataWriter.
The above information is also available through DDSDataReaderListener::on_data_available() (if a reader listener is installed on the DDSSubscriptionBuiltinTopicDataDataReader).
When the subscription data is updated, for example when the content filter property changes, there is a small window of time in between when the DataWriter is made aware of these changes and when they actually take effect. Taking effect in this example means that the DataWriter will perform writer-side filtering using the new filter property values (filter expression and/or parameters).
When the DataWriter is made aware of the changes they will first be seen in the DDSDataReaderListener::on_data_available() of the DDSSubscriptionBuiltinTopicDataDataReader. When these changes are applied, they will be seen in the output of this API because this API blocks until the most recent changes known to the DataWriter have taken effect. This API will only block when called outside of a listener callback, in order to not block the internal threads from making progress.
If application behavior depends on being made aware of information about a subscription only after it has taken effect on the DataWriter, the recommended pattern for usage of this API is to wait for subscription data to be received either through polling this API or by installing a listener on the DDSSubscriptionBuiltinTopicDataDataReader. When a new sample is received by the builtin DataReader, this API may be called in a separate thread and will return the expected matched subscription data once it has been applied to the DataWriter.
Because this API blocks, it is possible for this API to time out while waiting for the changes to be applied. A timeout may happen if the DataReader's subscription data is changing rapidly, preventing the DataWriter from returning valid information before newer data has been received, or if an application is performing a task in a listener callback, thereby preventing the middleware's threads from executing events in a timely manner.
Note: This operation does not retrieve the DDS_SubscriptionBuiltinTopicData::type_code. This information is available through DDSDataReaderListener::on_data_available() (if a reader listener is installed on the DDSSubscriptionBuiltinTopicDataDataReader).
- Parameters
-
subscription_data | <<inout>>. The information to be filled in on the associated subscription. Cannot be NULL. |
subscription_handle | <<in>>. Handle to a specific subscription associated with the DDSDataReader. Must correspond to a subscription currently associated with the DDSDataWriter. |
- Exceptions
-
Blocks the calling thread until all data written by reliable DDSDataWriter entity is acknowledged, or until timeout expires.
This operation blocks the calling thread until either all data written by the reliable DDSDataWriter entity is acknowledged by (a) all reliable DDSDataReader entities that are matched and alive and (b) by all required subscriptions, or until the duration specified by the max_wait
parameter elapses, whichever happens first. A successful completion indicates that all the samples written have been acknowledged by all reliable matched data readers and by all required subscriptions; a timeout indicates that max_wait elapsed before all the data was acknowledged.
Note that if a thread is blocked in the call to wait_for_acknowledgments on a DataWriter and a different thread writes new samples on the same DataWriter, the new samples must be acknowledged before unblocking the thread waiting on wait_for_acknowledgments.
If the DDSDataWriter does not have DDS_ReliabilityQosPolicy kind set to RELIABLE, this operation will complete immediately with DDS_RETCODE_OK
- Parameters
-
- Exceptions
-
Enables the DDSEntity.
This operation enables the Entity. Entity objects can be created either enabled or disabled. This is controlled by the value of the ENTITY_FACTORY QoS policy on the corresponding factory for the DDSEntity.
By default, ENTITY_FACTORY is set so that it is not necessary to explicitly call DDSEntity::enable on newly created entities.
The DDSEntity::enable operation is idempotent. Calling enable on an already enabled Entity returns OK and has no effect.
If a DDSEntity has not yet been enabled, the following kinds of operations may be invoked on it:
Other operations may explicitly state that they may be called on disabled entities; those that do not will return the error DDS_RETCODE_NOT_ENABLED.
It is legal to delete an DDSEntity that has not been enabled by calling the proper operation on its factory .
Entities created from a factory Entity that is disabled are created disabled, regardless of the setting of the DDS_EntityFactoryQosPolicy.
Calling enable on an Entity whose factory Entity is not enabled will fail and return DDS_RETCODE_PRECONDITION_NOT_MET.
If DDS_EntityFactoryQosPolicy::autoenable_created_entities is TRUE, the enable operation on a factory will automatically enable all entities created from that factory (for example, enabling a DDSPublisher will enable all its contained DDSDataWriter objects)
Listeners associated with an entity are not called until the entity is enabled.
Conditions associated with a disabled entity are "inactive," that is, they have a trigger_value
== FALSE.
- Exceptions
-
Implements DDSEntity.
Retrieves the list of communication statuses in the DDSEntity that are triggered.
That is, the list of statuses whose value has changed since the last time the application read the status using the get_*_status() method.
When the entity is first created or if the entity is not enabled, all communication statuses are in the "untriggered" state so the list returned by the get_status_changes operation will be empty.
The list of statuses returned by the get_status_changes operation refers to the status that are triggered on the Entity itself and does not include statuses that apply to contained entities.
- Returns
- list of communication statuses in the DDSEntity that are triggered.
- See also
- Status Kinds
Implements DDSEntity.