-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add flags to Saver classes to specify what to save #339
Conversation
Codecov Report
@@ Coverage Diff @@
## master #339 +/- ##
========================================
- Coverage 81.02% 81% -0.03%
========================================
Files 205 205
Lines 5997 6006 +9
========================================
+ Hits 4859 4865 +6
- Misses 1138 1141 +3
|
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.
The article looks interesting. I personally would like to try to use it, but using int
is also okay.
If we use int
, I believe here is the best place to use unsigned integer (i.e., std::size_t
)!
Nit: Let's use \param[in]
for input arguments! 😄
/// \param _world World to save state from and restore to. | ||
explicit WorldStateSaver(World* const _world); | ||
/// \param world World to save state from and restore to. | ||
/// \param options Options to specify what should be saved |
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.
Nit: Let's use \param[in]
!
explicit WorldStateSaver(World* const _world); | ||
/// \param world World to save state from and restore to. | ||
/// \param options Options to specify what should be saved | ||
explicit WorldStateSaver(World* const world, int options = CONFIGURATIONS); |
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.
Nit: Please change to const World* world
. They are identical but different style. I believe our convention is const World* world
.
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 was actually incorrect to be const
since we restore the World
state in the destructor.
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.
/// Construct a MetaSkeletonStateSaver and save the current state of the \c | ||
/// MetaSkeleton. This state will be restored when MetaSkeletonStateSaver is | ||
/// destructed. | ||
/// | ||
/// \param _metaskeleton MetaSkeleton to save/restore | ||
/// \param metaskeleton MetaSkeleton to save/restore | ||
/// \param options Options to specify what should be saved |
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.
Nit: \param[in]
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.
Looks good to me. I just have another minor nitpick, which shouldn't prevent merging this PR.
auto skeleton = Skeleton::create(); | ||
skeleton->createJointAndBodyNodePair<RevoluteJoint>(); | ||
public: | ||
void SetUp() |
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.
Nit: setUp()
? 😄
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.
What do you mean? Isn't the correct name SetUp
?
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 believe function naming convention is to start with a lower case (note that SetUp
begins with an upper latter "S").
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.
Oh, this is required by gtest. Sorry for the noise. 😞
* Add flags to select what should be saved by Saver classes. * Add more tests. * Restructure SaverOptions. * Address @jslee02's comments. * Remove incorrect const specifier. * Update CHANGELOG.md.
Resolves #276. Resolves #293.
This implementation might not be ideal because the "options" can be arbitrary ints, rather than combinations of the options that we actually enumerate. If that's a problem, maybe something like this would be better?
Before creating a pull request
make format
Before merging a pull request
CHANGELOG.md