roll: pigweed, pw_toolchain: pw_multibuf: Restructure ChunkIterable

MultiBuf is a byte-oriented view of a list of chunks, and this change
structures MultiBuf accordingly. This replaces the ChunkIterable class
with a private MultiBufChunks base class that provides the
Chunk-oriented view for MultiBuf.

Restructuring this way fixes an issue where MultiBuf data can be
modified from a const reference. MultiBuf originally returned a const
ChunkIterable, but since return values are copied, this becomes a
non-const ChunkIterable, giving mutable access to the multibuf.

  const MultiBuf& const_mb = mb;
  auto chunk_iterable = cmb.Chunks();  // chunk_iterable is non-const
  iterable.front()[0] = std::byte();  // uh oh, chunk data is mutable!

Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/230892

https://pigweed.googlesource.com/pigweed/pigweed
pigweed, pw_toolchain Rolled-Commits: 03da4a376d12ab8..7e7c141c8808200
Roller-URL: https://ci.chromium.org/b/8739059875420670833
GitWatcher: ignore
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: Id5bbf5c18e2a0d1be7d75a642526beadcdfd6915
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/showcase/sense/+/230874
Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
1 file changed
tree: c19d92b52b2929329aa28791f71368f3a102bb8b
  1. .github/
  2. .vscode/
  3. apps/
  4. device/
  5. modules/
  6. system/
  7. targets/
  8. tools/
  9. web_app/
  10. .bazelignore
  11. .bazelrc
  12. .bazelversion
  13. .buildifier.json
  14. .clang-format
  15. .clangd.shared
  16. .gitignore
  17. .pw_console.yaml
  18. AUTHORS
  19. BUILD.bazel
  20. CONTRIBUTING.md
  21. LICENSE
  22. MODULE.bazel
  23. OWNERS
  24. pigweed.json
  25. README.md
README.md

Sense

git clone https://pigweed.googlesource.com/pigweed/showcase/sense

Welcome to Pigweed Sense, a tour of key Pigweed components experienced through an imagined air quality product.

Please visit Sense: An interactive tour through Pigweed to get started.