Add basic memory buffer streams#11
Merged
BurningEnlightenment merged 7 commits intomasterfrom Feb 15, 2023
Merged
Conversation
The old filename is a left over from the coexistence with the legacy
streams.
Refactor all test code to use the test output streams instead the public
`memory_output_stream` API.
BREAKING CHANGE: Includes of `dplx/dp/streams/memory_output_stream2.hpp`
must be updated to `dplx/dp/streams/memory_output_stream.hpp`
Add convenience overloads to `input_buffer` APIs taking a pointer to a buffer and its size as arguments. These are convenience overloads due to the fact that under the Windows x64 calling convention `std::span` cannot be passed via registers (as opposed to the Itanium x64 calling convention).
Add convenience overloads to `output_buffer` APIs taking a pointer to a buffer and its size as arguments. These are convenience overloads due to the fact that under the Windows x64 calling convention `std::span` cannot be passed via registers (as opposed to the Itanium x64 calling convention). - Improve the parameter naming of related APIs.
Not marking the move special member functions as deleted lets non owning streams implement them intuitively. However, this comes at the cost of owning streams heaving to `reset()` the moved from buffer subobject.
in order to ease encoding to buffers.
rvalue output stream references are intentionally excluded from satisfying `output_stream` due to the fact that one has no way of retrieving information about the temporay stream object. However, prior to this change it was possible for such rvalue references to be considered for implicit conversions to any `get_*_buffer` tag_invoke overload.
Add the most simple `input_buffer` implementation wrapping an existing memory buffer. Allow rvalue references of byte spans to be converted to said buffer in order to allow quick decoding of arbitrary buffers. lvalue byte span references are explicitly forbidden, due to the fact that there is no way to relay consumed byte information to the caller in a ergonomic way. E.g. updating the span object to the remaining bytes leaves the owner without a way to recover the original span and updating const references is outright impossible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Resolves #9
Solution Sketch
See the commit log for detailed information.