Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use DDS_IGNORELOCAL_PROCESS with C++ API #139

Open
elfenpiff opened this issue Aug 19, 2021 · 2 comments · May be fixed by #140
Open

use DDS_IGNORELOCAL_PROCESS with C++ API #139

elfenpiff opened this issue Aug 19, 2021 · 2 comments · May be fixed by #140

Comments

@elfenpiff
Copy link
Contributor

I have a setup where I have a DDS reader and a DDS writer in the same process but would like to avoid that the DDS writer delivers to the local DDS reader.

In the C API I discovered the QoS DDS_IGNORELOCAL_PROCESS which is not supported by the C++ API. Nevertheless, I tried to apply it like the code below shows it but it does not seem to work

auto qos = ::dds::sub::qos::DataReaderQos();
auto* cqos = qos.delegate().ddsc_qos();
dds_qset_ignorelocal(cqos, DDS_IGNORELOCAL_PROCESS);
qos.delegate().ddsc_qos(cqos);

m_impl = ::dds::sub::DataReader<Mempool::Chunk>(subscriber, topic, qos);
free(cqos);

Did I use it wrongly or is the IGNORELOCAL_PROCESS QoS feature not at all supported with the C++ API? If so, is there a way to achieve the same behavior in C++?

@eboasson
Copy link
Contributor

Hi @elfenpiff, it looks like it was overlooked in the C++ API, so it needs to be added — and I have to say the workaround you tried would have been a rather nifty one if only it had worked.

In principle, adding it just means adding it to a bunch of files following the pattern set by all the other QoS settings. That is, define the policy and its settings, implement conversion routines and extend the DataReaderQos and DataWriterQos types to take in into account. What makes this a bit more complicated is that the OMG spec (which this C++ implementation follows rather closely) distinguishes between standardized interfaces and implementation-specific interfaces. I haven't yet figured out how to add an implementation-specific QoS policy in the "proper" way, or I would have made a pull request already.

A quick hack would be to add it to DataReaderQosDelegate so that it copies it in the two variants of DataReaderQosDelegate ::ddsc_qos. Then, strictly speaking, the C++ API wouldn't change but your workaround should work. If you're in a hurry, you could give that a try why I try to figure out how to add it while staying true to the spirit of the spec and this implementation.

@eboasson eboasson linked a pull request Aug 19, 2021 that will close this issue
@noaxp
Copy link

noaxp commented Nov 29, 2022

Hi @eboasson , I want to confirm the C++ API hasn't been supported, so we have to modify the implementation of DataReaderQosDelegate to achieve the behavior of IGNORELOCAL_PROCESS now?
And do we have plan to merge this pr #140?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants