RTI Connext C++ API
Version 5.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. | |
virtual DDS_ReturnCode_t | get_offered_deadline_missed_status (DDS_OfferedDeadlineMissedStatus &status) |
Accesses the DDS_OFFERED_DEADLINE_MISSED_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_offered_incompatible_qos_status (DDS_OfferedIncompatibleQosStatus &status) |
Accesses the DDS_OFFERED_INCOMPATIBLE_QOS_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_publication_matched_status (DDS_PublicationMatchedStatus &status) |
Accesses the DDS_PUBLICATION_MATCHED_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_reliable_writer_cache_changed_status (DDS_ReliableWriterCacheChangedStatus &status) |
<<eXtension>> Get the reliable cache status for this writer. | |
virtual DDS_ReturnCode_t | get_reliable_reader_activity_changed_status (DDS_ReliableReaderActivityChangedStatus &status) |
<<eXtension>> Get the reliable reader activity changed status for this writer. | |
virtual DDS_ReturnCode_t | get_datawriter_cache_status (DDS_DataWriterCacheStatus &status) |
<<eXtension>> Get the datawriter cache status for this writer. | |
virtual DDS_ReturnCode_t | get_datawriter_protocol_status (DDS_DataWriterProtocolStatus &status) |
<<eXtension>> Get the datawriter protocol status for this writer. | |
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. | |
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. | |
virtual DDS_ReturnCode_t | assert_liveliness () |
This operation manually asserts the liveliness of this DDSDataWriter. | |
virtual DDS_ReturnCode_t | get_matched_subscription_locators (DDS_LocatorSeq &locators) |
<<eXtension>> Retrieve the list of locators for subscriptions currently "associated" with this DDSDataWriter. | |
virtual DDS_ReturnCode_t | get_matched_subscriptions (DDS_InstanceHandleSeq &subscription_handles) |
Retrieve the list of subscriptions currently "associated" with this DDSDataWriter. | |
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. | |
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. | |
virtual DDSTopic * | get_topic () |
This operation returns the DDSTopic associated with the DDSDataWriter. | |
virtual DDSPublisher * | get_publisher () |
This operation returns the DDSPublisher to which the DDSDataWriter belongs. | |
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. | |
virtual DDS_ReturnCode_t | wait_for_asynchronous_publishing (const DDS_Duration_t &max_wait) |
<<eXtension>> Blocks the calling thread until asynchronous sending is complete. | |
virtual DDS_ReturnCode_t | set_qos (const DDS_DataWriterQos &qos) |
Sets the writer QoS. | |
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. | |
virtual DDS_ReturnCode_t | get_qos (DDS_DataWriterQos &qos) |
Gets the writer QoS. | |
virtual DDS_ReturnCode_t | set_listener (DDSDataWriterListener *l, DDS_StatusMask mask=DDS_STATUS_MASK_ALL) |
Sets the writer listener. | |
virtual DDSDataWriterListener * | get_listener () |
Get the writer listener. | |
virtual DDS_ReturnCode_t | flush () |
<<eXtension>> Flushes the batch in progress in the context of the calling thread. | |
virtual DDS_ReturnCode_t | enable () |
Enables the DDSEntity. | |
virtual DDSStatusCondition * | get_statuscondition () |
Allows access to the DDSStatusCondition associated with the DDSEntity. | |
virtual DDS_StatusMask | get_status_changes () |
Retrieves the list of communication statuses in the DDSEntity that are triggered. | |
virtual DDS_InstanceHandle_t | get_instance_handle () |
Allows access to the DDS_InstanceHandle_t associated with the DDSEntity. | |
<<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 |
<<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.
Matched subscription locators include locators for all those subscriptions in the same domain that have a matching DDSTopic, compatible QoS and common partition that the DDSDomainParticipant has not indicated should be "ignored" by means of the DDSDomainParticipant::ignore_subscription operation.
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.
Matched subscriptions include all those in the same domain that have a matching DDSTopic, compatible QoS and common partition that the DDSDomainParticipant has not indicated should be "ignored" by means of the DDSDomainParticipant::ignore_subscription operation.
The handles returned in the subscription_handles
list are the ones that are used by the DDS implementation 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.
subscription_handles | <<inout>>. 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 the matches and the system can not 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.
Note: This operation does not retrieve the following information in DDS_SubscriptionBuiltinTopicData:
The above 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.
Note: This operation does not retrieve the DDS_ParticipantBuiltinTopicData::property.
The above information is available through DDSDataReaderListener::on_data_available() (if a reader listener is installed on the DDSSubscriptionBuiltinTopicDataDataReader).
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 return value of 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 RETCODE_OK.
max_wait | <<in>> Specifies maximum time to wait for acknowledgements DDS_Duration_t . |
|
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 that is disabled are created disabled, regardless of the setting of the DDS_EntityFactoryQosPolicy.
Calling enable on an Entity whose factory 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.
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.