OpenSplice C# API  v6.x
OpenSplice C# Data Distribution Service Data-Centric Publish-Subscribe API
Reader Data Lifecycle QoS

This QosPolicy specifies the maximum duration for which the DataReader will maintain information regarding a data instance for which the instance_state becomes either NOT_ALIVE_NO_WRITERS_INSTANCE_STATE or NOT_ALIVE_DISPOSED_INSTANCE_STATE.

Attributes

Value Meaning Concerns RxO Changeable
A duration:
autopurge_nowriter_samples_delay
specifies the duration for which the DataReader will maintain information regarding a data instance for which the instance_state becomes NOT_ALIVE_NO_WRITERS_INSTANCE_STATE. By default the duration value is DURATION_INFINITE. When the delay time has expired, the data instance is marked so that it can be purged in the next garbage collection sweep. DataReader N/A Yes
A duration:
autopurge_disposed_samples_delay
specifies the duration for which the DataReader will maintain information regarding a data instance for which the instance_state becomes NOT_ALIVE_DISPOSED_INSTANCE_STATE. By default the duration value is DURATION_INFINITE. When the delay time has expired, the data instance is marked so that it can be purged in the next garbage collection sweep.
A boolean:
autopurge_dispose_all
Determines whether all samples in the DataReader will be purged automatically when a dispose_all_data() call is performed on the Topic that is associated with the DataReader. If this attribute set to TRUE, no more samples will exist in the DataReader after the dispose_all_data has been processed. Because all samples are purged, no data available events will be notified to potential Listeners or Conditions that are set for the DataReader. If this attribute is set to FALSE, the dispose_all_data() behaves as if each individual instance was disposed separately.
A boolean:
enable_invalid_samples
Insert dummy samples if no data sample is available to notify readers of an instance state change. By default the value is TRUE.
NOTE: This feature is deprecated. It is recommended that you use invalid_sample_visibility instead
An InvalidSampleVisibilityQosPolicy:
invalid_sample_visibility
Insert dummy samples if no data sample is available, to notify readers of an instance state change. By default the value is MINIMUM_INVALID_SAMPLES. Options are NO_INVALID_SAMPLES, MINIMUM_INVALID_SAMPLES, ALL_INVALID_SAMPLES

This QosPolicy specifies the maximum duration for which the DataReader will maintain information regarding a data instance for which the instance_state becomes either NOT_ALIVE_NO_WRITERS_INSTANCE_STATE or NOT_ALIVE_DISPOSED_INSTANCE_STATE. The DataReader manages resources for instances and samples of those instances. The amount of resources managed depends on other QosPolicies like the HistoryQosPolicy and the ResourceLimitsQosPolicy. The DataReader can only release resources for data instances for which all samples have been taken and the instance_state has become NOT_ALIVE_NO_WRITERS_INSTANCE_STATE or NOT_ALIVE_DISPOSED_INSTANCE_STATE. If an application does not take the samples belonging to a data instance with such an instance_state, the DataReader will never be able to release the maintained resources. The application can use this QosPolicy to instruct the DataReader to release all resources related to the relevant data instance after a specified duration.

There is one exception to this rule. If the autopurge_dispose_all attribute is TRUE, the maintained resources in the DataReader are cleaned up immediately in case dispose_all_data() is called on the Topic that is associated with the DataReader. Instance state changes are communicated to a DataReader by means of the SampleInfo accompanying a data sample. If no samples are available in the DataReader, a so-called ‘invalid sample’ can be injected with the sole purpose of notifying applications of the instance state. This behaviour is configured by the InvalidSampleVisibilityQosPolicy.

  • If invalid_sample_visibility is set to NO_INVALID_SAMPLES, applications will be notified of instance_state changes only if there is a sample available in the DataReader. The SampleInfo belonging to this sample will contain the updated instance state.
  • If invalid_sample_visibility is set to MINIMUM_INVALID_SAMPLES, the middleware will try to update the instance_state on available samples in the DataReader. If no sample is available, an invalid sample will be injected. These samples contain only the key values of the instance. The SampleInfo for invalid samples will have the ‘valid_data’ flag disabled, and contain the updated instance state.
  • If invalid_sample_visibility is set to ALL_INVALID_SAMPLES, every change in the instance_state will be communicated by a separate invalid sample. NOTE: This value (ALL_INVALID_SAMPLES) is not yet implemented. It is scheduled for a future release.

An alternative but deprecated way to determine the visibility of state changes is to set a boolean value for the enable_invalid_samples field.

  • When TRUE, the behavior is similar to the MINIMUM_INVALID_SAMPLES value of the InvalidSampleVisibilityQosPolicy field.
  • When FALSE, the behavior is similar to the NO_INVALID_SAMPLES value of the InvalidSampleVisibilityQosPolicy field.

You cannot set both the the enable_invalid_samples field AND the invalid_sample_visibility field. If both deviate from their factory default, this is considered a RETCODE_INCONSISTENT_POLICY. If only one of the fields deviates from its factory default, then that setting will be leading. However, modifying the default value of the enable_invalid_samples field will automatically result in a warning message stating that you are using deprecated functionality. This QosPolicy is applicable to a DataReader only. After enabling the relevant DataReader, this QosPolicy can be changed using the set_qos operation.