RTI Connext Traditional C++ API  Version 5.2.0
 All Classes Functions Variables Typedefs Enumerations Enumerator Groups Pages
FooDataWriter Class Referenceabstract

<<interface>> <<generic>> User data type specific data writer. More...

Inheritance diagram for FooDataWriter:
DDSDataWriter DDSDomainEntity DDSEntity

Public Member Functions

virtual DDS_InstanceHandle_t register_instance (const Foo &instance_data)=0
 Informs RTI Connext that the application will be modifying a particular instance.
 
virtual DDS_InstanceHandle_t register_instance_w_timestamp (const Foo &instance_data, const DDS_Time_t &source_timestamp)=0
 Performs the same functions as register_instance except that the application provides the value for the source_timestamp.
 
virtual DDS_InstanceHandle_t register_instance_w_params (const Foo &instance_data, DDS_WriteParams_t &params)=0
 Performs the same function as FooDataWriter::register_instance and FooDataWriter::register_instance_w_timestamp except that it also provides the values contained in params.
 
virtual DDS_ReturnCode_t unregister_instance (const Foo &instance_data, const DDS_InstanceHandle_t &handle)=0
 Reverses the action of FooDataWriter::register_instance.
 
virtual DDS_ReturnCode_t unregister_instance_w_timestamp (const Foo &instance_data, const DDS_InstanceHandle_t &handle, const DDS_Time_t &source_timestamp)=0
 Performs the same function as FooDataWriter::unregister_instance except that it also provides the value for the source_timestamp.
 
virtual DDS_ReturnCode_t unregister_instance_w_params (const Foo &instance_data, DDS_WriteParams_t &params)=0
 Performs the same function as FooDataWriter::unregister_instance and FooDataWriter::unregister_instance_w_timestamp except that it also provides the values contained in params.
 
virtual DDS_ReturnCode_t write (const Foo &instance_data, const DDS_InstanceHandle_t &handle)=0
 Modifies the value of a data instance.
 
virtual DDS_ReturnCode_t write_w_timestamp (const Foo &instance_data, const DDS_InstanceHandle_t &handle, const DDS_Time_t &source_timestamp)=0
 Performs the same function as FooDataWriter::write except that it also provides the value for the source_timestamp.
 
virtual DDS_ReturnCode_t write_w_params (const Foo &instance_data, DDS_WriteParams_t &params)=0
 Performs the same function as FooDataWriter::write and FooDataWriter::write_w_timestamp except that it also provides the values contained in params.
 
virtual DDS_ReturnCode_t dispose (const Foo &instance_data, const DDS_InstanceHandle_t &instance_handle)=0
 Requests the middleware to delete the data.
 
virtual DDS_ReturnCode_t dispose_w_timestamp (const Foo &instance_data, const DDS_InstanceHandle_t &instance_handle, const DDS_Time_t &source_timestamp)=0
 Performs the same functions as dispose except that the application provides the value for the source_timestamp that is made available to DDSDataReader objects by means of the source_timestamp attribute inside the DDS_SampleInfo.
 
virtual DDS_ReturnCode_t dispose_w_params (const Foo &instance_data, DDS_WriteParams_t &params)=0
 Performs the same function as FooDataWriter::dispose and FooDataWriter::dispose_w_timestamp except that it also provides the values contained in params.
 
virtual DDS_ReturnCode_t get_key_value (Foo &key_holder, const DDS_InstanceHandle_t &handle)=0
 Retrieve the instance key that corresponds to an instance handle.
 
virtual DDS_InstanceHandle_t lookup_instance (const Foo &key_holder)=0
 Retrieve the instance handle that corresponds to an instance key_holder.
 
- Public Member Functions inherited from DDSDataWriter
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 DDSTopicget_topic ()
 This operation returns the DDSTopic associated with the DDSDataWriter.
 
virtual DDSPublisherget_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 is_sample_app_acknowledged (DDS_Boolean &is_app_ack, const struct DDS_SampleIdentity_t &identity)
 This method can be used to see if a sample has been application acknowledged.
 
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 DDSDataWriterListenerget_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 DDSStatusConditionget_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.
 

