本文整理汇总了C++中TClass::GetCollectionProxy方法的典型用法代码示例。如果您正苦于以下问题:C++ TClass::GetCollectionProxy方法的具体用法?C++ TClass::GetCollectionProxy怎么用?C++ TClass::GetCollectionProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TClass
的用法示例。
在下文中一共展示了TClass::GetCollectionProxy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ensure_dictionary
// Generate dictionaries required to read `tree`.
void ensure_dictionary(const char *class_name) {
TClass* claim = TClass::GetClass(class_name);
if (claim && claim->GetCollectionProxy() &&
dynamic_cast<TEmulatedCollectionProxy*>(claim->GetCollectionProxy())) {
// Only executed if the dictionary isn't currently present
init();
char *orig_dir = get_current_dir_name();
chdir(dictionary_tmpdir);
std::cerr << "Generating dictionary for " << class_name << std::endl;
gInterpreter->GenerateDictionary(class_name);
chdir(orig_dir);
free(static_cast<void*>(orig_dir));
}
}
示例2: classesFromBranch
//.........这里部分代码省略.........
case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kUChar:
pointer = true;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kUChar:
case TVirtualStreamerInfo::kUChar:
type = "UChar_t";
break;
case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kUShort:
pointer = true;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kUShort:
case TVirtualStreamerInfo::kUShort:
type = "UShort_t";
break;
case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kUInt:
pointer = true;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kUInt:
case TVirtualStreamerInfo::kUInt:
type = "UInt_t";
break;
case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kULong:
pointer = true;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kULong:
case TVirtualStreamerInfo::kULong:
type = "ULong_t";
break;
case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kULong64:
pointer = true;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kULong64:
case TVirtualStreamerInfo::kULong64:
type = "ULong64_t";
break;
case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kBits:
pointer = true;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kBits:
case TVirtualStreamerInfo::kBits:
type = "UInt_t";
break;
case TVirtualStreamerInfo::kCharStar:
type = "Char_t*";
break;
case TVirtualStreamerInfo::kCounter:
type = "Int_t";
break;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kObjectp:
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kObjectP:
case TVirtualStreamerInfo::kObjectp:
case TVirtualStreamerInfo::kObjectP:
case TVirtualStreamerInfo::kAnyp:
case TVirtualStreamerInfo::kAnyP:
case TVirtualStreamerInfo::kSTL + TVirtualStreamerInfo::kObjectp:
case TVirtualStreamerInfo::kSTL + TVirtualStreamerInfo::kObjectP:
pointer = true;
case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kObject:
case TVirtualStreamerInfo::kObject:
case TVirtualStreamerInfo::kTString:
case TVirtualStreamerInfo::kTNamed:
case TVirtualStreamerInfo::kTObject:
case TVirtualStreamerInfo::kAny:
case TVirtualStreamerInfo::kBase:
case TVirtualStreamerInfo::kSTL:
TClass *elementClass = tStreamerElement->GetClassPointer();
type = elementClass->GetName();
if (elementClass == TClonesArray::Class()) {
ROOT::Internal::TTreeGeneratorBase ttreeGenerator(tbranch->GetTree(), "");
TString className = ttreeGenerator.GetContainedClassName((TBranchElement*)subbranch, tStreamerElement, pointer);
if (className != nullptr) {
TClass *otherClass = TClass::GetClass(className);
classesFromBranch(subbranch, otherClass, classes, variableWithArray.size() + 1, includes);
includes.insert("#include \"TClonesArray.h\"");
}
}
else if (elementClass->GetCollectionProxy() != nullptr && elementClass->GetCollectionProxy()->GetValueClass() != nullptr) {
TClass *otherClass = elementClass->GetCollectionProxy()->GetValueClass();
classesFromBranch(subbranch, otherClass, classes, variableWithArray.size() + 1, includes);
includes.insert(std::string("#include <") + type.substr(0, type.find('<')) + std::string(">"));
}
else
classesFromBranch(subbranch, elementClass, classes, variableWithArray.size() + 1, includes);
}
classStructure.members.push_back(MemberStructure(type, pointer, variable, variableWithArray, comment));
}
}
if (!classStructure.members.empty())
classes.push_back(classStructure);
}
}
}