[Draft] Dynamic Selection proposal for extra resource type #2360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Work in progress draft for adding an extra resource type to pair with a resource, which defaults to empty.
Allows passing in a vector of extra_resources to match the main resources, which can define any of 3 functions:
initialize()
- called once per extra resource during creation of the backend if definedreset()
- called once per selection to "reset" the extra resource duringinstrument_before_impl()
if definedclean_up()
- called once per extra resource when backend is destroyed if definedSelection handle contain a function
get_extra_resource()
which provide theextra_resource_t
object associated with the selected resource.If a extra resources are provided, it is passed as the second argument to the provided submit function, otherwise it is not.
So far, this only tests the case without extra resources provided. We need to test the case with extra resources as well.
(I also removed some strange formatting / unicode characters, they were causing warnings and made code difficult to read)