OpenSplice ISO C++ 2 DCPS  v7.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
dds::core::policy::ReaderDataLifecycle Class Reference

More...

#include "CorePolicy.hpp"

Inheritance diagram for dds::core::policy::ReaderDataLifecycle:
Inheritance graph

Public Member Functions

 ReaderDataLifecycle (const dds::core::Duration &autopurge_nowriter_samples_delay=dds::core::Duration::infinite(), const dds::core::Duration &autopurge_disposed_samples_delay=dds::core::Duration::infinite())
 
 ReaderDataLifecycle (const ReaderDataLifecycle &other)
 
bool autopurge_dispose_all () const
 
void autopurge_dispose_all (bool b)
 
const dds::core::Duration autopurge_disposed_samples_delay () const
 
ReaderDataLifecycleautopurge_disposed_samples_delay (const dds::core::Duration &autopurge_disposed_samples_delay)
 
const dds::core::Duration autopurge_nowriter_samples_delay () const
 
ReaderDataLifecycleautopurge_nowriter_samples_delay (const dds::core::Duration &autopurge_nowriter_samples_delay)
 
org::opensplice::core::policy::InvalidSampleVisibility::Type invalid_sample_visibility () const
 
void invalid_sample_visibility (org::opensplice::core::policy::InvalidSampleVisibility::Type visibility)
 
bool operator!= (const Value &other) const
 
D * operator-> ()
 
const D * operator-> () const
 
bool operator== (const Value &other) const
 

Static Public Member Functions

static ReaderDataLifecycle AutoPurgeDisposedSamples (const dds::core::Duration &autopurge_disposed_samples_delay)
 
static ReaderDataLifecycle NoAutoPurgeDisposedSamples ()
 

Detailed Description

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.

Definition at line 820 of file CorePolicy.hpp.

Constructor & Destructor Documentation

◆ ReaderDataLifecycle() [1/2]

dds::core::policy::ReaderDataLifecycle::ReaderDataLifecycle ( const dds::core::Duration autopurge_nowriter_samples_delay = dds::core::Duration::infinite(),
const dds::core::Duration autopurge_disposed_samples_delay = dds::core::Duration::infinite() 
)

Creates a ReaderDataLifecycle QoS instance

Parameters
autopurge_nowriter_samples_delaythe autopurge nowriter samples delay
autopurge_disposed_samples_delaythe autopurge disposed samples delay

Definition at line 551 of file CorePolicyImpl.hpp.

◆ ReaderDataLifecycle() [2/2]

dds::core::policy::ReaderDataLifecycle::ReaderDataLifecycle ( const ReaderDataLifecycle other)

Copies a ReaderDataLifecycle QoS instance

Parameters
otherthe ReaderDataLifecycle QoS instance to copy

Definition at line 555 of file CorePolicyImpl.hpp.

Member Function Documentation

◆ autopurge_dispose_all() [1/2]

bool dds::core::policy::ReaderDataLifecycle::autopurge_dispose_all ( ) const

Gets the autopurge_dispose_all

Note
This is a proprietary OpenSplice extension.

Call
This is a proprietary operation and can be called by using the operator->.

Returns
the autopurge on/off with disposed all

◆ autopurge_dispose_all() [2/2]

void dds::core::policy::ReaderDataLifecycle::autopurge_dispose_all ( bool  b)

Sets the autopurge_dispose_all

Note
This is a proprietary OpenSplice extension.

Determines whether all samples in the DataReader will be purged automatically when a dds::topic::AnyTopic::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.

Call
This is a proprietary operation and can be called by using the operator->.

Parameters
bautopurge on/off with dispose all

◆ autopurge_disposed_samples_delay() [1/2]

const dds::core::Duration dds::core::policy::ReaderDataLifecycle::autopurge_disposed_samples_delay ( ) const

Gets the autopurge_disposed_samples_delay

Returns
the autopurge disposed samples delay

Definition at line 572 of file CorePolicyImpl.hpp.

◆ autopurge_disposed_samples_delay() [2/2]

ReaderDataLifecycle & dds::core::policy::ReaderDataLifecycle::autopurge_disposed_samples_delay ( const dds::core::Duration autopurge_disposed_samples_delay)

Sets the autopurge_disposed_samples_delay

Returns
the autopurge disposed samples delay

Definition at line 578 of file CorePolicyImpl.hpp.

◆ autopurge_nowriter_samples_delay() [1/2]

const dds::core::Duration dds::core::policy::ReaderDataLifecycle::autopurge_nowriter_samples_delay ( ) const

Gets the autopurge nowriter samples delay

Returns
the autopurge nowriter samples delay

Definition at line 559 of file CorePolicyImpl.hpp.

◆ autopurge_nowriter_samples_delay() [2/2]

ReaderDataLifecycle & dds::core::policy::ReaderDataLifecycle::autopurge_nowriter_samples_delay ( const dds::core::Duration autopurge_nowriter_samples_delay)

Sets the autopurge nowriter samples delay

Parameters
autopurge_nowriter_samples_delaythe autopurge nowriter samples delay

Definition at line 565 of file CorePolicyImpl.hpp.

◆ AutoPurgeDisposedSamples()

ReaderDataLifecycle dds::core::policy::ReaderDataLifecycle::AutoPurgeDisposedSamples ( const dds::core::Duration autopurge_disposed_samples_delay)
static
Parameters
autopurge_disposed_samples_delaythe autopurge disposed samples delay
Returns
a ReaderDataLifecycle QoS instance with autopurge_disposed_samples_delay set to a specified value

Definition at line 591 of file CorePolicyImpl.hpp.

◆ invalid_sample_visibility() [1/2]

org::opensplice::core::policy::InvalidSampleVisibility::Type dds::core::policy::ReaderDataLifecycle::invalid_sample_visibility ( ) const

Gets the invalid_sample_visibility

Note
This is a proprietary OpenSplice extension.

Call
This is a proprietary operation and can be called by using the operator->.

Returns
the invalid samples visibility

◆ invalid_sample_visibility() [2/2]

void dds::core::policy::ReaderDataLifecycle::invalid_sample_visibility ( org::opensplice::core::policy::InvalidSampleVisibility::Type  visibility)

Sets the invalid_sample_visibility

Note
This is a proprietary OpenSplice extension.

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.

Call
This is a proprietary operation and can be called by using the operator->.

Parameters
visibilitythe invalid samples visibility

◆ NoAutoPurgeDisposedSamples()

ReaderDataLifecycle dds::core::policy::ReaderDataLifecycle::NoAutoPurgeDisposedSamples ( )
static
Returns
a ReaderDataLifecycle QoS instance which will not autopurge disposed samples

Definition at line 585 of file CorePolicyImpl.hpp.

◆ operator!=()

template<typename D >
bool dds::core::Value< D >::operator!= ( const Value< D > &  other) const
inherited

Compare this Value with another Value

Parameters
otherValue
Returns
true if not equal

Definition at line 99 of file Value.hpp.

◆ operator->() [1/2]

template<typename D >
D * dds::core::Value< D >::operator-> ( )
inherited

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();
Returns
a reference to delegate.

Definition at line 111 of file Value.hpp.

◆ operator->() [2/2]

template<typename D >
const D * dds::core::Value< D >::operator-> ( ) const
inherited

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();
Returns
a reference to delegate.

Definition at line 105 of file Value.hpp.

◆ operator==()

template<typename D >
bool dds::core::Value< D >::operator== ( const Value< D > &  other) const
inherited

Compare this Value with another Value

Parameters
otherValue
Returns
true if equal

Definition at line 93 of file Value.hpp.


The documentation for this class was generated from the following files: