Data Writer

DataWriter objects are responsible for sending type-specific data to one or more DataReaders.

A DataWriter is created with a Topic, which gives a name to the data stream and associates the DataWriter with a data type. A DataWriter sends data to one or more DataReaders if the DataWriter and DataReader(s):

have Topics with the same namehave data types that are assignable to each other (not necessarily identical)are within the same domainhave compatible QoScan be discovered and communicate with each other over one or more transportsThe behavior of a DataWriter is controlled by QoS. For example, a DataWriter can be made reliable by configuring its RELIABILITY QoS. A DataWriter provides asynchronous notifications in the form of Status Changes.

There are two types of objects that can be referred to as DataWriters: DDS DataWriter objects and type-specific DataWriter objects (usually called FooDataWriter to indicate a user data type “Foo”).

The DDS::DataWriter object is used for actions that are not specific to a single data type, such as configuring QoS or installing listeners. The type-specific FooDataWriter object is used for actions that involve the specific data type, such as writing data or unregistering/disposing of an instance.

For example, when writing data, you must use a type-specific DataWriter, rather than the generic DataWriter class:

Example of using a DDS DataWriter