Where is state between DataReader::read() calls stored? #4015
Replies: 2 comments 2 replies
-
As you can read in our documentation, there are two ways of accessing data: The first one allows the user to peek into the head of the queue. If the application needs to peek at unread data, setting the fourth argument of
This is stored internally in the DataReader. If you are curious and want to take a look at the code, it is stored in this attribute of |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have a data reader with TopicQos and DataReaderQos configured DurabilityQosPolicyKind=TRANSIENT_LOCAL_DURABILITY_QOS and a history depth > 1. In general, accessing the history via the DataReader::read() method works quite well, however, when limiting the number of samples e.g. to 1 I always (and only) get the first sample stored in the data reader's history.
I have tried calling DataReader::read() multiple times, with or without returning the loan, with the same LoanableCollection instance or with different ones for each call. However, I can still exclusively access the first sample in the history.
I was wondering
a) what I might be doing wrong and
b) where the state, which samples have already been read ist actually stored... In the LoanableCollections? I the data reader?
Thank you in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions