RTI Connext Modern C++ API Version 7.2.0
dds::sub::CoherentAccess Class Reference

<<value-type>> Controls whether RTI Connext will preserve the groupings of changes made by the publishing application by means of begin_coherent_changes and end_coherent_changes. More...

#include "dds/sub/CoherentAccess.hpp"

Public Member Functions

 CoherentAccess (const dds::sub::Subscriber &sub)
 Creating a CoherentAccess object indicates that the application is about to access the data samples in any of the DataReader objects attached to the provided Subscriber. More...
 
void end ()
 Explicitly indicate that the application has finished accessing the data samples in DataReader objects managed by the Subscriber.
More...
 
 ~CoherentAccess ()
 The destructor implicitly ends coherent access. More...
 

Detailed Description

<<value-type>> Controls whether RTI Connext will preserve the groupings of changes made by the publishing application by means of begin_coherent_changes and end_coherent_changes.

Constructor & Destructor Documentation

◆ CoherentAccess()

dds::sub::CoherentAccess::CoherentAccess ( const dds::sub::Subscriber sub)
inlineexplicit

Creating a CoherentAccess object indicates that the application is about to access the data samples in any of the DataReader objects attached to the provided Subscriber.

If the dds::core::policy::Presentation::access_scope of the dds::sub::Subscriber is dds::core::policy::PresentationAccessScopeKind_def::GROUP or dds::core::policy::PresentationAccessScopeKind_def::HIGHEST_OFFERED and dds::core::policy::Presentation::ordered_access is true, the application is required to use this operation to access the samples in order across DataWriters of the same group (dds::pub::Publisher with dds::core::policy::Presentation::access_scope set to dds::core::policy::PresentationAccessScopeKind_def::GROUP).

In the above case, this operation must be called prior to calling any of the sample-accessing operations, or dds::sub::find

Once the application has finished accessing the data samples, it must call dds::sub::CoherentAccess::end() or let this object be destroyed.

The application is not required to call dds::sub::CoherentAccess::CoherentAccess() / dds::sub::CoherentAccess::end() to access the samples in order if the PRESENTATION policy in the dds::pub::Publisher has dds::core::policy::Presentation::access_scope set to something other than dds::core::policy::PresentationAccessScopeKind_def::GROUP. In this case, calling dds::sub::CoherentAccess::CoherentAccess() / dds::sub::CoherentAccess::end() is not considered an error and has no effect.

Calls to dds::sub::CoherentAccess::CoherentAccess() / dds::sub::CoherentAccess::end() may be nested and must be balanced.

Exceptions
Oneof the Standard Exceptions or dds::core::NotEnabledError.
See also
Access to data samples
dds::sub::find
PRESENTATION

◆ ~CoherentAccess()

dds::sub::CoherentAccess::~CoherentAccess ( )
inline

The destructor implicitly ends coherent access.

See also
end()

Member Function Documentation

◆ end()

void dds::sub::CoherentAccess::end ( )
inline

Explicitly indicate that the application has finished accessing the data samples in DataReader objects managed by the Subscriber.

This operation must be used to close a corresponding begin_access().

This call must close a previous call to dds::sub::CoherentAccess::CoherentAccess()(), otherwise the operation will fail with the error dds::core::PreconditionNotMetError.

Exceptions
Oneof the Standard Exceptions or dds::core::PreconditionNotMetError or dds::core::NotEnabledError.