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

Create interface class for bathtub. #129

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

williaml33moore
Copy link
Owner

Closes #127

  • modified: src/bathtub_pkg/bathtub.svh

    • Implement new interface class, bathtub_interface.
    • Because we're implementing an interface class, methods had to become virtual.
    • Break include loops.
  • new file: src/bathtub_pkg/bathtub_interface.svh

    • New interface class for bathtub.
  • modified: src/bathtub_pkg/bathtub_pkg.svh

    • Removed step_attributes_pool_t typedef to its own file.
    • Why? I'm glad you asked.
    • It was responsible for a very tricky include loop.
    • The crux was that any file that needed something as innocuous as strings_t had to read this file, which meant it had to include step_nurture.svh, which turned out to be a six-degrees-of-separation nexus that led to a loop that could not be resolved.
    • The solution was to move step_attributes_pool_t out, with the express goal that bathtub_pkg.svh now does not include any other files.
    • Anyfile that requires a declaration in this file no longer inherits an unrelated include file with all its headaches.
  • modified: src/bathtub_pkg/bathtub_utils.svh

  • modified: src/bathtub_pkg/gherkin_document_printer/gherkin_document_printer.svh

    • Break an include loop.
  • modified: src/bathtub_pkg/gherkin_document_runner/gherkin_document_runner.svh

    • This is the one file that actually requies step_attributes_pool_t, so this file includes it directly, instead of going through bathtub_pkg.svh.
    • Break an include loop.
  • new file: src/bathtub_pkg/step_attributes_pool_t.svh

    • New file for a single typedef.
    • Seems extravagant, but that typedef is dependent on another include file that was causing trouble, so the "expense" of a new file that breaks an otherwise uncompilable loop is justified.
  • modified: test/dependency_test.py

    • Test the two new files.

- modified:   src/bathtub_pkg/bathtub.svh
  - Implement new interface class, `bathtub_interface`.
  - Because we're implementing an interface class, methods had to become virtual.
  - Break include loops.

- new file:   src/bathtub_pkg/bathtub_interface.svh
  - New interface class for `bathtub`.

- modified:   src/bathtub_pkg/bathtub_pkg.svh
  - Removed `step_attributes_pool_t` typedef to its own file.
  - Why? I'm glad you asked.
  - It was responsible for a very tricky include loop.
  - The crux was that any file that needed something as innocuous as `strings_t` had to read this file, which meant it had to include `step_nurture.svh`, which turned out to be a six-degrees-of-separation nexus that led to a loop that could not be resolved.
  - The solution was to move `step_attributes_pool_t` out, with the express goal that `bathtub_pkg.svh` now does not include any other files.
  - Anyfile that requires a declaration in this file no longer inherits an unrelated include file with all its headaches.

- modified:   src/bathtub_pkg/bathtub_utils.svh
- modified:   src/bathtub_pkg/gherkin_document_printer/gherkin_document_printer.svh
  - Break an include loop.

- modified:   src/bathtub_pkg/gherkin_document_runner/gherkin_document_runner.svh
  - This is the one file that actually requies `step_attributes_pool_t`, so this file includes it directly, instead of going through `bathtub_pkg.svh`.
  - Break an include loop.

- new file:   src/bathtub_pkg/step_attributes_pool_t.svh
  - New file for a single typedef.
  - Seems extravagant, but that typedef is dependent on another include file that was causing trouble, so the "expense" of a new file that breaks an otherwise uncompilable loop is justified.

- modified:   test/dependency_test.py
  - Test the two new files.
@williaml33moore williaml33moore linked an issue Sep 23, 2024 that may be closed by this pull request
@williaml33moore williaml33moore merged commit d63add6 into main Sep 23, 2024
@williaml33moore williaml33moore deleted the 127-bathtub_interface branch September 23, 2024 23:38
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.

Create interface class bathtub_interface
1 participant