MCPcopy Create free account
hub / github.com/KDE/kdevelop / fetchSuperClasses

Method fetchSuperClasses

kdevplatform/language/codegen/templateclassgenerator.cpp:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63};
64
65void TemplateClassGeneratorPrivate::fetchSuperClasses(const DeclarationPointer& declaration)
66{
67 DUChainReadLocker lock;
68
69 //Prevent duplicity
70 if (allBaseClasses.contains(declaration)) {
71 return;
72 }
73
74 allBaseClasses << declaration;
75
76 DUContext* context = declaration->internalContext();
77 if (context) {
78 const auto importedParentContexts = context->importedParentContexts();
79 for (const DUContext::Import& import : importedParentContexts) {
80 if (DUContext* parentContext = import.context(context->topContext())) {
81 if (parentContext->type() == DUContext::Class) {
82 fetchSuperClasses(DeclarationPointer(parentContext->owner()));
83 }
84 }
85 }
86 }
87}
88
89TemplateClassGenerator::TemplateClassGenerator(const QUrl& baseUrl)
90 : d_ptr(new TemplateClassGeneratorPrivate)

Callers 1

addBaseClassMethod · 0.80

Calls 7

containsMethod · 0.45
internalContextMethod · 0.45
contextMethod · 0.45
topContextMethod · 0.45
typeMethod · 0.45
ownerMethod · 0.45

Tested by

no test coverage detected