Skip to content

Rewrite InterruptHandler to use RAII - #80

Open
Petronous wants to merge 3 commits into
developmentfrom
raii-interrupt
Open

Rewrite InterruptHandler to use RAII#80
Petronous wants to merge 3 commits into
developmentfrom
raii-interrupt

Conversation

@Petronous

@Petronous Petronous commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Also allows recursive usage without the different levels knowing about each other, by moving the "old" fields into the instantiated object, where they always restore to the previous state in a stack-like manner. Tested quite thoroughly in the Transpose Example.

The previous version was poorly made:

  • difficult to make sure that the handler actually cleans up under all circumstances
  • no new Register calls could be made in between the first Register and Unregister without breaking the class, this would force any lower scope to worry about what the upper scopes did

And so I felt a rewrite was necessary

Also allows recursive usage without the different levels knowing about each other, by moving the "old" fields into the instantiated object.
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.

1 participant