Static Public Member Functions

static FooDataWriternarrow (DDSDataWriter *writer)
 Narrow the given DDSDataWriter pointer to a FooDataWriter pointer.
 

Detailed Description

<<interface>> <<generic>> User data type specific data writer.

Defines the user data type specific writer interface generated for each application class.

The concrete user data type writer automatically generated by the implementation is an incarnation of this class.

See Also
DDSDataWriter
Foo
FooDataReader
rtiddsgen

Member Function Documentation

static FooDataWriter* FooDataWriter::narrow ( DDSDataWriter writer)
static

Narrow the given DDSDataWriter pointer to a FooDataWriter pointer.

Check if the given writer is of type FooDataWriter.

Parameters
writer<<in>> Base-class DDSDataWriter to be converted to the auto-generated class FooDataWriter that extends DDSDataWriter.
Returns
FooDataWriter if writer is of type Foo. Return NULL otherwise.
virtual DDS_InstanceHandle_t FooDataWriter::register_instance ( const Foo instance_data)
pure virtual

Informs RTI Connext that the application will be modifying a particular instance.

This operation is only useful for keyed data types. Using it for non-keyed types causes no effect and returns DDS_HANDLE_NIL. The operation takes as a parameter an instance (of which only the key value is examined) and returns a handle that can be used in successive write() or dispose() operations.

The operation gives RTI Connext an opportunity to pre-configure itself to improve performance.

The use of this operation by an application is optional even for keyed types. If an instance has not been pre-registered, the application CPP2_LANGUAGE_ONLY can use the special value DDS_HANDLE_NIL as the DDS_InstanceHandle_t parameter to the write or dispose operation can call the write() or dipose_instance() overloads that don't receive a DDS_InstanceHandle_t and RTI Connext will auto-register the instance.

For best performance, the operation should be invoked prior to calling any operation that modifies the instance, such as FooDataWriter::write, FooDataWriter::write_w_timestamp, FooDataWriter::dispose and FooDataWriter::dispose_w_timestamp and the handle used in conjunction with the data for those calls.

When this operation is used, RTI Connext will automatically supply the value of the source_timestamp that is used.

This operation may fail and return DDS_HANDLE_NIL if DDS_ResourceLimitsQosPolicy::max_instances limit has been exceeded.

The operation is idempotent. If it is called for an already registered instance, it just returns the already allocated handle. This may be used to lookup and retrieve the handle allocated to a given instance.

This operation can only be called after DDSDataWriter has been enabled. Otherwise, DDS_HANDLE_NIL will be returned.

Parameters
instance_data<<in>> The instance that should be registered. Of this instance, only the fields that represent the key are examined by the function.
Returns
For keyed data type, a handle that can be used in the calls that take a DDS_InstanceHandle_t, such as write, dispose, unregister_instance, or return DDS_HANDLE_NIL on failure. If the instance_data is of a data type that has no keys, this function always returns DDS_HANDLE_NIL.
See Also
FooDataWriter::unregister_instance, FooDataWriter::get_key_value, Relationship between registration, liveliness and ownership The need for registering/unregistering instances stems from two use cases:
  • Ownership resolution on redundant systems
  • Detection of loss in topological connectivity
These two use cases also illustrate the semantic differences between the ::FooDataWriter::unregister_instance and ::FooDataWriter::dispose. BROKEN_SECTIONS
virtual DDS_InstanceHandle_t FooDataWriter::register_instance_w_timestamp ( const Foo instance_data,
const DDS_Time_t source_timestamp 
)
pure virtual

Performs the same functions as register_instance except that the application provides the value for the source_timestamp.

The provided source_timestamp potentially affects the relative order in which readers observe events from multiple writers. Refer to DESTINATION_ORDER QoS policy for details.

This operation may fail and return DDS_HANDLE_NIL if DDS_ResourceLimitsQosPolicy::max_instances limit has been exceeded.

This operation can only be called after DDSDataWriter has been enabled. Otherwise, DDS_HANDLE_NIL will be returned.

Parameters
instance_data<<in>> The instance that should be registered. Of this instance, only the fields that represent the key are examined by the function.
source_timestamp<<in>> The timestamp value must be greater than or equal to the timestamp value used in the last writer operation (used in a register, unregister, dispose, or write, with either the automatically supplied timestamp or the application provided timestamp). This timestamp may potentially affect the order in which readers observe events from multiple writers.
Returns
For keyed data type, return a handle that can be used in the calls that take a DDS_InstanceHandle_t, such as write, dispose, unregister_instance, or return DDS_HANDLE_NIL on failure. If the instance_data is of a data type that has no keys, this function always return DDS_HANDLE_NIL.
See Also
FooDataWriter::unregister_instance, FooDataWriter::get_key_value
virtual DDS_InstanceHandle_t FooDataWriter::register_instance_w_params ( const Foo instance_data,
DDS_WriteParams_t params 
)
pure virtual

Performs the same function as FooDataWriter::register_instance and FooDataWriter::register_instance_w_timestamp except that it also provides the values contained in params.

See Also
FooDataWriter::write_w_params
virtual DDS_ReturnCode_t FooDataWriter::unregister_instance ( const Foo instance_data,
const DDS_InstanceHandle_t handle 
)
pure virtual

Reverses the action of FooDataWriter::register_instance.

This operation is useful only for keyed data types. Using it for non-keyed types causes no effect and reports no error. The operation takes as a parameter an instance (of which only the key value is examined) and a handle.

This operation should only be called on an instance that is currently registered. This includes instances that have been auto-registered by calling operations such as write or dispose as described in FooDataWriter::register_instance. Otherwise, this operation may fail with DDS_RETCODE_BAD_PARAMETER.

This only need be called just once per instance, regardless of how many times register_instance was called for that instance.

When this operation is used, RTI Connext will automatically supply the value of the source_timestamp that is used.

This operation informs RTI Connext that the DDSDataWriter is no longer going to provide any information about the instance. This operation also indicates that RTI Connext can locally remove all information regarding that instance. The application should not attempt to use the handle previously allocated to that instance after calling FooDataWriter::unregister_instance().

The special value DDS_HANDLE_NIL can be used for the parameter handle. This indicates that the identity of the instance should be automatically deduced from the instance_data (by means of the key).

If handle is any value other than DDS_HANDLE_NIL, then it must correspond to an instance that has been registered. If there is no correspondence, the operation will fail with DDS_RETCODE_BAD_PARAMETER.

RTI Connext will not detect the error when the handle is any value other than DDS_HANDLE_NIL, corresponds to an instance that has been registered, but does not correspond to the instance deduced from the instance_data (by means of the key). RTI Connext will treat as if the unregister_instance() operation is for the instance as indicated by the handle.

If, after a FooDataWriter::unregister_instance, the application wants to modify (FooDataWriter::write or FooDataWriter::dispose) an instance, it has to register it again, or else use the special handle value DDS_HANDLE_NIL.

This operation does not indicate that the instance is deleted (that is the purpose of FooDataWriter::dispose). The operation FooDataWriter::unregister_instance just indicates that the DDSDataWriter no longer has anything to say about the instance. DDSDataReader entities that are reading the instance may receive a sample with DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE for the instance, unless there are other DDSDataWriter objects writing that same instance.

DDS_WriterDataLifecycleQosPolicy::autodispose_unregistered_instances controls whether instances are automatically disposed when they are unregistered.

This operation can affect the ownership of the data instance (see OWNERSHIP). If the DDSDataWriter was the exclusive owner of the instance, then calling unregister_instance() will relinquish that ownership.

If DDS_ReliabilityQosPolicy::kind is set to DDS_RELIABLE_RELIABILITY_QOS and the unregistration would overflow the resource limits of this writer or of a reader, this operation may block for up to DDS_ReliabilityQosPolicy::max_blocking_time; if this writer is still unable to unregister after that period, this method will fail with DDS_RETCODE_TIMEOUT.

