-
Notifications
You must be signed in to change notification settings - Fork 27
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
cpp: Store compounds real bit size with its pos #658
cpp: Store compounds real bit size with its pos #658
Conversation
b31e47f
to
9f30008
Compare
9f30008
to
31413be
Compare
Thank you for pointing this out! Packed arrays are indeed a problem. The naming is always the problem, so I would suggest to implement only one method to return structure with all information:
This will allow to add more parsing information in the future without any change in the design. If this suggestion is ok for you, we will implement it. But before we do this, I would like to check with you the following:
|
Sounds good! Shall I change that with this PR?
Yes, getting the bit-position for non-compound fields is not needed.
What would be the key used for hashing, and what would be the reason to store the |
Thanks a lot but it is ok, we will do it.
The key will be probably the pointer to the Zserio object. The main reason would be to avoid of the possible |
* cpp: Store compounds real bit size with its pos * Update clang-tidy suppressions
* cpp: Store compounds real bit size with its pos * Update clang-tidy suppressions
Please check contribution guide first.
Description
With the implementation of
bitPosition()
, I did not take relative encoded arrays/packed objects into account. The proposed solution is to store the "physical bit-size" of an object along with its bit-position, because we cannot callbitSizeOf(context, offset)
at a later stage.This PR adds a second field
m_realBitSize
that stores the physical bit-size of an object on construction.I am not sure about the name
realBitPosition()
, maybephysicalSizeOf()
orpackedSizeOf()
is better?Tests are yet missing. I will add them to this PR.
Type of Change