RTI Connext Traditional C++ API
Version 6.1.0
|
<<interface>> Allows an application to set the value of the data to be published under a given DDSTopic. More...
Public Member Functions | |
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_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 | 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... | |
<<interface>> Allows an application to set the value of the data to be published under a given DDSTopic.
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:
Several DDSDataWriter may operate in different threads. If they share the same DDSPublisher, the middleware guarantees that its operations are thread-safe.
|
inlinevirtual |
Accesses the DDS_LIVELINESS_LOST_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_LivelinessLostStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_OFFERED_DEADLINE_MISSED_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_OfferedDeadlineMissedStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_OFFERED_INCOMPATIBLE_QOS_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_OfferedIncompatibleQosStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_PUBLICATION_MATCHED_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_PublicationMatchedStatus to be filled in. |
|
inlinevirtual |
<<extension>> Get the reliable cache status for this writer.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_ReliableWriterCacheChangedStatus to be filled in. |
|
inlinevirtual |
<<extension>> Get the reliable reader activity changed status for this writer.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_ReliableReaderActivityChangedStatus to be filled in. |
|
inlinevirtual |
<<extension>> Get the datawriter cache status for this writer.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_DataWriterCacheStatus to be filled in. |
|
inlinevirtual |
<<extension>> Get the datawriter protocol status for this writer.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_DataWriterProtocolStatus to be filled in. |
|
inlinevirtual |
<<extension>> Get the datawriter protocol status for this writer, per matched subscription identified by the subscription_handle.
This also resets the status so that it is no longer considered changed.
Note: Status for a remote entity is only kept while the entity is alive. Once a remote entity is no longer alive, its status is deleted.
status | <<inout>> DDS_DataWriterProtocolStatus to be filled in. |
subscription_handle | <<in>> Handle to a specific subscription associated with the DDSDataReader. Must correspond to a subscription currently associated with the DDSDataWriter. |
|
inlinevirtual |
Check if a subscription currently matched with a DataWriter is active.
This API is used for querying the endpoint liveliness of a matched subscription. A matched subscription will be marked as inactive when it becomes nonprogessing (e.g., not responding to a DataWriter's heartbeats, or letting its internal queue fill up without taking the available data). Note that if the participant associated with the matched subscription loses liveliness, the DDS_InstanceHandle_t will become invalid and this function will fail with DDS_RETCODE_BAD_PARAMETER.
subscription_handle | <<in>> The DDS_InstanceHandle_t of the matched subscription. See DDSDataWriter::get_matched_subscriptions for a description of what is considered a matched subscription. |
is_active | <<out>> Indicates whether or not the matched subscription is active. |
|
inlinevirtual |
Accesses the DDS_SERVICE_REQUEST_ACCEPTED_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_ServiceRequestAcceptedStatus to be filled in. |
|
inlinevirtual |
<<extension>> Get the datawriter protocol status for this writer, per matched subscription identified by the locator.
This also resets the status so that it is no longer considered changed.
Note: Status for a remote entity is only kept while the entity is alive. Once a remote entity is no longer alive, its status is deleted.
status | <<inout>> DDS_DataWriterProtocolStatus to be filled in |
locator | <<in>> Locator to a specific locator associated with the DDSDataReader. Must correspond to a locator of one or more subscriptions currently associated with the DDSDataWriter. |
|
inlinevirtual |
This operation manually asserts the liveliness of this DDSDataWriter.
This is used in combination with the LIVELINESS policy to indicate to RTI Connext that the DDSDataWriter remains active.
You only need to use this operation if the LIVELINESS setting is either DDS_MANUAL_BY_PARTICIPANT_LIVELINESS_QOS or DDS_MANUAL_BY_TOPIC_LIVELINESS_QOS. Otherwise, it has no effect.
Note: writing data via the FooDataWriter::write or FooDataWriter::write_w_timestamp operation asserts liveliness on the DDSDataWriter itself, and its DDSDomainParticipant. Consequently the use of assert_liveliness() is only needed if the application is not writing data regularly.
|
inlinevirtual |
<<extension>> Retrieve the list of locators for subscriptions currently "associated" with this DDSDataWriter.
The locators returned in the locators
list are the ones that are used by the DDS implementation to communicate with the corresponding matched DDSDataReader entities.
locators | <<inout>>. Handles of all the matched subscription locators. |
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 the matches and the system can not resize the sequence, this method will fail with DDS_RETCODE_OUT_OF_RESOURCES..
|
inlinevirtual |
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 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.
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. .
|
inlinevirtual |
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).
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. |
|
inlinevirtual |
This operation retrieves the information on the discovered DDSDomainParticipant associated with the subscription that is currently matching with the DDSDataWriter.
The subscription_handle
must correspond to a subscription currently associated with the DDSDataWriter. Otherwise, the operation will fail with DDS_RETCODE_BAD_PARAMETER. The operation may also fail with DDS_RETCODE_PRECONDITION_NOT_MET if the subscription corresponds to the same DDSDomainParticipant that the DataWriter belongs to. Use DDSDataWriter::get_matched_subscriptions to find the subscriptions that are currently matched with the DDSDataWriter.
participant_data | <<inout>>. The information to be filled in on the associated participant 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. |
|
inlinevirtual |
This operation returns the DDSTopic associated with the DDSDataWriter.
This is the same DDSTopic that was used to create the DDSDataWriter.
|
inlinevirtual |
This operation returns the DDSPublisher to which the DDSDataWriter belongs.
|
inlinevirtual |
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
max_wait | <<in>> Specifies maximum time to wait for acknowledgements DDS_Duration_t . |
|
inlinevirtual |
This method can be used to see if a sample has been application acknowledged.
This method can be used to see if a sample has been application acknowledged by all the matching DataReaders that were alive when the sample was written.
If a DataReader does not enable application acknowledgment (by setting DDS_ReliabilityQosPolicy::acknowledgment_kind to a value other than DDS_PROTOCOL_ACKNOWLEDGMENT_MODE), the sample is considered application acknowledged for that DataReader.
is_app_ack | <<out>> This value will be set to DDS_BOOLEAN_TRUE when the sample has been acknowledged. |
identity | <<in>> Sample identity. |
|
inlinevirtual |
<<extension>> Blocks the calling thread until asynchronous sending is complete.
This operation blocks the calling thread (up to max_wait
) until all data written by the asynchronous DDSDataWriter is sent and acknowledged (if reliable) by all matched DDSDataReader entities. A successful completion indicates that all the samples written have been sent and acknowledged where applicable; a time out indicates that max_wait
elapsed before all the data was sent and/or acknowledged.
In other words, this guarantees that sending to best effort DDSDataReader is complete in addition to what DDSDataWriter::wait_for_acknowledgments provides.
If the DDSDataWriter does not have DDS_PublishModeQosPolicy kind set to DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS the operation will complete immediately with DDS_RETCODE_OK.
max_wait | <<in>> Specifies maximum time to wait for acknowledgements DDS_Duration_t . |
|
inlinevirtual |
Sets the writer QoS.
This operation modifies the QoS of the DDSDataWriter.
The DDS_DataWriterQos::user_data, DDS_DataWriterQos::deadline, DDS_DataWriterQos::latency_budget, DDS_DataWriterQos::ownership_strength, DDS_DataWriterQos::transport_priority, DDS_DataWriterQos::lifespan and DDS_DataWriterQos::writer_data_lifecycle can be changed. The other policies are immutable.
qos | <<in>> The DDS_DataWriterQos to be set to. Policies must be consistent. Immutable policies cannot be changed after DDSDataWriter is enabled. The special value DDS_DATAWRITER_QOS_DEFAULT can be used to indicate that the QoS of the DDSDataWriter should be changed to match the current default DDS_DataWriterQos set in the DDSPublisher. |
|
inlinevirtual |
<<extension>> Change the QoS of this writer using the input XML QoS profile.
This operation modifies the QoS of the DDSDataWriter.
The DDS_DataWriterQos::user_data, DDS_DataWriterQos::deadline, DDS_DataWriterQos::latency_budget, DDS_DataWriterQos::ownership_strength, DDS_DataWriterQos::transport_priority, DDS_DataWriterQos::lifespan and DDS_DataWriterQos::writer_data_lifecycle can be changed. The other policies are immutable.
library_name | <<in>> Library name containing the XML QoS profile. If library_name is null RTI Connext will use the default library (see DDSPublisher::set_default_library). |
profile_name | <<in>> XML QoS Profile name. If profile_name is null RTI Connext will use the default profile (see DDSPublisher::set_default_profile). |
|
inlinevirtual |
Gets the writer QoS.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
qos | <<inout>> The DDS_DataWriterQos to be filled up. |
|
inlinevirtual |
Sets the writer listener.
l | <<in>> DDSDataWriterListener to set to |
mask | <<in>> DDS_StatusMask associated with the DDSDataWriterListener. |
|
inlinevirtual |
Get the writer listener.
|
inlinevirtual |
<<extension>> Flushes the batch in progress in the context of the calling thread.
After being flushed, the batch is available to be sent on the network.
If the DDSDataWriter does not have DDS_PublishModeQosPolicy kind set to DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS, the batch will be sent on the network immediately (in the context of the calling thread).
If the DDSDataWriter does have DDS_PublishModeQosPolicy kind set to DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS, the batch will be sent in the context of the asynchronous publishing thread.
This operation may block in the same conditions as FooDataWriter::write.
If this operation does block, the RELIABILITY max_blocking_time configures the maximum time the write operation may block (waiting for space to become available). If max_blocking_time elapses before the DDS_DataWriter is able to store the modification without exceeding the limits, the operation will fail with DDS_RETCODE_TIMEOUT.
|
inlinevirtual |
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.
Implements DDSEntity.
|
inlinevirtual |
Allows access to the DDSStatusCondition associated with the DDSEntity.
The returned condition can then be added to a DDSWaitSet so that the application can wait for specific status changes that affect the DDSEntity.
Implements DDSEntity.
|
inlinevirtual |
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.
Implements DDSEntity.
|
inlinevirtual |
Allows access to the DDS_InstanceHandle_t associated with the DDSEntity.
This operation returns the DDS_InstanceHandle_t that represents the DDSEntity.
Implements DDSEntity.
References DDS_BOOLEAN_FALSE.