CoreDX DDS C# Reference Manual
Public Member Functions | List of all members
DataWriter Class Reference
Inheritance diagram for DataWriter:
DomainEntity Entity

Public Member Functions

override ReturnCode_t enable ()
 
override InstanceHandle_t get_instance_handle ()
 
ReturnCode_t set_qos (DataWriterQos qos)
 
ReturnCode_t get_qos (DataWriterQos qos)
 
ReturnCode_t set_listener (DataWriterListener new_listener, uint mask)
 
DataWriterListener get_listener ()
 
Topic get_topic ()
 
Publisher get_publisher ()
 
ReturnCode_t wait_for_acknowledgments (Duration_t max_wait)
 
ReturnCode_t assert_liveliness ()
 
ReturnCode_t get_liveliness_lost_status (out LivelinessLostStatus status)
 
ReturnCode_t get_offered_deadline_missed_status (out OfferedDeadlineMissedStatus status)
 
ReturnCode_t get_offered_incompatible_qos_status (out OfferedIncompatibleQosStatus status)
 
ReturnCode_t get_publication_matched_status (out PublicationMatchedStatus status)
 
ReturnCode_t get_matched_subscriptions (List< InstanceHandle_t > subscription_handles)
 
ReturnCode_t get_matched_subscription_data (SubscriptionBuiltinTopicData subscription_data, InstanceHandle_t subscription_handle)
 
ReturnCode_t get_guid (GUID_t g)
 
- Public Member Functions inherited from Entity
virtual StatusCondition get_statuscondition ()
 
virtual uint get_status_changes ()
 

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 LivelinessQosPolicyKind.MANUAL_BY_PARTICIPANT_LIVELINESS_QOS or LivelinessQosPolicyKind.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.

override ReturnCode_t enable ( )
inlinevirtual

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 DDS.RETCODE_NOT_ENABLED error. DataWriter_enable() may be called on an already enabled DataWriter [it will have no effect].

Reimplemented from Entity.

ReturnCode_t get_guid ( GUID_t  g)
inline

Access the GUID which uniquely identifies this writer.

override InstanceHandle_t get_instance_handle ( )
inlinevirtual

Gets the handle that locally identifies this Entity.

Reimplemented from Entity.

DataWriterListener get_listener ( )
inline

This operation returns the currently installed DataWriterListener.

ReturnCode_t get_liveliness_lost_status ( out 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 DDS.RETCODE_PRECONDITION_NOT_MET.

ReturnCode_t get_matched_subscriptions ( List< InstanceHandle_t 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_handlesA vector that will be populated with InstanceHandle_t(s).
ReturnCode_t get_offered_deadline_missed_status ( out 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 ( out 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 ( out 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,
uint  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.

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, DDS.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_TIMEOUTreturned if 'max_wait' passes before all acks are received
DDS.RETCODE_OKreturned if all acks have been received before 'max_wait'

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