Skip to content

ffi: Return metadata position, size, and type from decode_preamble for upper layer to parse. - #122

Merged
kirkrodrigues merged 5 commits into
y-scope:mainfrom
davidlion:ffi-ir-metadata
May 21, 2023
Merged

ffi: Return metadata position, size, and type from decode_preamble for upper layer to parse.#122
kirkrodrigues merged 5 commits into
y-scope:mainfrom
davidlion:ffi-ir-metadata

Conversation

@davidlion

Copy link
Copy Markdown
Member

Description

The metadata in a preamble may be encoding in various formats (e.g. json) with sparse fields as needed by individual use cases. Performing the parsing and validation of this metadata in the ffi layer adds unnecessary complexity and constraints to the metadata as the ffi code must handle all use cases.

This PR changes decode_preamble to return the position, size, and type tag of the metadata to the upper layer. This allows the user of the ffi decide how they should parse and validate the metadata. This change also unifies decode_preamble for four and eight byte encoding, as there is no difference between their behaviour any more.

Validation performed

Adjusted preamble decoding unit tests. All [ffi] tagged tests passing.

Comment thread components/core/tests/test-ir_encoding_methods.cpp Outdated
Comment thread components/core/src/ffi/ir_stream/decoding_methods.cpp
Comment thread components/core/src/ffi/ir_stream/decoding_methods.hpp Outdated
Comment thread components/core/src/ffi/ir_stream/decoding_methods.hpp Outdated
Comment thread components/core/src/ffi/ir_stream/decoding_methods.hpp Outdated
Comment thread components/core/tests/test-ir_encoding_methods.cpp Outdated
Comment thread components/core/tests/test-ir_encoding_methods.cpp
Comment thread components/core/tests/test-ir_encoding_methods.cpp Outdated
Comment thread components/core/tests/test-ir_encoding_methods.cpp Outdated
Comment thread components/core/tests/test-ir_encoding_methods.cpp Outdated
Comment thread components/core/tests/test-ir_encoding_methods.cpp
Comment thread components/core/src/ffi/ir_stream/decoding_methods.hpp
@davidlion
davidlion requested a review from kirkrodrigues May 21, 2023 00:22
@kirkrodrigues
kirkrodrigues merged commit 7e7fbc5 into y-scope:main May 21, 2023
@davidlion
davidlion deleted the ffi-ir-metadata branch May 21, 2023 01:17
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
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.

3 participants