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

More...

#include "CorePolicy.hpp"

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

Public Member Functions

 History (dds::core::policy::HistoryKind::Type kind=dds::core::policy::HistoryKind::KEEP_LAST, int32_t depth=1)
 
 History (const History &other)
 
int32_t depth () const
 
Historydepth (int32_t depth)
 
dds::core::policy::HistoryKind::Type kind () const
 
Historykind (dds::core::policy::HistoryKind::Type kind)
 
bool operator!= (const Value &other) const
 
D * operator-> ()
 
const D * operator-> () const
 
bool operator== (const Value &other) const
 

Static Public Member Functions

static History KeepAll ()
 
static History KeepLast (uint32_t depth)
 

Detailed Description

This QosPolicy controls which samples will be stored when the value of an instance changes (one or more times) before it is finally communicated.

Attributes

Value Meaning Concerns RxO Changeable
A HistoryQosPolicyKind:
kind
Specifies specifies the type of history, which may be KEEP_LAST or KEEP_ALL. Topic, DataReader, DataWriter No No
KEEP_LAST and optional long "depth" On the publishing side, the Service will only attempt to keep the most recent “depth” samples of each instance of data (identified by its key) managed by the DataWriter. On the subscribing side, the DataReader will only attempt to keep the most recent “depth” samples received for each instance (identified by its key) until the application “takes” them via the DataReader’s take operation. KEEP_LAST is the default kind. The default value of depth is 1. If a value other than 1 is specified, it should be consistent with the settings of the RESOURCE_LIMITS QoS policy.
KEEP_ALL On the publishing side, the Service will attempt to keep all samples (representing each value written) of each instance of data (identified by its key) managed by the DataWriter until they can be delivered to all subscribers. On the subscribing side, the Service will attempt to keep all samples of each instance of data (identified by its key) managed by the DataReader. These samples are kept until the application “takes” them from the Service via the take operation. The setting of depth has no effect. Its implied value is LENGTH_UNLIMITED.
  1. This policy controls the behaviour of the Service when the value of an instance changes before it is finally communicated to some of its existing DataReader entities.
  2. If the kind is set to KEEP_LAST, then the Service will only attempt to keep the latest values of the instance and discard the older ones. In this case, the value of depth regulates the maximum number of values (up to and including the most current one) the Service will maintain and deliver. The default (and most common setting) for depth is one, indicating that only the most recent value should be delivered.
  3. If the kind is set to KEEP_ALL, then the Service will attempt to maintain and deliver all the values of the instance to existing subscribers. The resources that the Service can use to keep this history are limited by the settings of the RESOURCE_LIMITS QoS. If the limit is reached, then the behaviour of the Service will depend on the RELIABILITY QoS. If the reliability kind is BEST_EFFORT, then the old values will be discarded. If reliability is RELIABLE, then the Service will block the DataWriter until it can deliver the necessary old values to all subscribers.

The setting of HISTORY depth must be consistent with the RESOURCE_LIMITS max_samples_per_instance. For these two QoS to be consistent, they must verify that depth <= max_samples_per_instance.

Definition at line 1314 of file CorePolicy.hpp.

Constructor & Destructor Documentation

◆ History() [1/2]

dds::core::policy::History::History ( dds::core::policy::HistoryKind::Type  kind = dds::core::policy::HistoryKind::KEEP_LAST,
int32_t  depth = 1 
)

Creates a History QoS instance

Parameters
kindthe kind
depththe history depth

Definition at line 790 of file CorePolicyImpl.hpp.

◆ History() [2/2]

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

Copies a History QoS instance

Parameters
otherthe History QoS instance to copy

Definition at line 794 of file CorePolicyImpl.hpp.

Member Function Documentation

◆ depth() [1/2]

int32_t dds::core::policy::History::depth ( ) const

Gets the history depth

Returns
the history depth

Definition at line 810 of file CorePolicyImpl.hpp.

◆ depth() [2/2]

History & dds::core::policy::History::depth ( int32_t  depth)

Sets the history depth

Parameters
thehistory depth

Definition at line 816 of file CorePolicyImpl.hpp.

◆ KeepAll()

History dds::core::policy::History::KeepAll ( )
static
Returns
a History QoS instance with the kind set to KEEP_ALL

Definition at line 823 of file CorePolicyImpl.hpp.

◆ KeepLast()

History dds::core::policy::History::KeepLast ( uint32_t  depth)
static
Parameters
depththe history depth
Returns
a History QoS instance with the kind set to KEEP_LAST and the depth set to the supplied value

Definition at line 829 of file CorePolicyImpl.hpp.

◆ kind() [1/2]

dds::core::policy::HistoryKind::Type dds::core::policy::History::kind ( ) const

Gets the kind

Returns
the kind

Definition at line 797 of file CorePolicyImpl.hpp.

◆ kind() [2/2]

History & dds::core::policy::History::kind ( dds::core::policy::HistoryKind::Type  kind)

Sets the kind

Parameters
kindthe kind

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