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

[cmd] Add interruptor parameter to onCommandInterrupt callbacks #5461

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

KangarooKoala
Copy link
Contributor

Fixes #5301

Notes:

  • Java stores the Optional.empty() instance since each call could potentially allocate a new instance. (There is no guarantee it is a singleton) This is not a problem for C++, which simply uses the std::nullopt constant.
  • Java uses two separate lists for the toCancel queue to avoid allocating instances with both objects. This is not a problem for C++, which uses std::pair which does not allocate a new object (to my understanding).

@KangarooKoala KangarooKoala requested a review from a team as a code owner July 20, 2023 03:27
@KangarooKoala KangarooKoala changed the title Add interruptor parameter to onCommandInterrupt callbacks [cmd] Add interruptor parameter to onCommandInterrupt callbacks Aug 23, 2023
@PeterJohnson PeterJohnson merged commit b265a68 into wpilibsuite:main Sep 18, 2023
21 checks passed
@KangarooKoala KangarooKoala deleted the cmd-callbacks branch September 18, 2023 03:51
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 this pull request may close these issues.

CommandScheduler.onInterrupt: accept interrupting command
4 participants