本文整理汇总了C++中ClassList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ClassList::push_back方法的具体用法?C++ ClassList::push_back怎么用?C++ ClassList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassList
的用法示例。
在下文中一共展示了ClassList::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getIndirectSubClasses
/// \brief Get all subclasses of a given class.
///
/// \p Current class, whose direct and indirect subclasses are
/// to be collected.
/// \p IndirectSubs placeholder for collected results
void ClassHierarchyAnalysis::getIndirectSubClasses(ClassDecl *Cur,
ClassList &IndirectSubs) {
unsigned Idx = IndirectSubs.size();
if (!hasKnownDirectSubclasses(Cur))
return;
// Produce a set of all indirect subclasses in a
// breadth-first order;
// First add subclasses of direct subclasses.
for (auto C : getDirectSubClasses(Cur)) {
// Get direct subclasses
if (!hasKnownDirectSubclasses(C))
continue;
auto &DirectSubclasses = getDirectSubClasses(C);
// Remember all direct subclasses of the current one.
for (auto S : DirectSubclasses) {
IndirectSubs.push_back(S);
}
}
// Then recursively add direct subclasses of already
// added subclasses.
while (Idx != IndirectSubs.size()) {
auto C = IndirectSubs[Idx++];
// Get direct subclasses
if (!hasKnownDirectSubclasses(C))
continue;
auto &DirectSubclasses = getDirectSubClasses(C);
// Remember all direct subclasses of the current one.
for (auto S : DirectSubclasses) {
IndirectSubs.push_back(S);
}
}
}