1505 Generalise Parameter Access#1647
Merged
Merged
Conversation
6e50974 to
10526bb
Compare
10526bb to
fed1682
Compare
rhinoella
approved these changes
Sep 8, 2023
Contributor
rhinoella
left a comment
There was a problem hiding this comment.
All looks great, it really cleans up the code nicely.
rprospero
pushed a commit
that referenced
this pull request
Mar 11, 2024
rprospero
pushed a commit
that referenced
this pull request
Apr 8, 2024
rprospero
pushed a commit
that referenced
this pull request
Apr 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR simplifies parameter (
ExpressionVariable) creation, storage, and handling, moving it all to theProcedureNodebase class rather than requiring override functions in any node type that required to use them.To handle the automatic prefixing of
ExpressionVariablesin theparameters_vector with the node's name (necessitating keeping a record of the original name), a couple of approaches were initially tried and discounted:parameters_fromstd::vector<std::shared_ptr<ExpressionVariable>>tostd::vector<std::pair<std::shared_ptr<ExpressionVariable>,std::string>>with the string component storing the original, base name of the variable for reference - this has the effect of "polluting" a lot of other routines using the parameters, and so was abandoned..(if it existed). However this didn't feel particularly robust and required other routines to determine whether or not a prefix existed.So, the preferred solution in the end was to extend
ExpressionVariableto keep track of both it's original name and any applied prefix. This way, impact on the rest of the code is kept to a minimum.Closes #1505.