commit | 07a61ccf0226a5a370bf93a3f275e561f07beb44 | [log] [tgz] |
---|---|---|
author | Taylor Cramer <cramertj@google.com> | Fri Jul 29 22:55:40 2022 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jul 29 22:55:40 2022 +0000 |
tree | b7c10f256f5267b971d69df3b4dae3a9eaa479bd | |
parent | c8bb7b15b66e57e9b0c7f58104dc1912b028745e [diff] |
pw_protobuf: Add StreamEncoder::CloseEncoder Previously, `StreamEncoder` would only perform writes to its parent after destruction occurred. This resulted in callers frequently needing to introduce new scopes, often with a comment explaining the API to readers. This change adds the `CloseEncoder` method, which explicitly finalizes the child encoder and performs the writes to the parent, allowing users both to close an encoder before the end of its lexical scope and to make their code more explicit and self-descriptive if desired. Change-Id: Ieedf99048da3fe2d87602eea1ae85165c378d70a Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/103922 Reviewed-by: Alexei Frolov <frolv@google.com> Commit-Queue: Taylor Cramer <cramertj@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.