-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[multibody] Remove dynamic_cast from private inline functions #22208
[multibody] Remove dynamic_cast from private inline functions #22208
Conversation
+@amcastro-tri for a quick feature reviewer sanity-check from the MbT developer team, please. +@rpoyner-tri for platform review per schedule (tomorrow), please. |
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.
This looks good Jeremy, I just had one question.
Reviewed 23 of 23 files at r1, all commit messages.
Reviewable status: 2 unresolved discussions, LGTM missing from assignees rpoyner-tri(platform),amcastro-tri
multibody/plant/force_density_field.h
line 18 at r1 (raw file):
template <typename T> class MultibodyPlant;
I forget, do we need to guard this against being processed by Doxygen?
multibody/plant/force_density_field.h
line 83 at r1 (raw file):
invokes this function; force_density_field.h cannot do that for you. @pre tree_system != nullptr. */ template <typename MultibodyPlantDeferred = MultibodyPlant<T>>
pardon my ignorance, do we still need this template trick?
539fdb0
to
2a56042
Compare
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.
Reviewable status: 2 unresolved discussions, LGTM missing from assignees rpoyner-tri(platform),amcastro-tri
multibody/plant/force_density_field.h
line 18 at r1 (raw file):
Previously, amcastro-tri (Alejandro Castro) wrote…
I forget, do we need to guard this against being processed by Doxygen?
Not every forward declaration confuses Doxygen, but some do, and I don't know what detail(s) of the forward declaration are relevant to misleading Doxygen's parsing.
When I am writing new code I do always guard forward declarations with with an ifndef, but I'm not going to change this pre-existing code unless we find a specific cause for concern.
multibody/plant/force_density_field.h
line 83 at r1 (raw file):
Previously, amcastro-tri (Alejandro Castro) wrote…
pardon my ignorance, do we still need this template trick?
We still need it but it doesn't matter what type it mentions. Simplified to use void
, instead.
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.
Reviewed 15 of 23 files at r1, 8 of 8 files at r2, all commit messages.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee amcastro-tri
2a56042
to
aede63b
Compare
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.
Dismissed @amcastro-tri from 2 discussions.
Reviewable status: LGTM missing from assignee amcastro-tri
@amcastro-tri we're missing the LGTM from you, please. |
I'll deem the "sanity-check from the MbT developer team" sufficiently completed. |
The
dynamic_cast
operation does not meet our styleguide requirements for being inline. We either need to get rid of the cast (by simplifying the function), or move its definition to the cc file.This change is tangentially inspired by #22204.
(Technically the
GetParentPlant
is a public function so the commit subject isn't quite right, but anyway it seems reasonable to change it here, too, since its fix shares a mechanism within this cohort.)This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)