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

More...

#include "CorePolicy.hpp"

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

Public Member Functions

 Lifespan (const dds::core::Duration &duration=dds::core::Duration::infinite())
 
 Lifespan (const Lifespan &other)
 
Lifespanduration (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
 

Detailed Description

This QosPolicy specifies the duration of the validity of the data written by the DataWriter.

Attributes

Value Meaning Concerns RxO Changeable
A duration:
duration
Specifies the maximum duration of validity of the data written by the DataWriter. The default value of the lifespan duration is infinite. Topic, DataWriter N/A Yes

The purpose of this QoS is to avoid delivering "stale" data to the application. Each data sample written by the DataWriter has an associated ‘expiration time’ beyond which the data should not be delivered to any application. Once the sample expires, the data will be removed from the DataReader caches as well as from the transient and persistent information caches. The ‘expiration time’ of each sample is computed by adding the duration specified by the LIFESPAN QoS to the source timestamp. This QoS relies on the sender and receiving applications having their clocks sufficiently synchronized. If this is not the case and the Service can detect it, the DataReader is allowed to use the reception timestamp instead of the source timestamp in its computation of the ‘expiration time.’

Definition at line 371 of file CorePolicy.hpp.

Constructor & Destructor Documentation

◆ Lifespan() [1/2]

dds::core::policy::Lifespan::Lifespan ( const dds::core::Duration duration = dds::core::Duration::infinite())
explicit

Creates a Lifespan QoS instance

Parameters
durationLifespan expiration duration

Definition at line 337 of file CorePolicyImpl.hpp.

◆ Lifespan() [2/2]

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

Copies a Lifespan QoS instance

Parameters
otherthe Lifespan QoS instance to copy

Definition at line 340 of file CorePolicyImpl.hpp.

Member Function Documentation

◆ duration() [1/2]

Lifespan & dds::core::policy::Lifespan::duration ( const dds::core::Duration duration)

Sets the expiration duration

Parameters
durationexpiration duration

Definition at line 343 of file CorePolicyImpl.hpp.

◆ duration() [2/2]

const dds::core::Duration dds::core::policy::Lifespan::duration ( ) const

Gets the expiration duration

Returns
expiration duration

Definition at line 350 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: