-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[ntuple] fix type names with [U]Long64_t template args #20478
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
base: master
Are you sure you want to change the base?
Conversation
Test Results 22 files 22 suites 3d 21h 1m 18s ⏱️ For more details on these failures, see this check. Results for commit 16a90ef. ♻️ This comment has been updated with latest results. |
bd12deb to
be32af3
Compare
a676f02 to
16a90ef
Compare
Custom classes with [U]Long64_t template arguments need to use their meta-normalized name as type alias. Otherwise, during reconstruction with the RNTuple normalized name, the streamer info for the `std::[u]int64_t` argument will be requested (typically `long` instead of `long long`).
| return GetRenormalizedMetaTypeName(metaNormalizedName); | ||
| } | ||
|
|
||
| bool ROOT::Internal::NeedsMetaNameAsAlias(const std::string &metaNormalizedName, std::string &renormalizedAlias) |
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 seems similar to (but better than): TClassEdit::GetLong64_Name, isn't it?
| EXPECT_TRUE(NeedsMetaNameAsAlias("MyClass<ULong64_t>", renormalizedAlias)); | ||
| EXPECT_TRUE(NeedsMetaNameAsAlias("std::vector<MyClass<Long64_t> >", renormalizedAlias)); | ||
| EXPECT_EQ("std::vector<MyClass<Long64_t>>", renormalizedAlias); | ||
| EXPECT_FALSE(NeedsMetaNameAsAlias("MyClass<ROOT::RVec<Long64_t>>", renormalizedAlias)); |
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.
We should also test map, i.e. when the long long is the second or third argument. We should also test when the argument is nested (eg EdmWrapper<map<int, UserStruct<something, Long64_t>>>).
| {"std::pair<CustomStruct, DerivedA>", {"DerivedA", "CustomStruct"}, ""}, | ||
| {"EdmWrapper<long long>", {"EdmWrapper<Long64_t>"}, "EdmWrapper<Long64_t>"}, | ||
| {"EdmContainer", {"EdmContainer", "EdmWrapper<Long64_t>"}, ""}, | ||
| {"EdmWrapper<long long>::Inner", {"EdmWrapper<Long64_t>::Inner"}, "EdmWrapper<Long64_t>::Inner"}, |
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.
Do we also test (besides for std) other combination of class template instance and regular class/namespaces? eg. CL::TP<long long>::CL2, CL::CL2::TP<long long>, etc.
pcanal
left a comment
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
hahnjo
left a comment
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.
Should this be mentioned in "Type Name Normalization" of BinaryFormatSpecification.md?
Custom classes with [U]Long64_t template arguments need to use their
meta-normalized name as type alias. Otherwise, during reconstruction
with the RNTuple normalized name, the streamer info for the
std::[u]int64_targument will be requested (typicallylonginstead of
long long).Fixes #20282