Skip to content

Conversation

@oyvindronningstad
Copy link
Collaborator

@oyvindronningstad oyvindronningstad commented Apr 30, 2024

Add support for the --unordered-maps option to zcbor code
which makes use of the zcbor_unordered_maps_*() API in generated code.

Fixes #411

@oyvindronningstad oyvindronningstad force-pushed the map-search-py branch 2 times, most recently from 10152df to 36e9986 Compare May 2, 2024 10:42
@oyvindronningstad oyvindronningstad force-pushed the map-search-py branch 2 times, most recently from f32fa46 to 087ba75 Compare May 8, 2024 08:41
@oyvindronningstad oyvindronningstad force-pushed the map-search-py branch 8 times, most recently from 40b1e6b to 60ba45c Compare August 21, 2024 11:44
@oyvindronningstad oyvindronningstad removed the request for review from sigvartmh September 17, 2024 12:57
@simensrostad
Copy link

@oyvindronningstad Any traction here? Will we get this for NCS 2.8?

zcbor/zcbor.py Outdated
{(linesep + " ").join(((str(relativify(f)) for f in include_dirs)))}
)
"""
{f"\n{smart_search}\n" if add_smart_search else ''}"""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The use of backslashes in the formatted string doesn't work on version 3.10 python - forced me to update python to pickup this change.

@oyvindronningstad oyvindronningstad force-pushed the map-search-py branch 7 times, most recently from d229ca7 to 712a778 Compare February 14, 2025 13:24
@jtguggedal
Copy link

@oyvindronningstad @darkofc It would be really great if this PR could be merged so that we can start to use this feature

@oyvindronningstad
Copy link
Collaborator Author

@jtguggedal I'm working on it. Sorry it's taken a long time, but each time I come back to it, I change it quite a bit, because it would be prone to bugs or user error. It contains surprisingly many tricky edge cases and tough decisions. Hoping to finish it soon.

@jtguggedal
Copy link

@jtguggedal I'm working on it. Sorry it's taken a long time, but each time I come back to it, I change it quite a bit, because it would be prone to bugs or user error. It contains surprisingly many tricky edge cases and tough decisions. Hoping to finish it soon.

Good stuff, thanks for the update!

@oyvindronningstad oyvindronningstad force-pushed the map-search-py branch 4 times, most recently from b43d6c5 to 17e1aeb Compare June 6, 2025 12:07
together with the zcbor state.

Signed-off-by: Øyvind Rønningstad <[email protected]>
I.e. in unions and repetitions. In both cases, it's ok to fail decoding
something because it's optional, and if the union element or repeated data
being decoded includes multiple map elements, backups are needed in case
flags have been set for some map elements, then fails later. In that case,
the previous map elements' flags must be undone, and a backup is the way
to keep the old state so it can be restored.

Signed-off-by: Øyvind Rønningstad <[email protected]>
@oyvindronningstad oyvindronningstad force-pushed the map-search-py branch 4 times, most recently from 1d24eb4 to dbee639 Compare August 13, 2025 15:34
Add support for the --unordered-maps option to zcbor code
which makes use of the zcbor_unordered_maps_*() API in generated code.

Signed-off-by: Øyvind Rønningstad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How does decoding unordered maps work?

4 participants