-
Notifications
You must be signed in to change notification settings - Fork 377
Feature/read from general stream #334
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
Conversation
| namespace utils { | ||
| bool readProtoMsgCountToStream(std::fstream* stream_in, uint32_t* message_count, | ||
| uint64_t* byte_offset); | ||
| bool readProtoMsgCountFromStream(std::istream* stream_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.
This is a naming correction that will break depending packages if they've implemented their own loading functions.
Obviously this function is reading from a stream, rather than to a stream.
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 you should be able to rename this. AFAIK this should only be used deep in the internals of this stuff (note to self for future designs: hide functions like these :) )
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.
People implementing new layers, submap types etc have to call this function, which does seem a bit odd to me, as we've discussed before :). Imma merge and let's see if anyone complains.
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.
LGTM, thanks!
| namespace utils { | ||
| bool readProtoMsgCountToStream(std::fstream* stream_in, uint32_t* message_count, | ||
| uint64_t* byte_offset); | ||
| bool readProtoMsgCountFromStream(std::istream* stream_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.
I think you should be able to rename this. AFAIK this should only be used deep in the internals of this stuff (note to self for future designs: hide functions like these :) )
I needed to read protobuf messages from a stream of data in memory (as opposed to in a file). I swapped loading function inputs from
fstream*toistream*. They were being implicitly cast to those types anyway, when passed to protobuf functions.I also corrected a naming typo... This is a breaking change for anyone depending on this function... But it was quite confusing.
on top of #332