File indexing completed on 2024-04-06 12:19:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "TFile.h"
0016 #include "TStreamerInfo.h"
0017 #include "TList.h"
0018 #include "TVirtualCollectionProxy.h"
0019 #include "TStreamerElement.h"
0020 #include <iostream>
0021
0022 void check(TClass &cl, TList &streamerInfoList) {
0023 std::string name(cl.GetName());
0024 if (name == "string")
0025 return;
0026 if (0 == name.compare(0, strlen("pair<"), "pair<"))
0027 return;
0028 std::cout << "check TClass: " << name << std::endl;
0029 bool found = streamerInfoList.FindObject(cl.GetName()) != 0;
0030 if (!found)
0031 std::cout << "Missing: " << cl.GetName() << '\n';
0032 }
0033
0034 void check(TVirtualCollectionProxy &proxy, TList &streamerInfoList) {
0035 auto inner = proxy.GetValueClass();
0036 if (inner) {
0037 auto subproxy = inner->GetCollectionProxy();
0038 if (subproxy) {
0039 check(*subproxy, streamerInfoList);
0040 } else {
0041 check(*inner, streamerInfoList);
0042 }
0043 }
0044 }
0045
0046 void check(TStreamerElement &element, TList &streamerInfoList) {
0047 auto cl = element.GetClass();
0048 if (cl == nullptr) {
0049 return;
0050 }
0051
0052
0053
0054
0055
0056 if (*(cl->GetName()) == 'T') {
0057 return;
0058 }
0059 if (cl->GetCollectionProxy()) {
0060 check(*cl->GetCollectionProxy(), streamerInfoList);
0061 } else {
0062 check(*cl, streamerInfoList);
0063 }
0064 }
0065
0066
0067
0068
0069 void scan(TStreamerInfo &info, TList &streamerInfoList) {
0070 auto cl = TClass::GetClass(info.GetName());
0071
0072
0073 if (!cl) {
0074
0075 return;
0076 }
0077 auto proxy = cl->GetCollectionProxy();
0078 if (proxy)
0079 check(*proxy, streamerInfoList);
0080 for (auto e : TRangeDynCast<TStreamerElement>(*info.GetElements())) {
0081 if (!e)
0082 continue;
0083 check(*e, streamerInfoList);
0084 }
0085 }
0086
0087 void scan(TList *streamerInfoList) {
0088 if (!streamerInfoList)
0089 return;
0090 for (auto l : TRangeDynCast<TStreamerInfo>(*streamerInfoList)) {
0091 if (!l)
0092 continue;
0093
0094
0095
0096
0097
0098 if (*(l->GetName()) == 'T') {
0099 continue;
0100 }
0101
0102 scan(*l, *streamerInfoList);
0103 }
0104 delete streamerInfoList;
0105 }
0106
0107 void testForStreamerInfo(TFile *file) {
0108 if (!file)
0109 return;
0110 scan(file->GetStreamerInfoList());
0111 }