CoreDX DDS
Java Reference Manual

DataWriter Class Reference
[DDS Entities]

The DataWriter entity provides an interface for the application to publish (write) data. The DataWriter is an abstract class that is extended to support a particular data type required by the application. A DataReader is associated with, and writes on, a single Topic. More...

Inheritance diagram for DataWriter:
DomainEntity Entity DynamicTypeDataWriter FooDataWriter

List of all members.

Public Member Functions

ReturnCode_t enable ()
ReturnCode_t set_qos (DataWriterQos qos)
ReturnCode_t get_qos (DataWriterQos qos)
ReturnCode_t set_listener (DataWriterListener new_listener, long mask)
DataWriterListener get_listener ()
Topic get_topic ()
Publisher get_publisher ()
ReturnCode_t wait_for_acknowledgments (Duration_t max_wait)
 Block until this writer has received acknowledgements for all written data.
ReturnCode_t assert_liveliness ()
ReturnCode_t get_liveliness_lost_status (LivelinessLostStatus status)
ReturnCode_t get_offered_deadline_missed_status (OfferedDeadlineMissedStatus status)
ReturnCode_t get_offered_incompatible_qos_status (OfferedIncompatibleQosStatus status)
ReturnCode_t get_publication_matched_status (PublicationMatchedStatus status)
ReturnCode_t get_matched_subscriptions (InstanceHandleSeq subscription_handles)
ReturnCode_t get_matched_subscription_data (SubscriptionBuiltinTopicData subscription_data, InstanceHandle_t subscription_handle)

Detailed Description

The DataWriter entity provides an interface for the application to publish (write) data. The DataWriter is an abstract class that is extended to support a particular data type required by the application. A DataReader is associated with, and writes on, a single Topic.


Member Function Documentation

ReturnCode_t assert_liveliness (  )  [inline]

This operation manually asserts the liveliness of the DataWriter dw. This operation is useful if the LIVELINESS QoS setting is MANUAL_BY_PARTICIPANT_LIVELINESS_QOS or MANUAL_BY_TOPIC_LIVELINESS_QOS; otherwise, it has no effect.

The write operation automatically asserts livelines on the DataWriter and its DomainParticipant. Therefore, assert_liveliness is required only if hte application is not writing data frequently enough to satisfy the LIVELINESS setting.

ReturnCode_t enable (  )  [inline]

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

Any other operation may return the RETCODE_NOT_ENABLED error. DataWriter_enable() may be called on an already enabled DataWriter [it will have no effect].

Reimplemented from Entity.

DataWriterListener get_listener (  )  [inline]

This operation returns the currently installed DataWriterListener.

ReturnCode_t get_liveliness_lost_status ( LivelinessLostStatus  status  )  [inline]

Provides access to the current LivelinessLostStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change status field to zero.

ReturnCode_t get_matched_subscription_data ( SubscriptionBuiltinTopicData  subscription_data,
InstanceHandle_t  subscription_handle 
) [inline]

This operation returns data that describes a particular matched DataReader identified by subscription_handle. An appropriate handle can be obtained through a call to DataWriter.get_matched_subscriptions().

If subscription_handle does not identify a matched DataReader, this routine will return ReturnCode_t.RETCODE_PRECONDITION_NOT_MET.

ReturnCode_t get_matched_subscriptions ( InstanceHandleSeq  subscription_handles  )  [inline]

This operation retrieves the list of DataReaders currently matched with the DataWriter dw. This list will include the handles that identify DataReaders which have matching Topic and compatible QoS with DataWriter.

If a DataReader has been ignored by a call to DomainParticipant.ignore_subscription(), then it will not appear in the list.

Parameters:
subscription_handles A vector that will be populated with InstanceHandle_t(s).
ReturnCode_t get_offered_deadline_missed_status ( OfferedDeadlineMissedStatus  status  )  [inline]

Provides access to the current OfferedDeadlineMissedStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change status field to zero.

ReturnCode_t get_offered_incompatible_qos_status ( OfferedIncompatibleQosStatus  status  )  [inline]

Provides access to the current OfferedIncompatibleQosStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change status field to zero.

ReturnCode_t get_publication_matched_status ( PublicationMatchedStatus  status  )  [inline]

Provides access to the current PublicationMatchedStatus of the DataWriter. As a side-effect, this routine will reset the total_count_change and current_count_change status fields to zero.

Publisher get_publisher (  )  [inline]

Returns the Publisher that contains DataWriter dw.

ReturnCode_t get_qos ( DataWriterQos  qos  )  [inline]

Returns the current DataWriterQos settings held in the DataWriter dw. This routines copies data from the DataWriter QoS properties into qos.

Topic get_topic (  )  [inline]

Returns the Topic associated with DataWriter dw.

ReturnCode_t set_listener ( DataWriterListener  new_listener,
long  mask 
) [inline]

Installs a DataWriterListener on DataWriter dw. Only one listener may be attached to a DataWriter at a time. A call to set_listener() will replace any current listener with a_listener.

a_listener can be NULL, which indicates a listener that does nothing.

See also:
DDS for a list of available STATUS constants which may be or'ed together to construct the mask.
ReturnCode_t set_qos ( DataWriterQos  qos  )  [inline]

Sets the DataWriterQos values. These QoS values affect the behavior of the DataWriter. This routine may fail if the provided qos argument is not internally consistent. In this case, ReturnCode_t.RETCODE_INCONSISTENT_POLICY will be returned, and no changes will be made to the DataWriter QoS.

ReturnCode_t wait_for_acknowledgments ( Duration_t  max_wait  )  [inline]

Block until this writer has received acknowledgements for all written data.

This routine will block until all data written by the writer has been acknowledged, or until the 'max_wait' duration has passed. 'max_wait' can be set to INFINITE, in which case this routine may block indefinitely.

Return values:
DDS_RETCODE_TIME_OUT returned if 'max_wait' passes before all acks are received
DDS_RETCODE_OK returned if all acks have been received before 'max_wait'
 All Classes Functions Variables

© 2009-2012 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.