Jump to content
OpenSplice DDS Forum
burnout

DataReader settings for first read opeartion

Recommended Posts

Hi all!

 

In my application I require that the just created DataReader(s) with a listener attached (that for the moment, has only the method on_data_available implemented), do not automatically read the samples that were previously written by a DataWriter (because I have to implement a dedicated procedure for doing it).

 

What is the best solution for accomplish it ?

 

Thanks in advance for every answer I will receive,

 

Regards

 

G.

Share this post


Link to post
Share on other sites

Hi

To help us understand the requirements a bit better, do you mean you want to read the historical data with a different mechanism to that of the "live" volatile data?  All of the data (both volatile and transient/persistent) is presented in the same way at the reader so I'm not sure about that, but if the historitcal data refers to a different DDS instance to the "live" data, the take/read_instance() functions could be useful to retrieve samples from those specific instances

 

Hope that helps,

James

Share this post


Link to post
Share on other sites

Hi you! Thanks for the answer.

 

What I want, is that as a new DataReader is created, and I attached a dedicated listener (that just execute a read operation on the on_data_available method), in case I have some sample previously written, this DataReader does not read these samples automatically ( I have to implement a dedicated function to accomplish it ).

 

I don't know if what I want is reachable with the settings of the policies of the topic, or in some other ways.

 

do you mean you want to read the historical data with a different mechanism to that of the "live" volatile data?

 

Yes, it's actually what I have to obtain: a function that ask for the samples (persistent/transient, doesn't change) written prior the creation of the DataReader. But this is not hard to implement, I can just do a read operation only once.

 

About the instance, what do you mean ? If I understood your point, I don't have a precise indication which instance is historical and which is not...or, is it possible to have it ? It would solve my problem...  

 

I hope I have been more clear this time, in case it doesn't don o hesitate to ask further explanations.

 

Cheers

 

G.

Share this post


Link to post
Share on other sites

Hi 'G',

 

Maybe a solution would be to create a volatile reader rather than a transient (or persistent) reader for the data.

If you'd create such a volatile reader, no historical data will be provided unless you specifically call wait_for_historical_data().

 

-Hans

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×