-
Notifications
You must be signed in to change notification settings - Fork 16
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
1637 dynamic keywords #1766
1637 dynamic keywords #1766
Conversation
No keywords were ever *added* to the list, so we do not need all the infrastructure to remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confess I'm a little confused why the const_cast
and the conversion to a pointer is necessary since, as far as I can see, the CoreData
reference was passed non-const down the chain anyway. Indeed I just tried to revert that change locally (i.e. go back to OptionalReferenceWrapper<CoreData>
) for both models and all seems to work as expected...
src/classes/coreData.h
Outdated
@@ -254,4 +254,5 @@ class CoreData | |||
void removeReferencesTo(Configuration *data); | |||
void removeReferencesTo(Species *data); | |||
void removeReferencesTo(SpeciesSite *data); | |||
void removeReferencesTo(Isotopologue *data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pedantic as I am I would move this up a few lines so as to make the "list" alphabetical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only did I move Isotopologue up a few lines, I also moved Module down a few lines. That leaves gets the whole thing alphabetised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Also agree with what @trisyoungs mentioned regarding the const_cast
Co-authored-by: Tristan Youngs <tristan.youngs@stfc.ac.uk>
…s/dissolve into 1637-dynamic-keywords
Co-authored-by: Tristan Youngs <tristan.youngs@stfc.ac.uk>
The primary change here is that every keyword is now contained within a specific KeywordStore. There is no longer a static singleton vector in either KeywordBase or in KeywordStore. This leads to a couple of other changes.
objectNoLongerValid
function incoreData.cpp
. This is now a function in the module and not a private function in the class because it needs access to the Module and ModuleLayer classes in order to be built. This wouldn't be an issue, but it's a template function, so leaving it in the.h
file creates an import loop.OptionalReferenceWrapper<const CoreData>
toCore Data*
. I did use aconst_cast
inlayerFuncs.cpp
rather than update the entire call chain to provide a mutableCoreData
reference, but I'm willing to change this if other people find it upsetting.This closes #1637