commit | 0422de1761e52ad5d1fad821880025fc27facf1c | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Tue Nov 12 07:22:26 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Nov 12 07:22:26 2024 +0000 |
tree | 08b6baf5cd65d6b75ffdbf70cef4953077de60fe | |
parent | c521eeca9d38601a8d13ae542a1e59e363d7fbc8 [diff] |
pw_channel: Rework inheritance to avoid SiblingCast Change pw_channel to a new inheritance pattern that places AnyChannel in the middle of the hierarchy. The various Channel API classes are private empty bases of AnyChannel. This ensures conversions between compatible Channel variants are valid, since all channel implementations have all channel variants as bases. Channel implementations extend a ChannelImpl with properties specified in template parameters, and unsupported functions are automatically disabled. This change also refactors and simplifies the channel.h header. Properties and code for checking them are moved to a properties.h header. Also, the macros to generate ChannelImpl specializations are greatly simplified. Change-Id: Ib48bca41ec63ac107bf703b2102f03e9d6cd0347 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/247732 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Reviewed-by: Taylor Cramer <cramertj@google.com> Commit-Queue: Wyatt Hepler <hepler@google.com> Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.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/.