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

Better handling of recursion in objectBuilder directives #695

Open
abensonca opened this issue Sep 9, 2024 · 1 comment
Open

Better handling of recursion in objectBuilder directives #695

abensonca opened this issue Sep 9, 2024 · 1 comment

Comments

@abensonca
Copy link
Collaborator

It should be possible to detect and handle recursion during construction of objects from the parameters structure in an entirely automated way.

In the functionClass-level parameters constructor:

  1. Detect if we ever return to the same node in the parameter file
    • would need a stack (that keeps a pointer to the inputParameter) for this as could go through this class multiple times in an objectBuilder
  2. If detected, return a shim version of the class that just retains a pointer to the original instance and calls the function in the original.

Would need to ensure that the pointer to the object being constructed that is set in the inputParameter node is set prior to anything else in the construction process, so that we can reference this pointer as needed.

@abensonca
Copy link
Collaborator Author

The shim class could probably then be handled automatically during deepCopy also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant