![]() |
OpenSplice ISO C++ 2 DCPS
v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
#include "CorePolicy.hpp"
Public Member Functions | |
Presentation (dds::core::policy::PresentationAccessScopeKind::Type access_scope=dds::core::policy::PresentationAccessScopeKind::INSTANCE, bool coherent_access=false, bool ordered_access=false) | |
Presentation (const Presentation &other) | |
Presentation & | access_scope (dds::core::policy::PresentationAccessScopeKind::Type access_scope) |
dds::core::policy::PresentationAccessScopeKind::Type | access_scope () const |
Presentation & | coherent_access (bool coherent_access) |
bool | coherent_access () const |
bool | operator!= (const Value &other) const |
D * | operator-> () |
const D * | operator-> () const |
bool | operator== (const Value &other) const |
Presentation & | ordered_access (bool ordered_access) |
bool | ordered_access () const |
Static Public Member Functions | |
static Presentation | GroupAccessScope (bool coherent_access=false, bool ordered_access=false) |
static Presentation | InstanceAccessScope (bool coherent_access=false, bool ordered_access=false) |
static Presentation | TopicAccessScope (bool coherent_access=false, bool ordered_access=false) |
This QosPolicy controls the extent to which changes to data-instances can be made dependent on each other, the order in which they need to be presented to the user and also the kind of dependencies that can be propagated and maintained by the Data Distribution Service.
Value | Meaning | Concerns | RxO | Changeable |
---|---|---|---|---|
A PresentationQosPolicyAccessScopeKind: access_scope | Specifies how the samples representing changes to data instances are presented to the subscribing application. This policy affects the application’s ability to specify and receive coherent changes and to see the relative order of changes. access_scope determines the largest scope spanning the entities for which the order and coherency of changes can be preserved. Options are INSTANCE,TOPIC and GROUP where the default is INSTANCE | Publisher, Subscriber | Yes | No |
INSTANCE | Scope spans only a single instance. Indicates that changes to one instance need not be coherent nor ordered with respect to changes to any other instance. In other words, order and coherent changes apply to each instance separately. This is the default access_scope. | |||
TOPIC | Scope spans to all instances within the same DataWriter (or DataReader), but not across instances in different DataWriter (or DataReader). | |||
GROUP | Scope spans to all instances belonging to DataWriter (or DataReader) entities within the same Publisher (or Subscriber). | |||
A boolean: coherent_access | Specifies support coherent access. That is, the ability to group a set of changes as a unit on the publishing end such that they are received as a unit at the subscribing end. The default setting of coherent_access is FALSE. | |||
A boolean: ordered_access | Specifies support for ordered access to the samples received at the subscription end. That is, the ability of the Subscriber to see changes in the same order as they occurred on the publishing end. The default setting of ordered_access is FALSE. |
This QoS policy controls the extent to which changes to data-instances can be made dependent on each other, the order in which they need to be presented to the user and also the kind of dependencies that can be propagated and maintained by the Service.
The support for ‘coherent changes’ enables a publishing application to change the value of several data-instances that could belong to the same or different topics and have those changes be seen ‘atomically’ by the readers. This is useful in cases where the values are inter-related. For example, if there are two data-instances representing the ‘altitude’ and ‘velocity vector’ of the same aircraft and both are changed, it may be useful to communicate those values in a way the reader can see both together; otherwise it may erroneously interpret that the aircraft is on a collision course. Basically this QosPolicy allows a Publisher to group a number of samples by writing them within a scope that holds a CoherentSet object and treat them as if they are to be communicated as a single message. That is, the receiver will only be able to access the data after all the modifications in the set are available at the receiver end.
Samples that belong to a (yet) unfinished coherent update consume resource limits from the receiving DataReader, but are not (yet) accessible through its history, and cannot (yet) push samples out of its history. In order for the DataReader to store samples outside its history administration, its ResourceLimitsQosPolicy should have a value for max_samples_per_instance that is bigger than the depth value of its HistoryQosPolicy.
If not enough resources are available to hold an incoming sample that belongs to an unfinshed transaction, one of the following things may happen.
A connectivity change may occur in the middle of a set of coherent changes; for example, the set of partitions used by the Publisher or one of its Subscribers may change, a late-joining DataReader may appear on the network, or a communication failure may occur. In the event that such a change prevents an entity from receiving the entire set of coherent changes, that entity must behave as if it had received none of the set.
The support for ‘ordered_access’ enables a subscribing application to view changes in the order in which they occurred. Ordering is always determined according to the applicable DestinationOrderQosPolicy setting. Depending on the selected access_scope, ordering is either on a per instance basis (this is the default behaviour, even when ordered_access is set to FALSE), on a per DataReader basis or across all DataReaders that span the Subscriber. In case of ordered_access with an acces_scope of GROUP, the Subscriber will enforce that all its DataReaders share the same DestinationOrderQosPolicy setting. The DestinationOrderQosPolicy setting of the first DataReader created for that Subscriber will then determine the DestinationOrderQosPolicy setting that is allowed for all subsequent DataReaders. Conflicting settings will result in an INCONSISTENT_POLICY error.
The PresentationQosPolicy is applicable to both Publisher and Subscriber, but behaves differently on the publishing side and the subscribing side. The setting of coherent_access on a Publisher controls whether that Publisher will preserve the coherency of changes within a scope that holds a CoherentSet object , as indicated by its access_scope and as made available by its embedded DataWriters. However, the Subscriber settings determine whether a coherent set of samples will actually be delivered to the subscribing application in a coherent way.
Coherency is implemented on top of a transaction mechanism between individual DataWriters and DataReaders; completeness of a coherent set is determined by the successful completion of each of its participating transactions. The value of the access_scope attribute determines which combination of transactions constitute the contents of a coherent set.
The setting of ordered_access has no impact on the way in which a Publisher transmits its samples (although it does influence the RxO properties of this Publisher), but basically it determines whether a Subscriber will preserve the ordering of samples when the subscribing application uses its embedded DataReaders to read or take samples:
The access_scope determines the maximum extent of coherent and/or ordered changes:
If access_scope is set to GROUP and ordered_access is set to TRUE, then ordering is maintained between samples that are written by DataWriters attached to a common Publisher and received by DataReaders attached to a common Subscriber. This way the subscribing application can access the changes as a unit and/or in the proper order. However, this does not necessarily imply that the subscribing application will indeed access the changes as a unit and/or in the correct order. For that to occur, the subscribing application must use the proper logic in accessing its datareaders:
The value offered is considered compatible with the value requested if and only if the following conditions are met:
For a DataWriter that is attached to a Publisher which has coherent-access set to TRUE and the access-scope set to TOPIC or GROUP there is a constraint on the HistoryQosPolicy. In that case the HistoryQosPolicy should be set to KEEP-ALL. This constraint is applied because for a DataWriter with a HistoryQosPolicy set to KEEP-LAST the samples in the DataWriter history may be overwritten by new samples which causes that the corresponding transaction will not become complete anymore because of the missing samples.
Definition at line 1046 of file CorePolicy.hpp.
dds::core::policy::Presentation::Presentation | ( | dds::core::policy::PresentationAccessScopeKind::Type | access_scope = dds::core::policy::PresentationAccessScopeKind::INSTANCE , |
bool | coherent_access = false , |
||
bool | ordered_access = false |
||
) |
Creates a Presentation QoS instance
access_scope | the access_scope kind |
coherent_access | the coherent_access setting |
ordered_access | the ordered_access setting |
Definition at line 643 of file CorePolicyImpl.hpp.
dds::core::policy::Presentation::Presentation | ( | const Presentation & | other | ) |
Copies a Presentation QoS instance
other | the Presentation QoS instance to copy |
Definition at line 647 of file CorePolicyImpl.hpp.
Presentation & dds::core::policy::Presentation::access_scope | ( | dds::core::policy::PresentationAccessScopeKind::Type | access_scope | ) |
Sets the access_scope kind
access_scope | the access_scope kind |
Definition at line 651 of file CorePolicyImpl.hpp.
dds::core::policy::PresentationAccessScopeKind::Type dds::core::policy::Presentation::access_scope | ( | ) | const |
Gets the access_scope kind
Definition at line 658 of file CorePolicyImpl.hpp.
Presentation & dds::core::policy::Presentation::coherent_access | ( | bool | coherent_access | ) |
Sets the coherent_access setting
coherent_access | the coherent_access setting |
Definition at line 664 of file CorePolicyImpl.hpp.
bool dds::core::policy::Presentation::coherent_access | ( | ) | const |
Gets the coherent_access setting
Definition at line 671 of file CorePolicyImpl.hpp.
|
static |
coherent_access | the coherent_access setting |
ordered_access | the ordered_access setting |
Definition at line 690 of file CorePolicyImpl.hpp.
|
static |
coherent_access | the coherent_access setting |
ordered_access | the ordered_access setting |
Definition at line 696 of file CorePolicyImpl.hpp.
|
inherited |
|
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:
|
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:
|
inherited |
Presentation & dds::core::policy::Presentation::ordered_access | ( | bool | ordered_access | ) |
Sets the ordered_access setting
ordered_access | the ordered_access setting |
Definition at line 677 of file CorePolicyImpl.hpp.
bool dds::core::policy::Presentation::ordered_access | ( | ) | const |
Gets the ordered_access setting
Definition at line 684 of file CorePolicyImpl.hpp.
|
static |
coherent_access | the coherent_access setting |
ordered_access | the ordered_access setting |
Definition at line 702 of file CorePolicyImpl.hpp.