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

why Publisher events Listener annotation? #474

Open
Autostone-c opened this issue Mar 14, 2024 · 3 comments
Open

why Publisher events Listener annotation? #474

Autostone-c opened this issue Mar 14, 2024 · 3 comments

Comments

@Autostone-c
Copy link

Autostone-c commented Mar 14, 2024

hi,When I read the code for ddscxx, I found that many of the Publisher events Listener APIs were commented out in PublisherListener.hpp. Why?Is it because these APIs are useless? Or other reasons

image

@eboasson
Copy link
Contributor

That's actually part of the documentation. If you want to use a listener you have to create your own listener class that inherits from dds::pub::PublisherListener and this example hopefully helps you get started.

@Autostone-c
Copy link
Author

这实际上是文档的一部分。如果您想使用侦听器,您必须创建自己的侦听器类并继承自该侦听器类dds::pub::PublisherListener,此示例希望可以帮助您入门。

i saw it. could you give me some examples for source code implementation

@eboasson
Copy link
Contributor

I don't quite understand what you're looking for. You should be able to take that code and create a publisher that uses that listener object. That is so straightforward you surely can't be asking for it.

Whether or not those listeners will get invoked depends on whether the writers in the publisher have listeners for the same events. If a writer has a listener for on_offered_incompatible_qos, then that listener gets invoked when a reader with an incompatible QoS setting is discovered, not the one on the publisher.

Maybe that's what you were wondering about?

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

No branches or pull requests

2 participants