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

Updater::add to take ownership of FunctionDiagnosticTask #309

Open
russkel opened this issue Jul 31, 2023 · 2 comments
Open

Updater::add to take ownership of FunctionDiagnosticTask #309

russkel opened this issue Jul 31, 2023 · 2 comments
Labels
needs more work Someone has worked on this but more work is needed

Comments

@russkel
Copy link

russkel commented Jul 31, 2023

I believe this should probably be supported:

  diagnostic_updater::FunctionDiagnosticTask helm_diag(
          "Helm", [&helm_report](diagnostic_updater::DiagnosticStatusWrapper & stat) {
              stat.add("Modes", helm_report.getModeSummary());
              stat.add("Halted", helm_report.getHalted());
          });

  diag_updater->add(std::move(helm_diag));

Unfortunately, this doesn't work and segfaults when helm_diag goes out of scope.

@russkel russkel changed the title Updater::add to accept lambdas Updater::add to take ownership of FunctionDiagnosticTask Jul 31, 2023
@ct2034
Copy link
Collaborator

ct2034 commented Sep 26, 2023

Thanks for your issue, @russkel.
Could you please describe what you are trying to achieve in more detail? What is ivp_diag?
Please feel free to provide a test that and / or implementation in a pull request.

@ct2034 ct2034 added the needs more work Someone has worked on this but more work is needed label Sep 26, 2023
@russkel
Copy link
Author

russkel commented Sep 27, 2023

What is ivp_diag?

A mistake in my copy and paste, apologies. It should be helm_diag.

Please feel free to provide a test that and / or implementation in a pull request.

Okay. We (my colleague and I) were a bit surprised by the interface to the diagnostic_updater and felt it could probably be easier. We hope to improve this or at the very least have specific feature requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more work Someone has worked on this but more work is needed
Projects
None yet
Development

No branches or pull requests

2 participants