Parameters
instance_data<<in>> The instance that should be unregistered. If Foo has a key and instance_handle is DDS_HANDLE_NIL, only the fields that represent the key are examined by the function. Otherwise, instance_data is not used. If instance_data is used, it must represent an instance that has been registerd. Otherwise, this method may fail with DDS_RETCODE_BAD_PARAMETER . If Foo has a key, instance_data can be NULL only if handle is not DDS_HANDLE_NIL. Otherwise, this method will fail with DDS_RETCODE_BAD_PARAMETER.
handle<<in>> represents the instance to be unregistered. If Foo has a key and handle is DDS_HANDLE_NIL, handle is not used and instance is deduced from instance_data. If Foo has no key, handle is not used. If handle is used, it must represent an instance that has been registered. Otherwise, this method may fail with DDS_RETCODE_BAD_PARAMETER. This method will fail with DDS_RETCODE_BAD_PARAMETER if handle is NULL. If Foo has a key, handle cannot be DDS_HANDLE_NIL if instance_data is NULL. Otherwise, this method will report the error DDS_RETCODE_BAD_PARAMETER.
Returns
One of the Standard Return Codes, DDS_RETCODE_TIMEOUT or DDS_RETCODE_NOT_ENABLED
See Also
FooDataWriter::register_instance
FooDataWriter::unregister_instance_w_timestamp
FooDataWriter::get_key_value
Relationship between registration, liveliness and ownership The need for registering/unregistering instances stems from two use cases:
  • Ownership resolution on redundant systems
  • Detection of loss in topological connectivity
These two use cases also illustrate the semantic differences between the ::FooDataWriter::unregister_instance and ::FooDataWriter::dispose. BROKEN_SECTIONS
virtual DDS_ReturnCode_t FooDataWriter::unregister_instance_w_timestamp ( const Foo instance_data,
const DDS_InstanceHandle_t handle,
const DDS_Time_t source_timestamp 
)
pure virtual

Performs the same function as FooDataWriter::unregister_instance except that it also provides the value for the source_timestamp.

The provided source_timestamp potentially affects the relative order in which readers observe events from multiple writers. Refer to DESTINATION_ORDER QoS policy for details.

The constraints on the values of the handle parameter and the corresponding error behavior are the same specified for the FooDataWriter::unregister_instance operation.

This operation may block and may time out (DDS_RETCODE_TIMEOUT) under the same circumtances described for the unregister_instance operation.

Parameters
instance_data<<in>> The instance that should be unregistered. If Foo has a key and instance_handle is DDS_HANDLE_NIL, only the fields that represent the key are examined by the function. Otherwise, instance_data is not used. If instance_data is used, it must represent an instance that has been registerd. Otherwise, this method may fail with DDS_RETCODE_BAD_PARAMETER. If Foo has a key, instance_data can be NULL only if handle is not DDS_HANDLE_NIL. Otherwise, this method will fail with DDS_RETCODE_BAD_PARAMETER.
handle<<in>> represents the instance to be unregistered. If Foo has a key and handle is DDS_HANDLE_NIL, handle is not used and instance is deduced from instance_data. If Foo has no key, handle is not used. If handle is used, it must represent an instance that has been registered. Otherwise, this method may fail with DDS_RETCODE_BAD_PARAMETER. This method will fail with DDS_RETCODE_BAD_PARAMETER if handle is NULL. If Foo has a key, handle cannot be DDS_HANDLE_NIL if instance_data is NULL. Otherwise, this method will report the error DDS_RETCODE_BAD_PARAMETER.
source_timestamp<<in>> The timestamp value must be greater than or equal to the timestamp value used in the last writer operation (used in a register, unregister, dispose, or write, with either the automatically supplied timestamp or the application provided timestamp). This timestamp may potentially affect the order in which readers observe events from multiple writers.
Returns
One of the Standard Return Codes, DDS_RETCODE_TIMEOUT or DDS_RETCODE_NOT_ENABLED.
See Also
FooDataWriter::register_instance
FooDataWriter::unregister_instance
FooDataWriter::get_key_value
virtual DDS_ReturnCode_t FooDataWriter::unregister_instance_w_params ( const Foo instance_data,
DDS_WriteParams_t params 
)
pure virtual

Performs the same function as FooDataWriter::unregister_instance and FooDataWriter::unregister_instance_w_timestamp except that it also provides the values contained in params.

See Also
FooDataWriter::write_w_params
FooDataWriter::dispose_w_params
virtual DDS_ReturnCode_t FooDataWriter::write ( const Foo instance_data,
const DDS_InstanceHandle_t handle 
)
pure virtual

Modifies the value of a data instance.

When this operation is used, RTI Connext will automatically supply the value of the source_timestamp that is made available to DDSDataReader objects by means of the source_timestamp attribute inside the DDS_SampleInfo. (Refer to DDS_SampleInfo and DESTINATION_ORDER QoS policy for details).

As a side effect, this operation asserts liveliness on the DDSDataWriter itself, the DDSPublisher and the DDSDomainParticipant.

Note that the special value DDS_HANDLE_NIL can be used for the parameter handle. This indicates the identity of the instance should be automatically deduced from the instance_data (by means of the key).

If handle is any value other than DDS_HANDLE_NIL, then it must correspond to an instance that has been registered. If there is no correspondence, the operation will fail with DDS_RETCODE_BAD_PARAMETER.

RTI Connext will not detect the error when the handle is any value other than DDS_HANDLE_NIL, corresponds to an instance that has been registered, but does not correspond to the instance deduced from the instance_data (by means of the key). RTI Connext will treat as if the write() operation is for the instance as indicated by the handle.

This operation may block if the RELIABILITY kind is set to DDS_RELIABLE_RELIABILITY_QOS and the modification would cause data to be lost or else cause one of the limits specified in the RESOURCE_LIMITS to be exceeded.

Specifically, this operation may block in the following situations (note that the list may not be exhaustive), even if its DDS_HistoryQosPolicyKind is DDS_KEEP_LAST_HISTORY_QOS:

This operation may also block when using DDS_BEST_EFFORT_RELIABILITY_QOS and DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS. In this case, the DDSDataWriter will queue samples until they are sent by the asynchronous publishing thread. The number of samples that can be stored is determined by the DDS_HistoryQosPolicy. If the asynchronous thread does not send samples fast enough (e.g., when using a slow DDSFlowController), the queue may fill up. In that case, subsequent write calls will block.

If this operation does block for any of the above reasons, 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 DDSDataWriter is able to store the modification without exceeding the limits, the operation will time out (DDS_RETCODE_TIMEOUT).

If there are no instance resources left, this operation may fail with DDS_RETCODE_OUT_OF_RESOURCES. Calling FooDataWriter::unregister_instance may help freeing up some resources.

This operation will fail with DDS_RETCODE_PRECONDITION_NOT_MET if the timestamp is less than the timestamp used in the last writer operation (register, unregister, dispose, or write, with either the automatically supplied timestamp or the application-provided timestamp).

Parameters
instance_data<<in>> The data to write.

This method will fail with DDS_RETCODE_BAD_PARAMETER if instance_data is NULL.

Parameters
handle<<in>> Either the handle returned by a previous call to FooDataWriter::register_instance, or else the special value DDS_HANDLE_NIL. If Foo has a key and handle is not DDS_HANDLE_NIL, handle must represent a registered instance of type Foo. Otherwise, this method may fail with DDS_RETCODE_BAD_PARAMETER. This method will fail with DDS_RETCODE_BAD_PARAMETER if handle is NULL.
Returns
One of the Standard Return Codes, DDS_RETCODE_TIMEOUT, DDS_RETCODE_PRECONDITION_NOT_MET, DDS_RETCODE_OUT_OF_RESOURCES, or DDS_RETCODE_NOT_ENABLED.
See Also
DDSDataReader
FooDataWriter::write_w_timestamp
DESTINATION_ORDER
virtual DDS_ReturnCode_t FooDataWriter::write_w_timestamp ( const Foo instance_data,
const DDS_InstanceHandle_t handle,
const DDS_Time_t source_timestamp 
)
pure virtual

