-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a SpanSearchValue
class that allows tree-searching without extra intermediate if null/missing
checks.
#36754
Conversation
PR #36754: Size comparison from 84fb78f to e413adf Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36754: Size comparison from 6447c64 to 95bdb5e Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has
src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp
Outdated
Show resolved
Hide resolved
src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
…omeip into fluent_search_class
PR #36754: Size comparison from 8606290 to 6b03605 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
FluentTreeObject
class that allows tree-searching without extra intermediate if null/missing
checks.SpanSearchValue
class that allows tree-searching without extra intermediate if null/missing
checks.
PR #36754: Size comparison from 577074c to ce68521 Full report (54 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36754: Size comparison from 577074c to 57fc226 Full report (3 builds for cc32xx, stm32)
|
PR #36754: Size comparison from 577074c to 2aa7c96 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #36754: Size comparison from c799e5c to 9315ba1 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
PR #36754: Size comparison from c799e5c to 6103ce4 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Our data model will often have levels:
endpoints
containclusters
which containattributes
(or commands clusters contain device types or semantic tags etc.) and code of finding endpoint ->cluster->attribute is highly repetitive.Looking to have some fluent search capability equivalent to a
?.
elvis operator (see https://kotlinlang.org/docs/null-safety.html#elvis-operator for example) that saysdo this if not null, otherwise preserve the null
.This is also similar to what optionals usually do for
map
ortransform
(https://doc.rust-lang.org/std/option/enum.Option.html#method.map , https://en.cppreference.com/w/cpp/utility/optional/transform which we do not yet have in C++17)This allows me to do:
to be the equivalent of something like:
with the added benefit that it enforces consistent usage of
search hints
and potentially repetitive bits removal (e.g. top level find by endpoint/cluster would be repeated in many functions dealing with full attribute paths, so even though this is a template object the end result may be less code rather than more).