commit | 0ed221cbb8b943205dea4ac315fe1d4b1e6b7371 | [log] [tgz] |
---|---|---|
author | Armando Montanez <amontanez@google.com> | Fri Apr 02 18:33:01 2021 -0700 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed May 12 22:03:03 2021 +0000 |
tree | f9d2356e2c0855c1a348710271b948d931d034b3 | |
parent | dc51315530070a395300695c50b172c4fdce6deb [diff] |
pw_protobuf: Encoder rework Rewrites the pw_protobuf encoder to be oriented around pw_stream compatibility. Improvements: * Only the deepest nested encoder can be used at any given moment. Using a parent encoder triggers a crash rather than silently corrupting data. * Nested depth is bounded by scratch buffer size and stack usage rather than template arguments. * Can write to pw::stream::Writer objects without any temporary buffer. * Encoders can be explicitly finalized to allow returning to the parent encoder for further modifications without needing to create scopes to handle RAII behavior. * Proto encode interfaces can standardize on the StreamingEncoder as any StreamingEncoder can nest until the temporary buffer is exhausted. * Better handling of endianness. Change-Id: I3c50abbf2fe28328a9cb1aa527cf829abe583218 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/40245 Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Reviewed-by: Ewout van Bekkum <ewout@google.com> Reviewed-by: Keir Mierle <keir@google.com>
See our website: http://pigweed.dev