Performs the same function as FooDataWriter::write except that it also provides the value for the source_timestamp.

Explicitly provides the timestamp that will be available to the DDSDataReader objects by means of the source_timestamp attribute inside the DDS_SampleInfo. (Refer to DDS_SampleInfo and DESTINATION_ORDER QoS policy for details)

The constraints on the values of the handle parameter and the corresponding error behavior are the same specified for the FooDataWriter::write operation.

This operation may block and time out (DDS_RETCODE_TIMEOUT) under the same circumtances described for FooDataWriter::write.

If there are no instance resources left, this operation may fail with DDS_RETCODE_OUT_OF_RESOURCES. Calling FooDataWriter::unregister_instance may help free up some resources.

This operation may fail with DDS_RETCODE_BAD_PARAMETER under the same circumstances described for the write operation.

Parameters
instance_data<<in>> The data to write. This method will fail with DDS_RETCODE_BAD_PARAMETER if instance_data is NULL.
handle<<in>> Either the handle returned by a previous call to FooDataWriter::register_instance, or else the special value DDS_HANDLE_NIL. If Foo has a key and handle is not DDS_HANDLE_NIL, handle must represent a registered instance of type Foo. Otherwise, this method may fail with DDS_RETCODE_BAD_PARAMETER. This method will fail with DDS_RETCODE_BAD_PARAMETER if handle is NULL.
source_timestamp<<in>> When using DDS_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS the timestamp value must be greater than or equal to the timestamp value used in the last writer operation (register, unregister, dispose, or write, with either the automatically supplied timestamp or the application-provided timestamp) However, if it is less than the timestamp of the previous operation but the difference is less than the DDS_DestinationOrderQosPolicy::source_timestamp_tolerance, the timestamp of the previous operation will be used as the source timestamp of this sample. Otherwise, if the difference is greater than DDS_DestinationOrderQosPolicy::source_timestamp_tolerance, the function will return DDS_RETCODE_BAD_PARAMETER.
Returns
One of the Standard Return Codes, DDS_RETCODE_TIMEOUT, DDS_RETCODE_OUT_OF_RESOURCES, or DDS_RETCODE_NOT_ENABLED.
See Also
FooDataWriter::write
DDSDataReader
DESTINATION_ORDER
virtual DDS_ReturnCode_t FooDataWriter::write_w_params ( const Foo instance_data,
DDS_WriteParams_t params 
)
pure virtual

Performs the same function as FooDataWriter::write and FooDataWriter::write_w_timestamp except that it also provides the values contained in params.

Allows provision of the sample identity, related sample identity, source timestamp, instance handle, and publication priority contained in params.

This operation may block and time out (DDS_RETCODE_TIMEOUT) under the same circumstances described for FooDataWriter::write.

If there are no instance resources left, this operation may fail with DDS_RETCODE_OUT_OF_RESOURCES. Calling FooDataWriter::unregister_instance_w_params may help free up some resources.

This operation may fail with DDS_RETCODE_BAD_PARAMETER under the same circumstances described for the FooDataWriter::write.

Parameters
instance_data<<in>> The data to write.
params<<inout>> The write parameters. Note that this is an inout parameter if you activate DDS_WriteParams_t::replace_auto; otherwise it won't be modified. This method will fail with DDS_RETCODE_BAD_PARAMETER if params is NULL.
Returns
One of the Standard Return Codes, DDS_RETCODE_TIMEOUT, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_NOT_ENABLED.
See Also
FooDataWriter::write
DDSDataReader
virtual DDS_ReturnCode_t FooDataWriter::dispose ( const Foo instance_data,
const DDS_InstanceHandle_t instance_handle 
)
pure virtual

Requests the middleware to delete the data.

This operation is useful only for keyed data types. Using it for non-keyed types has no effect and reports no error.

The actual deletion is postponed until there is no more use for that data in the whole system.

Applications are made aware of the deletion by means of operations on the DDSDataReader objects that already knew that instance. DDSDataReader objects that didn't know the instance will never see it.

This operation does not modify the value of the instance. The instance_data parameter is passed just for the purposes of identifying the instance.

When this operation is used, RTI Connext will automatically supply the value of the source_timestamp that is made available to DDSDataReader objects by means of the source_timestamp attribute inside the DDS_SampleInfo.

The constraints on the values of the handle parameter and the corresponding error behavior are the same specified for the FooDataWriter::unregister_instance operation.

The special value DDS_HANDLE_NIL can be used for the parameter instance_handle. This indicates the identity of the instance should be automatically deduced from the instance_data (by means of the key).

If handle is any value other than DDS_HANDLE_NIL, then it must correspond to an instance that has been registered. If there is no correspondence, the operation will fail with DDS_RETCODE_BAD_PARAMETER.

RTI Connext will not detect the error when the handle is any value other than DDS_HANDLE_NIL, corresponds to an instance that has been registered, but does not correspond to the instance deduced from the instance_data (by means of the key). RTI Connext will treat as if the dispose() operation is for the instance as indicated by the handle.

This operation may block and time out (DDS_RETCODE_TIMEOUT) under the same circumtances described for FooDataWriter::write().

If there are no instance resources left, this operation may fail with DDS_RETCODE_OUT_OF_RESOURCES. Calling FooDataWriter::unregister_instance may help freeing up some resources.

Parameters
instance_data<<in>> The data to dispose. If Foo has a key and instance_handle is DDS_HANDLE_NIL, only the fields that represent the key are examined by the function. Otherwise, instance_data is not used. If Foo has a key, instance_data can be NULL only if instance_handle is not DDS_HANDLE_NIL. Otherwise, this method will fail with DDS_RETCODE_BAD_PARAMETER.
instance_handle<<in>> Either the handle returned by a previous call to FooDataWriter::register_instance, or else the special value DDS_HANDLE_NIL. If Foo has a key and instance_handle is DDS_HANDLE_NIL, instance_handle is not used and instance is deduced from instance_data. If Foo has no key, instance_handle is not used. If handle is used, it must represent a registered instance of type Foo. Otherwise, this method fail with DDS_RETCODE_BAD_PARAMETER. This method will fail with DDS_RETCODE_BAD_PARAMETER if handle is NULL. If Foo has a key, instance_handle cannot be DDS_HANDLE_NIL if instance_data is NULL. Otherwise, this method will fail with DDS_RETCODE_BAD_PARAMETER.
Returns
One of the Standard Return Codes, DDS_RETCODE_TIMEOUT, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_NOT_ENABLED.
See Also
FooDataWriter::dispose_w_timestamp
Relationship between registration, liveliness and ownership The need for registering/unregistering instances stems from two use cases:
  • Ownership resolution on redundant systems
  • Detection of loss in topological connectivity
These two use cases also illustrate the semantic differences between the ::FooDataWriter::unregister_instance and ::FooDataWriter::dispose. BROKEN_SECTIONS
virtual DDS_ReturnCode_t FooDataWriter::dispose_w_timestamp ( const Foo instance_data,
const DDS_InstanceHandle_t instance_handle,
const DDS_Time_t source_timestamp 
)
pure virtual

Performs the same functions as dispose except that the application provides the value for the source_timestamp that is made available to DDSDataReader objects by means of the source_timestamp attribute inside the DDS_SampleInfo.

The constraints on the values of the handle parameter and the corresponding error behavior are the same specified for the FooDataWriter::dispose operation.

This operation may block and time out (DDS_RETCODE_TIMEOUT) under the same circumtances described for FooDataWriter::write.

If there are no instance resources left, this operation may fail with DDS_RETCODE_OUT_OF_RESOURCES. Calling FooDataWriter::unregister_instance may help freeing up some resources.

Parameters
instance_data<<in>> The data to dispose. If Foo has a key and instance_handle is DDS_HANDLE_NIL, only the fields that represent the key are examined by the function. Otherwise, instance_data is not used. If Foo has a key, instance_data can be NULL only if instance_handle is not DDS_HANDLE_NIL. Otherwise, this method will fail with DDS_RETCODE_BAD_PARAMETER.
handle<<in>> Either the handle returned by a previous call to FooDataWriter::register_instance, or else the special value DDS_HANDLE_NIL. If Foo has a key and handle is not DDS_HANDLE_NIL, handle must represent a registered instance of type Foo. Otherwise, this method may fail with DDS_RETCODE_BAD_PARAMETER. This method will fail with DDS_RETCODE_BAD_PARAMETER if handle is NULL.
source_timestamp<<in>> The timestamp value must be greater than or equal to the timestamp value used in the last writer operation (used in a register, unregister, dispose, or write, with either the automatically supplied timestamp or the application provided timestamp). This timestamp may potentially affect the order in which readers observe events from multiple writers. This timestamp will be available to the DDSDataReader objects by means of the source_timestamp attribute inside the DDS_SampleInfo.
Returns
One of the Standard Return Codes, DDS_RETCODE_TIMEOUT, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_NOT_ENABLED.
See Also
FooDataWriter::dispose
virtual DDS_ReturnCode_t FooDataWriter::dispose_w_params ( const Foo instance_data,
DDS_WriteParams_t params 
)
pure virtual

Performs the same function as FooDataWriter::dispose and FooDataWriter::dispose_w_timestamp except that it also provides the values contained in params.

See Also
FooDataWriter::write_w_params
virtual DDS_ReturnCode_t FooDataWriter::get_key_value ( Foo key_holder,
const DDS_InstanceHandle_t handle 
)
pure virtual

Retrieve the instance key that corresponds to an instance handle.

Useful for keyed data types.

The operation will only fill the fields that form the key inside the key_holder instance. If Foo has no key, this method has no effect and exit with no error.

For keyed data types, this operation may fail with DDS_RETCODE_BAD_PARAMETER if the handle does not correspond to an existing data-object known to the DDSDataWriter.

Parameters
key_holder<<inout>> a user data type specific key holder, whose key fields are filled by this operation. If Foo has no key, this method has no effect.

This method will fail with DDS_RETCODE_BAD_PARAMETER if key_holder is NULL.

Parameters
handle<<in>> the instance whose key is to be retrieved. If Foo has a key, handle must represent a registered instance of type Foo. Otherwise, this method will fail with DDS_RETCODE_BAD_PARAMETER. If Foo has a key and handle is DDS_HANDLE_NIL, this method will fail with DDS_RETCODE_BAD_PARAMETER. This method will fail with DDS_RETCODE_BAD_PARAMETER if handle is NULL.
Returns
One of the Standard Return Codes or DDS_RETCODE_NOT_ENABLED.
See Also
FooDataReader::get_key_value
virtual DDS_InstanceHandle_t FooDataWriter::lookup_instance ( const Foo key_holder)
pure virtual

Retrieve the instance handle that corresponds to an instance key_holder.

Useful for keyed data types.

This operation takes as a parameter an instance and returns a handle that can be used in subsequent operations that accept an instance handle as an argument. The instance parameter is only used for the purpose of examining the fields that define the key. This operation does not register the instance in question. If the instance has not been previously registered, or if for any other reason RTI Connext is unable to provide an instance handle, RTI Connext will return the special value HANDLE_NIL.

Parameters
key_holder<<in>> a user data type specific key holder.
Returns
the instance handle associated with this instance. If Foo has no key, this method has no effect and returns DDS_HANDLE_NIL

RTI Connext Traditional C++ API Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc