-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ntuple] Add GetView<void>
with type name string or std::type_info
argument
#18185
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
Conversation
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.
LGTM, just one question that probably doesn't belong to this PR
Test Results 17 files 17 suites 4d 22h 16m 20s ⏱️ Results for commit 1d32f22. ♻️ This comment has been updated with latest results. |
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.
LG, thanks for the clear implementation!
6f2228b
to
bb4d08e
Compare
GetView<void>
with type name string argumentGetView<void>
with type name string or std::type_info
argument
bb4d08e
to
51503fd
Compare
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.
Many thanks! LGTM!
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.
Thank you! But see comment before merging
7ed3e89
to
dec2acd
Compare
dec2acd
to
ddebfca
Compare
As discussed on Friday, I removed the |
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.
Changed as discussed, LGTM
Enables passing a type name string to `GetView<void>` to signal that the pointer has a different underlying type than the on-disk field's type. The field used by `RNTupleView` will be constructed with this type, in turn benefitting from RNTuples built-in type- and bounds-checking.
...which in turn calls the overload that takes a type name string.
ddebfca
to
1d32f22
Compare
Enables passing a type name string to
GetView<void>
to signal that the pointer has a different underlying type than the on-disk field's type. The field used byRNTupleView
will be constructed with this type, in turn benefitting from RNTuples built-in type- and bounds-checking.To illustrate further, assuming
myInt
is astd::uint64_t
on-disk:GetView<void>
will currently always reconstruct the field used for loading the values from the on-disk descriptor. However, in the example above this can lead to undefined behavior when the actual values on disk don't fit instd::int32_t
. The change proposed in this PR enables passing the type name string toGetView<void>
, which is then used for the construction of the field instead, leveraging RNTuple's internal type- and bounds-checking:This feature was requested by and discussed with ATLAS.