Skip to main content

dds_dispose

Function dds_dispose 

Source
pub unsafe extern "C" fn dds_dispose(
    writer: dds_entity_t,
    data: *const c_void,
) -> dds_return_t
Expand description

@brief This operation disposes an instance, identified by the data sample. @ingroup writing @component write_data

This operation requests the Data Distribution Service to modify the instance and mark it for deletion. Copies of the instance and its corresponding samples, which are stored in every connected reader and, dependent on the QoS policy settings (also in the Transient and Persistent stores) will be modified and marked for deletion by setting their dds_instance_state_t to DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE.

@par Blocking If the history QoS policy is set to DDS_HISTORY_KEEP_ALL, the dds_writedispose operation on the writer may block if the modification would cause data to be lost because one of the limits, specified in the resource_limits QoS policy, to be exceeded. In case the synchronous attribute value of the reliability Qos policy is set to true for communicating writers and readers then the writer will wait until all synchronous readers have acknowledged the data. Under these circumstances, the max_blocking_time attribute of the reliability QoS policy configures the maximum time the dds_writedispose operation may block. If max_blocking_time elapses before the writer is able to store the modification without exceeding the limits and all expected acknowledgements are received, the dds_writedispose operation will fail and returns DDS_RETCODE_TIMEOUT.

@param[in] writer The writer to dispose the data instance from. @param[in] data The data sample that identifies the instance to be disposed.

@returns A dds_return_t indicating success or failure.

@retval DDS_RETCODE_OK The sample is written and the instance is marked for deletion. @retval DDS_RETCODE_ERROR An internal error has occurred. @retval DDS_RETCODE_BAD_PARAMETER At least one of the arguments is invalid. @retval DDS_RETCODE_ILLEGAL_OPERATION The operation is invoked on an inappropriate object. @retval DDS_RETCODE_ALREADY_DELETED The entity has already been deleted. @retval DDS_RETCODE_TIMEOUT Either the current action overflowed the available resources as specified by the combination of the reliability QoS policy, history QoS policy and resource_limits QoS policy, or the current action was waiting for data delivery acknowledgement by synchronous readers. This caused blocking of this operation, which could not be resolved before max_blocking_time of the reliability QoS policy elapsed.