-
Notifications
You must be signed in to change notification settings - Fork 319
Action register #935
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
Action register #935
Conversation
src/core/ActionRegister.h
Outdated
| #include <memory> | ||
|
|
||
| namespace PLMD { | ||
| namespace PLMD { //{ |
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.
@Iximiel why this additional open brace after the comment?
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'm not a vim user, but is what I understood to do from this
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.
That's only for macros. Here the braces are already available, vim can match them.
|
@Iximiel I do not understand the removal of the quotes. Is it to allow multiple names for multiple registrations? Notice that this has two negative effects:
I think using the line number to distinguish the two names (as it is now) is a cleaner solution. |
src/core/ActionRegister.h
Outdated
| //and the next template will be template<ActionType ActionType> | ||
|
|
||
| template<typename ActionClass> | ||
| class plumedRegisterer{ |
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.
We usually use capital letters for classes (PlumedRegisterer)
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 corrected that in the fourth commit, is that not up?
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.
Maybe I was reviewing an older commit sorry for this
|
Yes, I wanted to allow multiple names by using the wanted directive as a variable name and use the I suspected that removing the quotes was a too heavy change If you prefer, I'll reverting that and substituting: with |
|
Yes I think it's cleaner thanks!!! |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## c++17 #935 +/- ##
==========================================
- Coverage 85.78% 85.73% -0.05%
==========================================
Files 600 600
Lines 54724 54437 -287
==========================================
- Hits 46945 46673 -272
+ Misses 7779 7764 -15
☔ View full report in Codecov by Sentry. |
|
|
||
| #define PLUMED_CONCATENATE_DIRECT(s1, s2) s1##s2 | ||
| #define PLUMED_CONCATENATE(s1, s2) PLUMED_CONCATENATE_DIRECT(s1, s2) | ||
| #define PLUMED_UNIQUENAME(str) PLUMED_CONCATENATE(str, __LINE__) |
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.
You eliminated an indirection. I honestly do not remember anymore why it was there. Are you sure this is ok?
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 think it's correct. You are just using PLUMED_CONCATENATE below..
.gitignore
Outdated
| /config.* | ||
| /autom4* | ||
| /stamp-h | ||
| /build |
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.
maybe this can be a standalone commit?
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.
removed from this PR
Description
#define PLUMED_REGISTER_ACTION(classname,directive) ActionRegistration<classname> directive##Registerer(#directive);instead of a whole class definition+declarationfor a in */; do sed -r 's%(PLUMED_REGISTER_ACTION\(.*,.*)\"([A-Z_0-9]*)\"(\))%\1\2\3%g' "$a"/*cpp -i; donethe string constant is automatically stringified by the "#" operator in the preprocessorsedaway to be completely exchanged by the explicit template toolIn the case of multiple definitions, like XDistances and XYTorsion, the compiler will only declare one specialized ActionRegistration, but with multiple differently named instances without errors, for example
Target release
I would like my code to appear in the C++17 release (it uses a
inline constexprvariable).Type of contribution
Copyright
COPYRIGHTfile with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulenamein order to make sure the headers of the module are correct.Tests