You are here: Part 2: Core Concepts > Receiving Data > Subscribers > Beginning and Ending Group-Ordered Access

Beginning and Ending Group-Ordered Access

The Subscriber’s begin_access() operation indicates that the application is about to access the DDS data samples in any of the DataReaders attached to the Subscriber.

If the Subscriber’s access_scope (in the PRESENTATION QosPolicy) is GROUP or HIGHEST_OFFERED and ordered_access (also in the PRESENTATION QosPolicy) is TRUE, the application is required to use this operation to access the DDS samples in order across DataWriters of the same group (Publisher with access_scope GROUP).

In the above case, begin_access() must be called prior to calling any of the sample-accessing operations: get_datareaders() on the Subscriber, and read(), take(), read_w_condition(), and take_w_condition() on any DataReader.

Once the application has finished accessing the DDS data samples, it must call end_access().

The application is not required to call begin_access() and end_access() to access the DDS samples in order if the Publisher’s access_scope is something other than GROUP. In this case, calling begin_access() and end_access() is not considered an error and has no effect.

Calls to begin_access() and end_access() may be nested and must be balanced. That is, end_access() close a previous call to begin_access().

© 2016 RTI