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

QoS Policy for automatically remove samples from the DataReader after a specified timeout. More...

#include "ProprietaryApi.hpp"

Inheritance diagram for org::opensplice::core::policy::ReaderLifespan:
Inheritance graph

Public Member Functions

 ReaderLifespan ()
 
 ReaderLifespan (bool used, const dds::core::Duration &duration)
 
 ReaderLifespan (const ReaderLifespan &other)
 
ReaderLifespanduration (const dds::core::Duration &duration)
 
const dds::core::Duration duration () const
 
bool operator!= (const Value &other) const
 
D * operator-> ()
 
const D * operator-> () const
 
bool operator== (const Value &other) const
 
ReaderLifespanused (bool used)
 
bool used () const
 

Detailed Description

QoS Policy for automatically remove samples from the DataReader after a specified timeout.

This QosPolicy is similar to the Lifespan QosPolicy (applicable to Topic and DataWriter), but limited to the DataReader on which the QosPolicy is applied. The data is automatically removed from the DataReader if it has not been taken yet after the lifespan duration expires. The duration of the ReaderLifespan is added to the insertion time of the data in the DataReader to determine the expiry time.

When both the ReaderLifespan QosPolicy and a DataWriter’s Lifespan QosPolicy are applied to the same data, only the earliest expiry time is taken into account.

By default, the ReaderLifespan QosPolicy is not used and use_lifespan is FALSE.
The duration is set to dds::core::Duration::infinite().

This QosPolicy is applicable to a DataReader only, and is mutable even when the DataReader is already enabled. If modified, the new setting will only be applied to samples that are received after the modification took place.

Definition at line 969 of file ProprietaryApi.hpp.

Constructor & Destructor Documentation

◆ ReaderLifespan() [1/3]

org::opensplice::core::policy::ReaderLifespan::ReaderLifespan ( )

Creates a ReaderLifespan QoS Policy instance

◆ ReaderLifespan() [2/3]

org::opensplice::core::policy::ReaderLifespan::ReaderLifespan ( bool  used,
const dds::core::Duration duration 
)
explicit

Creates a ReaderLifespan QoS Policy instance

Parameters
usedIndicates ReaderLifespan is used
durationReaderLifespan expiration duration

◆ ReaderLifespan() [3/3]

org::opensplice::core::policy::ReaderLifespan::ReaderLifespan ( const ReaderLifespan other)

Copies a Lifespan QoS Policy instance

Parameters
otherthe Lifespan QoS instance to copy

Member Function Documentation

◆ duration() [1/2]

ReaderLifespan& org::opensplice::core::policy::ReaderLifespan::duration ( const dds::core::Duration duration)

Sets the expiration duration

Parameters
durationexpiration duration

◆ duration() [2/2]

const dds::core::Duration org::opensplice::core::policy::ReaderLifespan::duration ( ) const

Gets the expiration duration

Returns
expiration duration

◆ 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.

◆ used() [1/2]

ReaderLifespan& org::opensplice::core::policy::ReaderLifespan::used ( bool  used)

Sets the used flag

Parameters
theused flag

◆ used() [2/2]

bool org::opensplice::core::policy::ReaderLifespan::used ( ) const

Gets the used flag

Returns
true if used

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