RTI Connext C# API  6.1.2
DataWriter< T > Class Template Reference

Allows an application to set the value of the data to be published under a given Topic<T>. More...

Inheritance diagram for DataWriter< T >:
AnyDataWriter Entity

Public Member Functions

void Write (T sample)
 Modifies the value of a data instance. More...
 
void Write (T sample, in InstanceHandle instanceHandle)
 Modifies the value of a data instance. More...
 
void Write (T sample, WriteParams parameters)
 Modifies the value of a data instance and specifies additional parameters. More...
 
override void WriteUntyped (object sample)
 Calls Write(T), but allows doing so as an AnyDataWriter in a context where T is not known. More...
 
override void WriteUntyped (object sample, WriteParams parameters)
 Calls Write(T, WriteParams), but allows doing so as an AnyDataWriter in a context where T is not known. More...
 
InstanceHandle RegisterInstance (T sample)
 Informs the middleware that the application will be modifying a particular instance. More...
 
InstanceHandle RegisterInstance (T sample, WriteParams parameters)
 Informs DDS that the application will be modifying a particular instance. More...
 
override InstanceHandle RegisterInstanceUntyped (object sample)
 Calls DataWriter<T>.RegisterInstance(T), but allows doing so in a context where T is not known. More...
 
override InstanceHandle RegisterInstanceUntyped (object sample, WriteParams parameters)
 Calls DataWriter<T>.RegisterInstance(T, WriteParams), but allows doing so in a context where T is not known. More...
 
InstanceHandle LookupInstance (T keyHolder)
 Retrieve the InstanceHandle that corresponds to an instance key value. More...
 
override InstanceHandle LookupInstanceUntyped (object keyHolder)
 Calls LookupInstance(T), but allows doing so as an AnyDataWriter in a context where T is not known. More...
 
GetKeyValue (T keyHolder, in InstanceHandle instanceHandle)
 Retrieve the instance key that corresponds to an InstanceHandle. More...
 
override object GetKeyValueUntyped (object keyHolder, in InstanceHandle instanceHandle)
 Calls DataWriter<T>.GetKeyValue, but allows doing so as an AnyDataWriter in a context where T is not known. More...
 
CreateData ()
 Creates a data sample for the type of this DataWriter. More...
 
override string ToString ()
 Provides a readable summary of information about this DataWriter. More...
 
- Public Member Functions inherited from AnyDataWriter
void DisposeInstance (in InstanceHandle instanceHandle)
 Requests the middleware to delete the instance. More...
 
void DisposeInstance (WriteParams parameters)
 Requests the middleware to delete the instance. More...
 
void UnregisterInstance (in InstanceHandle instanceHandle)
 Reverses the action of RegisterInstanceUntyped(object). More...
 
void UnregisterInstance (WriteParams parameters)
 Provides additional parameters to UnregisterInstance(in InstanceHandle). More...
 
abstract object GetKeyValueUntyped (object keyHolder, in InstanceHandle InstanceHandle)
 Allows calling DataWriter<T>.GetKeyValue in a context where the type is not known. More...
 
SubscriptionBuiltinTopicData GetMatchedSubscriptionData (in InstanceHandle subscriptionHandle)
 Retrieves the information on a subscription that is currently "associated" with this DataWriter. More...
 
IEnumerable< SubscriptionBuiltinTopicDataGetMatchedSubscriptionData ()
 Retrieves the information on all subscriptions that are currently "associated" with this DataWriter. More...
 
ParticipantBuiltinTopicData GetMatchedSubscriptionParticipantData (in InstanceHandle subscriptionHandle)
 Retrieves the information on the discovered Domain.DomainParticipant associated with the subscription that is currently matching with the DataWriter<T> More...
 
bool IsMatchedSubscriptionActive (in InstanceHandle subscriptionHandle)
 Check if a subscription currently matched with a DataWriter<T> is active. More...
 
IEnumerable< LocatorGetMatchedSubscriptionLocators ()
 Retrieves a list of Locator for subscriptions currently matched with the DataWriter<T>. More...
 
void WaitForAcknowledgments (Duration maxWait)
 Blocks the calling thread until all data written by a reliable writer is acknowledged, or until the maxWait expires. More...
 
void WaitForAsynchronousPublishing (Duration maxWait)
 Blocks the calling thread until asynchronous sending is completed. More...
 
bool IsSampleAppAcknowledged (in SampleIdentity sampleId)
 Indicates if a sample has been acknowledged by the subscribing applications. More...
 
void AssertLiveliness ()
 This operation manually asserts the liveliness of this DataWriter More...
 
DataWriterProtocolStatus GetMatchedSubscriptionDataWriterProtocolStatus (in InstanceHandle subscriptionHandle)
 Get the protocol status for this DataWriter, per matched subscription identified by the subscriptionHandle. More...
 
DataWriterProtocolStatus GetMatchedSubscriptionDataWriterProtocolStatus (Locator subscriptionLocator)
 Get the protocol status for this DataWriter, per matched subscription identified by the locator. More...
 
void Flush ()
 Flushes the batch in progress in the context of the calling thread. More...
 
override void ResetEvents (StatusMask eventsToRemove=StatusMask.All)
 Stop notifying of certain events and remove their event handlers More...
 
- Public Member Functions inherited from Entity
void Enable ()
 Enables this Entity (by default entities are automatically enabled after creation) More...
 
EntityLock Lock ()
 Locks the Entity using its internal lock. More...
 
void Dispose ()
 Releases the resources used by this Entity and disposes its contained entities as well (if any). More...
 

Properties

override Publisher Publisher [get]
 Returns the Publisher to which the DataWriter belongs. More...
 
Topic< T > Topic [get]
 Returns the Topic associated with this DataWriter. More...
 
override Topics.IAnyTopic TopicUntyped [get]
 Returns Topic More...
 
- Properties inherited from AnyDataWriter
abstract IAnyTopic TopicUntyped [get]
 Returns the type-erased Topic<T> associated with this DataWriter. More...
 
DataWriterQos Qos [get, set]
 Gets or sets the writer QoS. More...
 
abstract Publisher Publisher [get]
 This operation returns the Publisher to which the DataWriter belongs. More...
 
IEnumerable< InstanceHandleMatchedSubscriptions [get]
 Retrieves the list of subscriptions currently "associated" with this DataWriter. More...
 
LivelinessLostStatus LivelinessLostStatus [get]
 Accesses the StatusMask.LivelinessLost status. More...
 
OfferedDeadlineMissedStatus OfferedDeadlineMissedStatus [get]
 Accesses the StatusMask.PublicationMatched status. More...
 
OfferedIncompatibleQosStatus OfferedIncompatibleQosStatus [get]
 Accesses the StatusMask.OfferedIncompatibleQos status. More...
 
PublicationMatchedStatus PublicationMatchedStatus [get]
 Accesses the StatusMask.PublicationMatched status. More...
 
DataWriterProtocolStatus DataWriterProtocolStatus [get]
 Retrieve the StatusMask.DataWriterProtocol status. More...
 
DataWriterCacheStatus DataWriterCacheStatus [get]
 Retrieve the StatusMask.DataWriterCache status. More...
 
ReliableReaderActivityChangedStatus ReliableReaderActivityChangedStatus [get]
 Retrieve the StatusMask.ReliableReaderActivityChanged status. More...
 
ReliableWriterCacheChangedStatus ReliableWriterCacheChangedStatus [get]
 Retrieve the StatusMask.ReliableWriterCacheChanged status. More...
 
ServiceRequestAcceptedStatus ServiceRequestAcceptedStatus [get]
 Retrieve the StatusMask.ServiceRequestAccepted status. More...
 
LivelinessLostEventHandler LivelinessLost
 Event triggered when the Rti.Dds.Core.Status.StatusMask.LivelinessLost status changes. More...
 
OfferedIncompatibleQosEventHandler OfferedIncompatibleQos
 Event triggered when the Rti.Dds.Core.Status.StatusMask.OfferedIncompatibleQos status changes. More...
 
OfferedDeadlineMissedEventHandler OfferedDeadlineMissed
 Event triggered when the Rti.Dds.Core.Status.StatusMask.OfferedDeadlineMissed status changes. More...
 
PublicationMatchedEventHandler PublicationMatched
 Event triggered when the Rti.Dds.Core.Status.StatusMask.PublicationMatched status changes More...
 
ReliableReaderActivityChangedEventHandler ReliableReaderActivityChanged
 Event triggered when the Rti.Dds.Core.Status.StatusMask.ReliableReaderActivityChanged status changes. More...
 
ReliableWriterCacheChangedEventHandler ReliableWriterCacheChanged
 Event triggered when the Rti.Dds.Core.Status.StatusMask.ReliableWriterCacheChanged status changes. More...
 
ServiceRequestAcceptedEventHandler ServiceRequestAccepted
 Event triggered when the Rti.Dds.Core.Status.StatusMask.ServiceRequestAccepted status changes. More...
 
ApplicationAcknowledgementReceivedEventHandler ApplicationAcknowledgementReceived
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataWriterApplicationAcknowledgementReceived status changes. More...
 
InstanceReplacedEventHandler InstanceReplaced
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataWriterInstanceReplaced status changes. More...
 
SampleRemovedEventHandler SampleRemoved
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataWriterSampleRemoved status changes. More...
 
- Properties inherited from Entity
InstanceHandle InstanceHandle [get]
 Gets the InstanceHandle that identifies this Entity More...
 
StatusMask StatusChanges [get]
 Retrieves the list of communication statuses in this Entity that are triggered. More...
 
StatusCondition StatusCondition [get]
 Gets the StatusCondition associated with this Entity. More...
 
bool Enabled [get]
 Indicates whether this Entity is enabled. More...
 
bool Disposed [get]
 Indicates whether this Entity has already been disposed. More...
 

Detailed Description

Allows an application to set the value of the data to be published under a given Topic<T>.

The full documentation is available in the C API: DDS_DataWriter

Member Function Documentation

◆ CreateData()

T CreateData ( )

Creates a data sample for the type of this DataWriter.

The full documentation is available in the C API: FooDataWriter_create_data

◆ GetKeyValue()

T GetKeyValue ( keyHolder,
in InstanceHandle  instanceHandle 
)

Retrieve the instance key that corresponds to an InstanceHandle.

Parameters
keyHolder(output) A placeholder to populate the key members
instanceHandleIdentifies the key to look up
Returns
Returns the argument keyHolder

The full documentation is available in the C API: FooDataWriter_get_key_value

◆ GetKeyValueUntyped()

override object GetKeyValueUntyped ( object  keyHolder,
in InstanceHandle  instanceHandle 
)

Calls DataWriter<T>.GetKeyValue, but allows doing so as an AnyDataWriter in a context where T is not known.

Parameters
keyHolderThe obtained key values.
instanceHandleThe InstanceHandle corresponding to the instance whose key values we want to obtain. The runtime type of keyHolder must be T. Otherwise this operation throws InvalidCastException.
Returns
The obtained key values.

◆ LookupInstance()

InstanceHandle LookupInstance ( keyHolder)

Retrieve the InstanceHandle that corresponds to an instance key value.

The full documentation is available in the C API: FooDataWriter_lookup_instance

◆ LookupInstanceUntyped()

override InstanceHandle LookupInstanceUntyped ( object  keyHolder)
virtual

Calls LookupInstance(T), but allows doing so as an AnyDataWriter in a context where T is not known.

Parameters
keyHolderThe key fields of the instance to lookup. The runtime type of keyHolder must be T. Otherwise this operation throws InvalidCastException.

Implements AnyDataWriter.

◆ RegisterInstance() [1/2]

InstanceHandle RegisterInstance ( sample)

Informs the middleware that the application will be modifying a particular instance.

The full documentation is available in the C API: FooDataWriter_register_instance

◆ RegisterInstance() [2/2]

InstanceHandle RegisterInstance ( sample,
WriteParams  parameters 
)

Informs DDS that the application will be modifying a particular instance.

The full documentation is available in the C API: FooDataWriter_register_instance

◆ RegisterInstanceUntyped() [1/2]

override InstanceHandle RegisterInstanceUntyped ( object  sample)
virtual

Calls DataWriter<T>.RegisterInstance(T), but allows doing so in a context where T is not known.

Parameters
sampleThe instance to register. Its runtime type must be the type of the actual DataWriter<T>. Otherwise this operation throws InvalidCastException.

Implements AnyDataWriter.

◆ RegisterInstanceUntyped() [2/2]

override InstanceHandle RegisterInstanceUntyped ( object  sample,
WriteParams  parameters 
)
virtual

Calls DataWriter<T>.RegisterInstance(T, WriteParams), but allows doing so in a context where T is not known.

Parameters
sampleThe instance to register. Its runtime type must be the type of the actual DataWriter<T>. Otherwise this operation throws InvalidCastException.
parametersConfigures the register operation

Implements AnyDataWriter.

◆ ToString()

override string ToString ( )

Provides a readable summary of information about this DataWriter.

◆ Write() [1/3]

void Write ( sample)

Modifies the value of a data instance.

The full documentation is available in the C API: FooDataWriter_write

◆ Write() [2/3]

void Write ( sample,
in InstanceHandle  instanceHandle 
)

Modifies the value of a data instance.

When writing multiple updates for the same instance, it is recommended to first call RegisterInstance(T) and use the instance handle to call this method. In this case this method is more efficient than Write(T).

The full documentation is available in the C API: FooDataWriter_write

◆ Write() [3/3]

void Write ( sample,
WriteParams  parameters 
)

Modifies the value of a data instance and specifies additional parameters.

The full documentation is available in the C API: FooDataWriter_write_w_params

◆ WriteUntyped() [1/2]

override void WriteUntyped ( object  sample)
virtual

Calls Write(T), but allows doing so as an AnyDataWriter in a context where T is not known.

Parameters
sampleThe data to write. Its runtime type must be T. Otherwise this operation throws InvalidCastException.

Implements AnyDataWriter.

◆ WriteUntyped() [2/2]

override void WriteUntyped ( object  sample,
WriteParams  parameters 
)
virtual

Calls Write(T, WriteParams), but allows doing so as an AnyDataWriter in a context where T is not known.

Parameters
sampleThe data to write. Its runtime type must be T. Otherwise this operation throws InvalidCastException.
parametersConfigures the write operation

Implements AnyDataWriter.

Property Documentation

◆ Publisher

override Publisher Publisher
get

Returns the Publisher to which the DataWriter belongs.

The full documentation is available in the C API: DDS_DataWriter_get_publisher

◆ Topic

Topic<T> Topic
get

Returns the Topic associated with this DataWriter.

The full documentation is available in the C API: DDS_DataWriter_get_topic

◆ TopicUntyped

override Topics.IAnyTopic TopicUntyped
get

Returns Topic

The full documentation is available in the C API: DDS_DataWriter_get_topic