hi all!
is there a possibility to change the filter expression(i.e. the logical statement, not only the expression parameters) of a Content Filtered Topic at run time or simply disable the filtering?
Let's say I have topic which is bound to a type containing three int members. How would switching between receiving filtered samples and receiving all samples be achieved?
Thanks for your help,
Pete
Hi Pete,
You can indeed change the filter expression (and expression parameters) associated with a ContentFilteredTopic using the
set_expression()
method as explained here. This table enumerates all the supported operations you can perform once you have created a ContentFilteredTopic.Thanks,
Fernando.
This is exactly what I was looking for. Thank you very much Sir, I appreciate your accurate and fast help!
I have a related problem on the DataWriter side.
I have some topic called "LargeData" which contains data that I only want to send over the network if I have to. The default content filter will never allow any "LargeData" to be sent. However, on the reader side, I can easily compute any update the content filter which will allow specific "LargeData" through. It's more difficult to compute the content filter on the writer side.
My question is if I only update the content filter on the reader side, will this change eventually register with the writer side automatically? Or, do I have to explicitly write code on both the reader and writer side in order to update the content filter?