-
Notifications
You must be signed in to change notification settings - Fork 69
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
Checkpointing done right #2149
Checkpointing done right #2149
Conversation
…ct doesn't build.
physics/checkpointer.hpp
Outdated
template<typename Message> | ||
class Checkpointer { | ||
public: | ||
// A function that reconstructs an object from a checkpoint. It must return |
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.
A function that reconstructs an object from a checkpoint as a side effect, I got confused looking for the object in the signature.
Alternatively, templatize on the object and pass it by non-const reference.
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 started with templatizing on the object, but it looked silly because it would take the pointer at construction and store it just to pass it back to the callbacks. Incidentally, the current schema would technically make it possible to checkpoint several objects together.
Beefed up the comment.
static Instant infinite_future = Instant() + quantities::Infinity<Time>(); | ||
return infinite_future; | ||
} else { | ||
message->MergeFrom(checkpoints_.cbegin()->second); |
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.
Will this have the correct behaviour for repeated fields, since those are appended instead of overwritten? If it does not, there should be a comment warning of that in the header file.
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.
Added a comment.
retest this please |
Verified that both recent and old saves could be loaded. |
This is intended to replace #2147.