Doxygen
Loading...
Searching...
No Matches
classdef.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2024 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#include <cstdio>
17#include <algorithm>
18
19#include "types.h"
20#include "classdef.h"
21#include "classlist.h"
22#include "entry.h"
23#include "doxygen.h"
24#include "membername.h"
25#include "message.h"
26#include "config.h"
27#include "util.h"
28#include "diagram.h"
29#include "language.h"
30#include "htmlhelp.h"
31#include "example.h"
32#include "outputlist.h"
33#include "dot.h"
34#include "dotclassgraph.h"
35#include "dotrunner.h"
36#include "defargs.h"
37#include "debug.h"
38#include "docparser.h"
39#include "searchindex.h"
40#include "vhdldocgen.h"
41#include "layout.h"
42#include "arguments.h"
43#include "memberlist.h"
44#include "groupdef.h"
45#include "filedef.h"
46#include "namespacedef.h"
47#include "membergroup.h"
48#include "definitionimpl.h"
49#include "symbolresolver.h"
50#include "fileinfo.h"
51#include "trace.h"
52#include "moduledef.h"
53
54//-----------------------------------------------------------------------------
55
57 const ArgumentLists *actualParams,uint32_t *actualParamIndex)
58{
59 //bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
60 bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
61 //printf("qualifiedNameWithTemplateParameters() localName=%s\n",qPrint(cd->localName()));
62 QCString scName;
63 const Definition *d=cd->getOuterScope();
64 if (d)
65 {
67 {
68 const ClassDef *ocd=toClassDef(d);
69 scName = ocd->qualifiedNameWithTemplateParameters(actualParams,actualParamIndex);
70 }
71 else if (!hideScopeNames)
72 {
73 scName = d->qualifiedName();
74 }
75 }
76
77 SrcLangExt lang = cd->getLanguage();
78 QCString scopeSeparator = getLanguageSpecificSeparator(lang);
79 if (!scName.isEmpty()) scName+=scopeSeparator;
80
81 bool isSpecialization = cd->localName().find('<')!=-1;
82 QCString clName = cd->className();
83 scName+=clName;
84 if (lang!=SrcLangExt::CSharp && !cd->templateArguments().empty())
85 {
86 if (actualParams && *actualParamIndex<actualParams->size())
87 {
88 const ArgumentList &al = actualParams->at(*actualParamIndex);
90 {
91 scName+=tempArgListToString(al,lang);
92 }
93 (*actualParamIndex)++;
94 }
95 else
96 {
98 {
99 scName+=tempArgListToString(cd->templateArguments(),lang);
100 }
101 }
102 }
103 //printf("qualifiedNameWithTemplateParameters: scope=%s qualifiedName=%s\n",qPrint(name()),qPrint(scName));
104 return scName;
105}
106
107static QCString makeDisplayName(const ClassDef *cd,bool includeScope)
108{
109 //bool optimizeOutputForJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
110 SrcLangExt lang = cd->getLanguage();
111 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
112 QCString n;
113 if (lang==SrcLangExt::VHDL)
114 {
116 }
117 else
118 {
119 if (includeScope)
120 {
122 }
123 else
124 {
125 n=cd->className();
126 }
127 }
128 if (cd->isAnonymous())
129 {
131 }
133 if (sep!="::")
134 {
135 n=substitute(n,"::",sep);
136 }
137 if (cd->compoundType()==ClassDef::Protocol && n.endsWith("-p"))
138 {
139 n="<"+n.left(n.length()-2)+">";
140 }
141 return n;
142}
143
144//-----------------------------------------------------------------------------
145
147{
148 if (lang==SrcLangExt::Fortran)
149 {
150 switch (compType)
151 {
152 case ClassDef::Class: return "module";
153 case ClassDef::Struct: return "type";
154 case ClassDef::Union: return "union";
155 case ClassDef::Interface: return "interface";
156 case ClassDef::Protocol: return "protocol";
157 case ClassDef::Category: return "category";
158 case ClassDef::Exception: return "exception";
159 default: return "unknown";
160 }
161 }
162 else
163 {
164 switch (compType)
165 {
166 case ClassDef::Class: return isJavaEnum ? "enum" : "class";
167 case ClassDef::Struct: return "struct";
168 case ClassDef::Union: return "union";
169 case ClassDef::Interface: return lang==SrcLangExt::ObjC ? "class" : "interface";
170 case ClassDef::Protocol: return "protocol";
171 case ClassDef::Category: return "category";
172 case ClassDef::Exception: return "exception";
173 case ClassDef::Service: return "service";
174 case ClassDef::Singleton: return "singleton";
175 default: return "unknown";
176 }
177 }
178}
179
180//-----------------------------------------------------------------------------
181
182
183/** Implementation of the ClassDef interface */
184class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
185{
186 public:
187 ClassDefImpl(const QCString &fileName,int startLine,int startColumn,
188 const QCString &name,CompoundType ct,
189 const QCString &ref=QCString(),const QCString &fName=QCString(),
190 bool isSymbol=TRUE,bool isJavaEnum=FALSE);
191
192 DefType definitionType() const override { return TypeClass; }
193 std::unique_ptr<ClassDef> deepCopy(const QCString &name) const override;
194 void moveTo(Definition *) override;
195 CodeSymbolType codeSymbolType() const override;
196 QCString getOutputFileBase() const override;
197 QCString getInstanceOutputFileBase() const override;
198 QCString getSourceFileBase() const override;
199 QCString getReference() const override;
200 bool isReference() const override;
201 bool isLocal() const override;
202 ClassLinkedRefMap getClasses() const override;
203 bool hasDocumentation() const override;
204 bool hasDetailedDescription() const override;
205 QCString collaborationGraphFileName() const override;
206 QCString inheritanceGraphFileName() const override;
207 QCString displayName(bool includeScope=TRUE) const override;
208 CompoundType compoundType() const override;
209 QCString compoundTypeString() const override;
210 const BaseClassList &baseClasses() const override;
211 void updateBaseClasses(const BaseClassList &bcd) override;
212 const BaseClassList &subClasses() const override;
213 void updateSubClasses(const BaseClassList &bcd) override;
214 const MemberNameInfoLinkedMap &memberNameInfoLinkedMap() const override;
215 Protection protection() const override;
216 bool isLinkableInProject() const override;
217 bool isLinkable() const override;
218 bool isVisibleInHierarchy() const override;
219 bool visibleInParentsDeclList() const override;
220 const ArgumentList &templateArguments() const override;
221 FileDef *getFileDef() const override;
222 ModuleDef *getModuleDef() const override;
223 const MemberDef *getMemberByName(const QCString &) const override;
224 int isBaseClass(const ClassDef *bcd,bool followInstances,const QCString &templSpec) const override;
225 bool isSubClass(ClassDef *bcd,int level=0) const override;
226 bool isAccessibleMember(const MemberDef *md) const override;
227 const TemplateInstanceList &getTemplateInstances() const override;
228 const ClassDef *templateMaster() const override;
229 bool isTemplate() const override;
230 const IncludeInfo *includeInfo() const override;
231 const UsesClassList &usedImplementationClasses() const override;
232 const UsesClassList &usedByImplementationClasses() const override;
233 const ConstraintClassList &templateTypeConstraints() const override;
234 bool isTemplateArgument() const override;
235 const Definition *findInnerCompound(const QCString &name) const override;
238 const ArgumentLists *actualParams=nullptr,uint32_t *actualParamIndex=nullptr) const override;
239 bool isAbstract() const override;
240 bool isObjectiveC() const override;
241 bool isFortran() const override;
242 bool isCSharp() const override;
243 bool isFinal() const override;
244 bool isSealed() const override;
245 bool isPublished() const override;
246 bool isExtension() const override;
247 bool isForwardDeclared() const override;
248 bool isInterface() const override;
249 ClassDef *categoryOf() const override;
250 QCString className() const override;
251 MemberList *getMemberList(MemberListType lt) const override;
252 const MemberLists &getMemberLists() const override;
253 const MemberGroupList &getMemberGroups() const override;
254 const TemplateNameMap &getTemplateBaseClassNames() const override;
255 bool isUsedOnly() const override;
256 QCString anchor() const override;
257 bool isEmbeddedInOuterScope() const override;
258 bool isSimple() const override;
259 const ClassDef *tagLessReference() const override;
260 const MemberDef *isSmartPointer() const override;
261 bool isJavaEnum() const override;
262 QCString title() const override;
263 QCString generatedFromFiles() const override;
264 const FileList &usedFiles() const override;
265 const ArgumentList &typeConstraints() const override;
266 const ExampleList &getExamples() const override;
267 bool hasExamples() const override;
268 QCString getMemberListFileName() const override;
269 bool subGrouping() const override;
270 bool isSliceLocal() const override;
271 bool hasNonReferenceSuperClass() const override;
272 QCString requiresClause() const override;
273 StringVector getQualifiers() const override;
274 bool containsOverload(const MemberDef *md) const override;
275 bool isImplicitTemplateInstance() const override;
276
277 ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn,
278 const QCString &templSpec,bool &freshInstance) override;
279 void insertBaseClass(ClassDef *,const QCString &name,Protection p,Specifier s,const QCString &t=QCString()) override;
280 void insertSubClass(ClassDef *,Protection p,Specifier s,const QCString &t=QCString()) override;
281 void insertExplicitTemplateInstance(ClassDef *instance,const QCString &spec) override;
282 void setIncludeFile(FileDef *fd,const QCString &incName,bool local,bool force) override;
283 void insertMember(MemberDef *) override;
284 void insertUsedFile(const FileDef *) override;
285 bool addExample(const QCString &anchor,const QCString &name, const QCString &file) override;
286 void mergeCategory(ClassDef *category) override;
287 void setFileDef(FileDef *fd) override;
288 void setModuleDef(ModuleDef *mod) override;
289 void setSubGrouping(bool enabled) override;
290 void setProtection(Protection p) override;
291 void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs) override;
292 void addInnerCompound(Definition *d) override;
293 void addUsedClass(ClassDef *cd,const QCString &accessName,Protection prot) override;
294 void addUsedByClass(ClassDef *cd,const QCString &accessName,Protection prot) override;
295 void setIsStatic(bool b) override;
296 void setCompoundType(CompoundType t) override;
297 void setClassName(const QCString &name) override;
298 void setClassSpecifier(TypeSpecifier spec) override;
299 void addQualifiers(const StringVector &qualifiers) override;
300 void setTemplateArguments(const ArgumentList &al) override;
301 void setTemplateBaseClassNames(const TemplateNameMap &templateNames) override;
302 void setTemplateMaster(const ClassDef *tm) override;
303 void setImplicitTemplateInstance(bool b) override;
304 void setTypeConstraints(const ArgumentList &al) override;
305 void addMemberToTemplateInstance(const MemberDef *md, const ArgumentList &templateArguments, const QCString &templSpec) override;
306 void addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const QCString &templSpec) override;
307 void makeTemplateArgument(bool b=TRUE) override;
308 void setCategoryOf(ClassDef *cd) override;
309 void setUsedOnly(bool b) override;
310 void setTagLessReference(const ClassDef *cd) override;
311 void setMetaData(const QCString &md) override;
312 void findSectionsInDocumentation() override;
313 void addMembersToMemberGroup() override;
314 void addListReferences() override;
315 void addTypeConstraints() override;
316 void computeAnchors() override;
317 void mergeMembers() override;
318 void sortMemberLists() override;
320 void writeDocumentation(OutputList &ol) const override;
321 void writeDocumentationForInnerClasses(OutputList &ol) const override;
322 void writeMemberPages(OutputList &ol) const override;
323 void writeMemberList(OutputList &ol) const override;
324 void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,int indentLevel,
325 const ClassDef *inheritedFrom,const QCString &inheritId) const override;
326 void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const override;
327 void writeSummaryLinks(OutputList &ol) const override;
328 void reclassifyMember(MemberDefMutable *md,MemberType t) override;
329 void writeInlineDocumentation(OutputList &ol) const override;
331 const QCString &header,bool localNames) const override;
332 void removeMemberFromLists(MemberDef *md) override;
333 void setAnonymousEnumType() override;
334 void countMembers() override;
335 void sortAllMembersList() override;
336
338 const ClassDef *inheritedFrom,const QCString &inheritId) const override;
339 void writeTagFile(TextStream &) const override;
340
341 int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const override;
342 int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom,
343 MemberListType lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const override;
344 void writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
345 MemberListType lt,const QCString &title,
346 const QCString &subTitle=QCString(),
347 bool showInline=FALSE,const ClassDef *inheritedFrom=nullptr,
348 MemberListType lt2=MemberListType::Invalid(),bool invert=FALSE,bool showAlways=FALSE) const override;
349 void setRequiresClause(const QCString &req) override;
350
351 // inheritance graph related members
352 CLASS_GRAPH_t hasInheritanceGraph() const override;
353 void overrideInheritanceGraph(CLASS_GRAPH_t e) override;
354
355 // collaboration graph related members
356 bool hasCollaborationGraph() const override;
357 void overrideCollaborationGraph(bool e) override;
358 private:
359 int countInheritedByNodes() const;
360 int countInheritsNodes() const;
361 int countInheritanceNodes() const;
363 void showUsedFiles(OutputList &ol) const;
364
365 void writeDocumentationContents(OutputList &ol,const QCString &pageTitle) const;
366 void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList);
367 void addMemberToList(MemberListType lt,MemberDef *md,bool isBrief);
370 const ClassDef *inheritedFrom,bool invert,
371 bool showAlways) const;
372 void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline=FALSE) const;
375 int indentLevel,const ClassDef *inheritedFrom,const QCString &inheritId) const;
376 void writeBriefDescription(OutputList &ol,bool exampleFlag) const;
377 void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag,
378 const QCString &title,const QCString &anchor=QCString()) const;
379 void writeIncludeFiles(OutputList &ol) const;
381 void writeInheritanceGraph(OutputList &ol) const;
382 void writeCollaborationGraph(OutputList &ol) const;
383 void writeMemberGroups(OutputList &ol,bool showInline=FALSE) const;
384 void writeNestedClasses(OutputList &ol,const QCString &title) const;
385 void writeInlineClasses(OutputList &ol) const;
386 void startMemberDeclarations(OutputList &ol) const;
387 void endMemberDeclarations(OutputList &ol) const;
388 void startMemberDocumentation(OutputList &ol) const;
389 void endMemberDocumentation(OutputList &ol) const;
390 void writeAuthorSection(OutputList &ol) const;
391 void writeMoreLink(OutputList &ol,const QCString &anchor) const;
393
396 void addClassAttributes(OutputList &ol) const;
398 const ClassDef *inheritedFrom,bool invert,bool showAlways,
399 ClassDefSet &visitedClasses) const;
401 QCString &title,QCString &subtitle) const;
402 void addTypeConstraint(const QCString &typeConstraint,const QCString &type);
403 void writeTemplateSpec(OutputList &ol,const Definition *d,
404 const QCString &type,SrcLangExt lang) const;
405 void mergeMembersFromBaseClasses(bool mergeVirtualBaseClass);
407 private:
408 /*! file name that forms the base for the output file containing the
409 * class documentation. For compatibility with Qt (e.g. links via tag
410 * files) this name cannot be derived from the class name directly.
411 */
413
414 /*! file name used for the list of all members */
416
417 /*! file name used for the collaboration diagram */
419
420 /*! file name used for the inheritance graph */
422
423 /*! Include information about the header file should be included
424 * in the documentation. 0 by default, set by setIncludeFile().
425 */
426 std::unique_ptr<IncludeInfo> m_incInfo;
427
428 /*! List of base class (or super-classes) from which this class derives
429 * directly.
430 */
432
433 /*! List of sub-classes that directly derive from this class
434 */
436
437 /*! Namespace this class is part of
438 * (this is the inner most namespace in case of nested namespaces)
439 */
440 //NamespaceDef *m_nspace = nullptr;
441
442 /*! File this class is defined in */
443 FileDef *m_fileDef = nullptr;
444
445 /*! Module this class is defined in */
447
448 /*! List of all members (including inherited members) */
450
451 /*! Template arguments of this class */
453
454 /*! Type constraints for template parameters */
456
457 /*! Files that were used for generating the class documentation. */
459
460 /*! Examples that use this class */
462
463 /*! Holds the kind of "class" this is. */
465
466 /*! The protection level in which this class was found.
467 * Typically Public, but for nested classes this can also be Protected
468 * or Private.
469 */
471
472 /*! The inner classes contained in this class. Will be 0 if there are
473 * no inner classes.
474 */
476
477 /* classes for the collaboration diagram */
480
482
483 /*! Template instances that exists of this class, the key in the
484 * dictionary is the template argument list.
485 */
487
489
490 /*! The class this class is an instance of. */
491 const ClassDef *m_templateMaster = nullptr;
492
493 /*! local class name which could be a typedef'ed alias name. */
495
496 /*! If this class is a Objective-C category, then this points to the
497 * class which is extended.
498 */
500
502
503 /* user defined member groups */
505
506 /*! Is this an abstract class? */
507 bool m_isAbstract = false;
508
509 /*! Is the class part of an unnamed namespace? */
510 bool m_isStatic = false;
511
512 /*! TRUE if classes members are merged with those of the base classes. */
513 bool m_membersMerged = false;
514
515 /*! TRUE if the class is defined in a source file rather than a header file. */
516 bool m_isLocal = false;
517
518 bool m_isTemplArg = false;
519
520 /*! Does this class group its user-grouped members
521 * as a sub-section of the normal (public/protected/..)
522 * groups?
523 */
524 bool m_subGrouping = false;
525
526 /** Reason of existence is a "use" relation */
527 bool m_usedOnly = false;
528
529 /** List of titles to use for the summary */
531
532 /** Is this a simple (non-nested) C structure? */
533 bool m_isSimple = false;
534
535 /** Does this class overloaded the -> operator? */
536 const MemberDef *m_arrowOperator = nullptr;
537
538 const ClassDef *m_tagLessRef = nullptr;
539
540 /** Does this class represent a Java style enum? */
541 bool m_isJavaEnum = false;
542
544
546
547 /** C++20 requires clause */
549
551
553 CLASS_GRAPH_t m_typeInheritanceGraph = CLASS_GRAPH_t::NO;
554
556};
557
558std::unique_ptr<ClassDef> createClassDef(
559 const QCString &fileName,int startLine,int startColumn,
560 const QCString &name,ClassDef::CompoundType ct,
561 const QCString &ref,const QCString &fName,
562 bool isSymbol,bool isJavaEnum)
563{
564 return std::make_unique<ClassDefImpl>(fileName,startLine,startColumn,name,ct,ref,fName,isSymbol,isJavaEnum);
565}
566//-----------------------------------------------------------------------------
567
569{
570 public:
571 ClassDefAliasImpl(const Definition *newScope,const ClassDef *cd)
572 : DefinitionAliasMixin(newScope,cd) { init(); }
573 ~ClassDefAliasImpl() override { deinit(); }
575
576 DefType definitionType() const override { return TypeClass; }
577
578 const ClassDef *getCdAlias() const { return toClassDef(getAlias()); }
579 std::unique_ptr<ClassDef> deepCopy(const QCString &name) const override {
581 }
582 void moveTo(Definition *) override {}
583
585 { return getCdAlias()->codeSymbolType(); }
587 { return getCdAlias()->getOutputFileBase(); }
591 { return getCdAlias()->getSourceFileBase(); }
592 QCString getReference() const override
593 { return getCdAlias()->getReference(); }
594 bool isReference() const override
595 { return getCdAlias()->isReference(); }
596 bool isLocal() const override
597 { return getCdAlias()->isLocal(); }
599 { return getCdAlias()->getClasses(); }
600 bool hasDocumentation() const override
601 { return getCdAlias()->hasDocumentation(); }
602 bool hasDetailedDescription() const override
603 { return getCdAlias()->hasDetailedDescription(); }
608 QCString displayName(bool includeScope=TRUE) const override
609 { return makeDisplayName(this,includeScope); }
610 CompoundType compoundType() const override
611 { return getCdAlias()->compoundType(); }
613 { return getCdAlias()->compoundTypeString(); }
614 const BaseClassList &baseClasses() const override
615 { return getCdAlias()->baseClasses(); }
616 const BaseClassList &subClasses() const override
617 { return getCdAlias()->subClasses(); }
620 Protection protection() const override
621 { return getCdAlias()->protection(); }
622 bool isLinkableInProject() const override
623 { return getCdAlias()->isLinkableInProject(); }
624 bool isLinkable() const override
625 { return getCdAlias()->isLinkable(); }
626 bool isVisibleInHierarchy() const override
627 { return getCdAlias()->isVisibleInHierarchy(); }
628 bool visibleInParentsDeclList() const override
629 { return getCdAlias()->visibleInParentsDeclList(); }
630 const ArgumentList &templateArguments() const override
631 { return getCdAlias()->templateArguments(); }
632 FileDef *getFileDef() const override
633 { return getCdAlias()->getFileDef(); }
634 ModuleDef *getModuleDef() const override
635 { return getCdAlias()->getModuleDef(); }
636 const MemberDef *getMemberByName(const QCString &s) const override
637 { return getCdAlias()->getMemberByName(s); }
638 int isBaseClass(const ClassDef *bcd,bool followInstances,const QCString &templSpec) const override
639 { return getCdAlias()->isBaseClass(bcd,followInstances,templSpec); }
640 bool isSubClass(ClassDef *bcd,int level=0) const override
641 { return getCdAlias()->isSubClass(bcd,level); }
642 bool isAccessibleMember(const MemberDef *md) const override
643 { return getCdAlias()->isAccessibleMember(md); }
645 { return getCdAlias()->getTemplateInstances(); }
646 const ClassDef *templateMaster() const override
647 { return getCdAlias()->templateMaster(); }
648 bool isTemplate() const override
649 { return getCdAlias()->isTemplate(); }
650 const IncludeInfo *includeInfo() const override
651 { return getCdAlias()->includeInfo(); }
658 bool isTemplateArgument() const override
659 { return getCdAlias()->isTemplateArgument(); }
660 const Definition *findInnerCompound(const QCString &name) const override
661 { return getCdAlias()->findInnerCompound(name); }
665 const ArgumentLists *actualParams=nullptr,uint32_t *actualParamIndex=nullptr) const override
666 { return makeQualifiedNameWithTemplateParameters(this,actualParams,actualParamIndex); }
667 bool isAbstract() const override
668 { return getCdAlias()->isAbstract(); }
669 bool isObjectiveC() const override
670 { return getCdAlias()->isObjectiveC(); }
671 bool isFortran() const override
672 { return getCdAlias()->isFortran(); }
673 bool isCSharp() const override
674 { return getCdAlias()->isCSharp(); }
675 bool isFinal() const override
676 { return getCdAlias()->isFinal(); }
677 bool isSealed() const override
678 { return getCdAlias()->isSealed(); }
679 bool isPublished() const override
680 { return getCdAlias()->isPublished(); }
681 bool isExtension() const override
682 { return getCdAlias()->isExtension(); }
683 bool isForwardDeclared() const override
684 { return getCdAlias()->isForwardDeclared(); }
685 bool isInterface() const override
686 { return getCdAlias()->isInterface(); }
687 ClassDef *categoryOf() const override
688 { return getCdAlias()->categoryOf(); }
689 QCString className() const override
690 { return getCdAlias()->className(); }
692 { return getCdAlias()->getMemberList(lt); }
693 const MemberLists &getMemberLists() const override
694 { return getCdAlias()->getMemberLists(); }
695 const MemberGroupList &getMemberGroups() const override
696 { return getCdAlias()->getMemberGroups(); }
699 bool isUsedOnly() const override
700 { return getCdAlias()->isUsedOnly(); }
701 QCString anchor() const override
702 { return getCdAlias()->anchor(); }
703 bool isEmbeddedInOuterScope() const override
704 { return getCdAlias()->isEmbeddedInOuterScope(); }
705 bool isSimple() const override
706 { return getCdAlias()->isSimple(); }
707 const ClassDef *tagLessReference() const override
708 { return getCdAlias()->tagLessReference(); }
709 const MemberDef *isSmartPointer() const override
710 { return getCdAlias()->isSmartPointer(); }
711 bool isJavaEnum() const override
712 { return getCdAlias()->isJavaEnum(); }
713 QCString title() const override
714 { return getCdAlias()->title(); }
716 { return getCdAlias()->generatedFromFiles(); }
717 const FileList &usedFiles() const override
718 { return getCdAlias()->usedFiles(); }
719 const ArgumentList &typeConstraints() const override
720 { return getCdAlias()->typeConstraints(); }
721 const ExampleList &getExamples() const override
722 { return getCdAlias()->getExamples(); }
723 bool hasExamples() const override
724 { return getCdAlias()->hasExamples(); }
726 { return getCdAlias()->getMemberListFileName(); }
727 bool subGrouping() const override
728 { return getCdAlias()->subGrouping(); }
729 bool isSliceLocal() const override
730 { return getCdAlias()->isSliceLocal(); }
731 bool hasNonReferenceSuperClass() const override
733 QCString requiresClause() const override
734 { return getCdAlias()->requiresClause(); }
736 { return getCdAlias()->getQualifiers(); }
737 bool containsOverload(const MemberDef *md) const override
738 { return getCdAlias()->containsOverload(md); }
739
740 int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const override
741 { return getCdAlias()->countMembersIncludingGrouped(lt,inheritedFrom,additional); }
743 MemberListType lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const override
744 { return getCdAlias()->countMemberDeclarations(lt,inheritedFrom,lt2,invert,showAlways,visitedClasses); }
745
747 const QCString &header,bool localNames) const override
748 { getCdAlias()->writeDeclarationLink(ol,found,header,localNames); }
749 bool isImplicitTemplateInstance() const override
751
752 void writeDocumentation(OutputList &ol) const override
756 void writeMemberPages(OutputList &ol) const override
757 { getCdAlias()->writeMemberPages(ol); }
758 void writeMemberList(OutputList &ol) const override
759 { getCdAlias()->writeMemberList(ol); }
760 void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,
761 int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId) const override
762 { getCdAlias()->writeDeclaration(ol,md,inGroup,indentLevel,inheritedFrom,inheritId); }
763 void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const override
764 { getCdAlias()->writeQuickMemberLinks(ol,md); }
765 void writeSummaryLinks(OutputList &ol) const override
766 { getCdAlias()->writeSummaryLinks(ol); }
769 void writeTagFile(TextStream &ol) const override
770 { getCdAlias()->writeTagFile(ol); }
772 MemberListType lt,const QCString &title,
773 const QCString &subTitle=QCString(),
774 bool showInline=FALSE,const ClassDef *inheritedFrom=nullptr,
775 MemberListType lt2=MemberListType::Invalid(),bool invert=FALSE,bool showAlways=FALSE) const override
776 { getCdAlias()->writeMemberDeclarations(ol,visitedClasses,lt,title,subTitle,showInline,inheritedFrom,lt2,invert,showAlways); }
778 const ClassDef *inheritedFrom,const QCString &inheritId) const override
779 { getCdAlias()->addGroupedInheritedMembers(ol,lt,inheritedFrom,inheritId); }
780
781 void updateBaseClasses(const BaseClassList &) override {}
782 void updateSubClasses(const BaseClassList &) override {}
783};
784
785std::unique_ptr<ClassDef> createClassDefAlias(const Definition *newScope,const ClassDef *cd)
786{
787 auto acd = std::make_unique<ClassDefAliasImpl>(newScope,cd);
788 //printf("cd name=%s localName=%s qualifiedName=%s qualifiedNameWith=%s displayName()=%s\n",
789 // qPrint(acd->name()),qPrint(acd->localName()),qPrint(acd->qualifiedName()),
790 // qPrint(acd->qualifiedNameWithTemplateParameters()),qPrint(acd->displayName()));
791 return acd;
792}
793
794//-----------------------------------------------------------------------------
795
796// constructs a new class definition
798 const QCString &defFileName,int defLine,int defColumn,
799 const QCString &nm,CompoundType ct,
800 const QCString &lref,const QCString &fName,
801 bool isSymbol,bool isJavaEnum)
802 : DefinitionMixin(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),nullptr,nullptr,isSymbol)
803{
804 AUTO_TRACE("name={}",name());
805 setReference(lref);
806 m_compType = ct;
809 if (!fName.isEmpty())
810 {
812 }
813 else
814 {
815 m_fileName=compTypeString+name();
816 }
818 //nspace=nullptr;
819 m_fileDef=nullptr;
820 m_moduleDef=nullptr;
821 m_subGrouping=Config_getBool(SUBGROUPING);
822 m_templateMaster =nullptr;
827 m_categoryOf = nullptr;
829 m_isSimple = Config_getBool(INLINE_SIMPLE_STRUCTS);
830 m_arrowOperator = nullptr;
831 m_tagLessRef = nullptr;
833 //QCString ns;
834 //extractNamespaceName(name,className,ns);
835 //printf("m_name=%s m_className=%s ns=%s\n",qPrint(m_name),qPrint(m_className),qPrint(ns));
836
837 // we cannot use getLanguage at this point, as setLanguage has not been called.
838 SrcLangExt lang = getLanguageFromFileName(defFileName);
839 if ((lang==SrcLangExt::Cpp || lang==SrcLangExt::ObjC) && guessSection(defFileName).isSource())
840 {
842 }
843 else
844 {
846 }
847 m_hasCollaborationGraph = Config_getBool(COLLABORATION_GRAPH);
849 m_memberListFileName = convertNameToFile(compTypeString+name()+"-members");
852 if (lref.isEmpty())
853 {
855 }
856 AUTO_TRACE_EXIT("m_fileName='{}'",m_fileName);
857}
858
859std::unique_ptr<ClassDef> ClassDefImpl::deepCopy(const QCString &name) const
860{
861 AUTO_TRACE("name='{}'",name);
862 auto result = std::make_unique<ClassDefImpl>(
864 std::string(),std::string(),true,m_isJavaEnum);
865 result->setBriefDescription(briefDescription(),briefFile(),briefLine());
866 result->setDocumentation(documentation(),docFile(),docLine());
867 result->setInbodyDocumentation(inbodyDocumentation(),inbodyFile(),inbodyLine());
868 result->setBodySegment(getStartDefLine(),getStartBodyLine(),getEndBodyLine());
869 result->setBodyDef(getBodyDef());
870 result->setLanguage(getLanguage());
871
872 // copy other members
873 result->m_memberListFileName = m_memberListFileName;
874 result->m_collabFileName = m_collabFileName;
875 result->m_inheritFileName = m_inheritFileName;
876 if (m_incInfo)
877 {
878 result->m_incInfo = std::make_unique<IncludeInfo>();
879 *(result->m_incInfo) = *m_incInfo;
880 }
881 result->m_inherits = m_inherits;
882 result->m_inheritedBy = m_inheritedBy;
883 result->m_fileDef = m_fileDef;
884 result->m_moduleDef = m_moduleDef;
885 result->m_tempArgs = m_tempArgs;
886 result->m_typeConstraints = m_typeConstraints;
887 result->m_files = m_files;
888 result->m_examples = m_examples;
889 result->m_compType = m_compType;
890 result->m_prot = m_prot;
891 result->m_usesImplClassList = m_usesImplClassList;
892 result->m_usedByImplClassList = m_usedByImplClassList;
893 result->m_constraintClassList = m_constraintClassList;
894 result->m_templateInstances = m_templateInstances;
895 result->m_templBaseClassNames = m_templBaseClassNames;
896 result->m_templateMaster = m_templateMaster;
897 result->m_className = m_className;
898 result->m_categoryOf = m_categoryOf;
899 result->m_isAbstract = m_isAbstract;
900 result->m_isStatic = m_isStatic;
901 result->m_membersMerged = m_membersMerged;
902 result->m_isLocal = m_isLocal;
903 result->m_isTemplArg = m_isTemplArg;
904 result->m_subGrouping = m_subGrouping;
905 result->m_usedOnly = m_usedOnly;
906 result->m_vhdlSummaryTitles = m_vhdlSummaryTitles;
907 result->m_isSimple = m_isSimple;
908 result->m_arrowOperator = m_arrowOperator;
909 result->m_tagLessRef = m_tagLessRef;
910 result->m_isJavaEnum = m_isJavaEnum;
911 result->m_spec = m_spec;
912 result->m_metaData = m_metaData;
913 result->m_requiresClause = m_requiresClause;
914 result->m_qualifiers = m_qualifiers;
915 result->m_hasCollaborationGraph = m_hasCollaborationGraph;
916 result->m_typeInheritanceGraph = m_typeInheritanceGraph;
917
918 // set new file name
920 result->m_fileName = compTypeString+name;
921 result->m_memberListFileName = convertNameToFile(compTypeString+name+"-members");
922 result->m_collabFileName = convertNameToFile(result->m_fileName+"_coll_graph");
923 result->m_inheritFileName = convertNameToFile(result->m_fileName+"_inherit_graph");
924 result->m_fileName = convertNameToFile(result->m_fileName);
925
926 // deep copy nested classes
927 for (const auto &innerCd : m_innerClasses)
928 {
929 QCString innerName = name+"::"+innerCd->localName();
930 if (Doxygen::classLinkedMap->find(innerName)==nullptr)
931 {
932 auto cd = Doxygen::classLinkedMap->add(innerName,innerCd->deepCopy(innerName));
933 result->addInnerCompound(cd);
935 if (cdm)
936 {
937 cdm->setOuterScope(result.get());
938 }
939 }
940 }
941
942 // copy all member list (and make deep copies of members)
943 for (auto &mni : m_allMemberNameInfoLinkedMap)
944 {
945 for (auto &mi : *mni)
946 {
947 const MemberDef *md=mi->memberDef();
948 auto newMd = md->deepCopy();
949 if (newMd)
950 {
951 auto mmd = toMemberDefMutable(newMd.get());
952 AUTO_TRACE_ADD("Copying member {}",mmd->name());
953 mmd->moveTo(result.get());
954
955 result->internalInsertMember(newMd.get(),newMd->protection(),true);
956
957 // also add to the global list (which will own newMd)
958 MemberName *mn = Doxygen::memberNameLinkedMap->add(newMd->name());
959 mn->push_back(std::move(newMd));
960 }
961 }
962 }
963
964 return result;
965}
966
968{
969 //printf("%s::moveTo(%s)\n",qPrint(name()),qPrint(scope->name()));
970 setOuterScope(scope);
972 {
973 m_fileDef = toFileDef(scope);
974 }
975 else if (scope->definitionType()==Definition::TypeModule)
976 {
977 m_moduleDef = toModuleDef(scope);
978 }
979}
980
985
986QCString ClassDefImpl::displayName(bool includeScope) const
987{
988 return makeDisplayName(this,includeScope);
989}
990
991// inserts a base/super class in the inheritance list
993 Specifier s,const QCString &t)
994{
995 //printf("*** insert base class %s into %s\n",qPrint(cd->name()),qPrint(name()));
996 m_inherits.emplace_back(cd,n,p,s,t);
998}
999
1000// inserts a derived/sub class in the inherited-by list
1002 Specifier s,const QCString &t)
1003{
1004 //printf("*** insert sub class %s into %s\n",qPrint(cd->name()),qPrint(name()));
1005 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
1006 if (!extractPrivate && cd->protection()==Protection::Private) return;
1007 m_inheritedBy.emplace_back(cd,QCString(),p,s,t);
1008 m_isSimple = FALSE;
1009}
1010
1012{
1013 for (auto &ml : m_memberLists)
1014 {
1015 if (!ml->listType().isDetailed())
1016 {
1018 }
1019 }
1020
1021 // add members inside sections to their groups
1022 for (const auto &mg : m_memberGroups)
1023 {
1024 if (mg->allMembersInSameSection() && m_subGrouping)
1025 {
1026 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
1027 mg->addToDeclarationSection();
1028 }
1029 }
1030}
1031
1032// adds new member definition to the class
1034 Protection prot,
1035 bool addToAllList
1036 )
1037{
1038 AUTO_TRACE("{} name={} isHidden={}",name(),md->name(),md->isHidden());
1039 if (md->isHidden()) return;
1040
1042 {
1044 m_vhdlSummaryTitles.insert(title.str());
1045 }
1046
1047 if (1 /*!isReference()*/) // changed to 1 for showing members of external
1048 // classes when HAVE_DOT and UML_LOOK are enabled.
1049 {
1050 bool isSimple=FALSE;
1051
1052 /********************************************/
1053 /* insert member in the declaration section */
1054 /********************************************/
1055 if (md->isRelated() && protectionLevelVisible(prot))
1056 {
1057 addMemberToList(MemberListType::Related(),md,TRUE);
1058 }
1059 else if (md->isFriend())
1060 {
1061 addMemberToList(MemberListType::Friends(),md,TRUE);
1062 }
1063 else
1064 {
1065 switch (md->memberType())
1066 {
1067 case MemberType::Service: // UNO IDL
1068 addMemberToList(MemberListType::Services(),md,TRUE);
1069 break;
1070 case MemberType::Interface: // UNO IDL
1071 addMemberToList(MemberListType::Interfaces(),md,TRUE);
1072 break;
1073 case MemberType::Signal: // Qt specific
1074 addMemberToList(MemberListType::Signals(),md,TRUE);
1075 break;
1076 case MemberType::DCOP: // KDE2 specific
1077 addMemberToList(MemberListType::DcopMethods(),md,TRUE);
1078 break;
1080 addMemberToList(MemberListType::Properties(),md,TRUE);
1081 break;
1082 case MemberType::Event:
1083 addMemberToList(MemberListType::Events(),md,TRUE);
1084 break;
1085 case MemberType::Slot: // Qt specific
1086 switch (prot)
1087 {
1089 case Protection::Package: // slots in packages are not possible!
1090 addMemberToList(MemberListType::ProSlots(),md,TRUE);
1091 break;
1092 case Protection::Public:
1093 addMemberToList(MemberListType::PubSlots(),md,TRUE);
1094 break;
1096 addMemberToList(MemberListType::PriSlots(),md,TRUE);
1097 break;
1098 }
1099 break;
1100 default: // any of the other members
1101 if (md->isStatic())
1102 {
1103 if (md->isVariable())
1104 {
1105 switch (prot)
1106 {
1108 addMemberToList(MemberListType::ProStaticAttribs(),md,TRUE);
1109 break;
1111 addMemberToList(MemberListType::PacStaticAttribs(),md,TRUE);
1112 break;
1113 case Protection::Public:
1114 addMemberToList(MemberListType::PubStaticAttribs(),md,TRUE);
1115 break;
1117 addMemberToList(MemberListType::PriStaticAttribs(),md,TRUE);
1118 break;
1119 }
1120 }
1121 else // function
1122 {
1123 switch (prot)
1124 {
1126 addMemberToList(MemberListType::ProStaticMethods(),md,TRUE);
1127 break;
1129 addMemberToList(MemberListType::PacStaticMethods(),md,TRUE);
1130 break;
1131 case Protection::Public:
1132 addMemberToList(MemberListType::PubStaticMethods(),md,TRUE);
1133 break;
1135 addMemberToList(MemberListType::PriStaticMethods(),md,TRUE);
1136 break;
1137 }
1138 }
1139 }
1140 else // not static
1141 {
1142 if (md->isVariable())
1143 {
1144 switch (prot)
1145 {
1147 addMemberToList(MemberListType::ProAttribs(),md,TRUE);
1148 break;
1150 addMemberToList(MemberListType::PacAttribs(),md,TRUE);
1151 break;
1152 case Protection::Public:
1153 addMemberToList(MemberListType::PubAttribs(),md,TRUE);
1154 isSimple=TRUE;
1155 break;
1157 addMemberToList(MemberListType::PriAttribs(),md,TRUE);
1158 break;
1159 }
1160 }
1161 else if (md->isTypedef() || md->isEnumerate() || md->isEnumValue())
1162 {
1163 switch (prot)
1164 {
1166 addMemberToList(MemberListType::ProTypes(),md,TRUE);
1167 break;
1169 addMemberToList(MemberListType::PacTypes(),md,TRUE);
1170 break;
1171 case Protection::Public:
1172 addMemberToList(MemberListType::PubTypes(),md,TRUE);
1173 isSimple=!md->isEnumerate() &&
1174 !md->isEnumValue() &&
1175 QCString(md->typeString()).find(")(")==-1; // func ptr typedef
1176 break;
1178 addMemberToList(MemberListType::PriTypes(),md,TRUE);
1179 break;
1180 }
1181 }
1182 else // member function
1183 {
1184 switch (prot)
1185 {
1187 addMemberToList(MemberListType::ProMethods(),md,TRUE);
1188 break;
1190 addMemberToList(MemberListType::PacMethods(),md,TRUE);
1191 break;
1192 case Protection::Public:
1193 addMemberToList(MemberListType::PubMethods(),md,TRUE);
1194 break;
1196 addMemberToList(MemberListType::PriMethods(),md,TRUE);
1197 break;
1198 }
1199 }
1200 }
1201 break;
1202 }
1203 }
1204 if (!isSimple) // not a simple field -> not a simple struct
1205 {
1206 m_isSimple = FALSE;
1207 }
1208 //printf("adding %s simple=%d total_simple=%d\n",qPrint(name()),isSimple,m_isSimple);
1209
1210 /*******************************************************/
1211 /* insert member in the detailed documentation section */
1212 /*******************************************************/
1213 if ((md->isRelated() && protectionLevelVisible(prot)) || md->isFriend())
1214 {
1215 addMemberToList(MemberListType::RelatedMembers(),md,FALSE);
1216 }
1217 else if (md->isFunction() &&
1219 (md->virtualness()!=Specifier::Normal || md->isOverride() || md->isFinal()) &&
1220 Config_getBool(EXTRACT_PRIV_VIRTUAL))
1221 {
1222 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1223 }
1224 else
1225 {
1226 switch (md->memberType())
1227 {
1228 case MemberType::Service: // UNO IDL
1229 addMemberToList(MemberListType::ServiceMembers(),md,FALSE);
1230 break;
1231 case MemberType::Interface: // UNO IDL
1232 addMemberToList(MemberListType::InterfaceMembers(),md,FALSE);
1233 break;
1235 addMemberToList(MemberListType::PropertyMembers(),md,FALSE);
1236 break;
1237 case MemberType::Event:
1238 addMemberToList(MemberListType::EventMembers(),md,FALSE);
1239 break;
1240 case MemberType::Signal: // fall through
1241 case MemberType::DCOP:
1242 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1243 break;
1244 case MemberType::Slot:
1245 if (protectionLevelVisible(prot))
1246 {
1247 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1248 }
1249 break;
1250 default: // any of the other members
1251 if (protectionLevelVisible(prot))
1252 {
1253 switch (md->memberType())
1254 {
1256 addMemberToList(MemberListType::TypedefMembers(),md,FALSE);
1257 break;
1259 addMemberToList(MemberListType::EnumMembers(),md,FALSE);
1260 break;
1262 addMemberToList(MemberListType::EnumValMembers(),md,FALSE);
1263 break;
1265 if (md->isConstructor() || md->isDestructor())
1266 {
1267 m_memberLists.get(MemberListType::Constructors(),MemberListContainer::Class)->push_back(md);
1268 }
1269 else
1270 {
1271 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1272 }
1273 break;
1275 addMemberToList(MemberListType::VariableMembers(),md,FALSE);
1276 break;
1277 case MemberType::Define:
1278 warn(md->getDefFileName(),md->getDefLine()-1,"A define ({}) cannot be made a member of {}",
1279 md->name(), this->name());
1280 break;
1281 default:
1282 err("Unexpected member type '{}' found!\n",md->memberTypeName());
1283 }
1284 }
1285 break;
1286 }
1287 }
1288
1289 /*************************************************/
1290 /* insert member in the appropriate member group */
1291 /*************************************************/
1292 // Note: this must be done AFTER inserting the member in the
1293 // regular groups
1294 //addMemberToGroup(md,groupId);
1295
1296 }
1297
1298 if (md->virtualness()==Specifier::Pure)
1299 {
1300 m_isAbstract=true;
1301 }
1302
1303 if (md->name()=="operator->")
1304 {
1305 m_arrowOperator=md;
1306 }
1307
1308 if (addToAllList &&
1309 !(Config_getBool(HIDE_FRIEND_COMPOUNDS) &&
1310 md->isFriend() &&
1311 (QCString(md->typeString())=="friend class" ||
1312 QCString(md->typeString())=="friend struct" ||
1313 QCString(md->typeString())=="friend union")))
1314 {
1315 //printf("=======> adding member %s to class %s\n",qPrint(md->name()),qPrint(name()));
1316
1318 mni->push_back(std::make_unique<MemberInfo>(md,prot,md->virtualness(),false,false));
1319 }
1320
1321 // if we already created template instances before inserting this member (i.e. due to a typedef or using statement)
1322 // then we also need to insert the member in the template instance.
1323 for (const auto &ti : getTemplateInstances())
1324 {
1325 //printf("member %s of class %s with template instance %s\n",qPrint(md->name()),qPrint(name()),
1326 // qPrint(ti.templSpec));
1327 ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
1328 if (cdm)
1329 {
1330 cdm->addMemberToTemplateInstance(md,templateArguments(),ti.templSpec);
1331 }
1332 }
1333
1334}
1335
1340
1341// compute the anchors for all members
1343{
1344 for (auto &ml : m_memberLists)
1345 {
1346 if (!ml->listType().isDetailed())
1347 {
1348 ml->setAnchors();
1349 }
1350 }
1351
1352 for (const auto &mg : m_memberGroups)
1353 {
1354 mg->setAnchors();
1355 }
1356}
1357
1359{
1360 for (const auto &mg : m_memberGroups)
1361 {
1362 mg->distributeMemberGroupDocumentation();
1363 }
1364}
1365
1367{
1371 for (const auto &mg : m_memberGroups)
1372 {
1373 mg->findSectionsInDocumentation(this);
1374 }
1375 for (auto &ml : m_memberLists)
1376 {
1377 if (!ml->listType().isDetailed())
1378 {
1379 ml->findSectionsInDocumentation(this);
1380 }
1381 }
1382}
1383
1384
1385// add a file name to the used files set
1387{
1388 if (fd==nullptr) return;
1389 auto it = std::find(m_files.begin(),m_files.end(),fd);
1390 if (it==m_files.end())
1391 {
1392 m_files.push_back(fd);
1393 }
1394 for (const auto &ti : m_templateInstances)
1395 {
1396 ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
1397 if (cdm)
1398 {
1399 cdm->insertUsedFile(fd);
1400 }
1401 }
1402}
1403
1405{
1407 {
1408 ol.startTypewriter();
1409 ol.docify(" [");
1410 StringVector sl;
1411 if (bcd.prot==Protection::Protected) sl.emplace_back("protected");
1412 else if (bcd.prot==Protection::Private) sl.emplace_back("private");
1413 if (bcd.virt==Specifier::Virtual) sl.emplace_back("virtual");
1414 bool first=true;
1415 for (const auto &s : sl)
1416 {
1417 if (!first) ol.docify(", ");
1418 ol.docify(s.c_str());
1419 first=false;
1420 }
1421 ol.docify("]");
1422 ol.endTypewriter();
1423 }
1424}
1425
1427 const QCString &includeName,bool local, bool force)
1428{
1429 //printf("ClassDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,includeName,local,force);
1430 if (!m_incInfo) m_incInfo = std::make_unique<IncludeInfo>();
1431 if ((!includeName.isEmpty() && m_incInfo->includeName.isEmpty()) ||
1432 (fd!=nullptr && m_incInfo->fileDef==nullptr)
1433 )
1434 {
1435 //printf("Setting file info\n");
1436 m_incInfo->fileDef = fd;
1437 m_incInfo->includeName = includeName;
1439 }
1440 if (force && !includeName.isEmpty())
1441 {
1442 m_incInfo->includeName = includeName;
1444 }
1445}
1446
1447// TODO: fix this: a nested template class can have multiple outer templates
1448//ArgumentList *ClassDefImpl::outerTemplateArguments() const
1449//{
1450// int ti;
1451// ClassDef *pcd=nullptr;
1452// int pi=0;
1453// if (m_tempArgs) return m_tempArgs;
1454// // find the outer most class scope
1455// while ((ti=name().find("::",pi))!=-1 &&
1456// (pcd=getClass(name().left(ti)))==0
1457// ) pi=ti+2;
1458// if (pcd)
1459// {
1460// return pcd->templateArguments();
1461// }
1462// return nullptr;
1463//}
1464
1465static void searchTemplateSpecs(/*in*/ const Definition *d,
1466 /*out*/ ArgumentLists &result,
1467 /*out*/ QCString &name,
1468 /*in*/ SrcLangExt lang)
1469{
1471 {
1472 if (d->getOuterScope())
1473 {
1474 searchTemplateSpecs(d->getOuterScope(),result,name,lang);
1475 }
1476 const ClassDef *cd=toClassDef(d);
1477 if (!name.isEmpty()) name+="::";
1478 QCString clName = d->localName();
1479 if (clName.endsWith("-p"))
1480 {
1481 clName = clName.left(clName.length()-2);
1482 }
1483 name+=clName;
1484 bool isSpecialization = d->localName().find('<')!=-1;
1485 if (!cd->templateArguments().empty())
1486 {
1487 result.push_back(cd->templateArguments());
1488 if (!isSpecialization)
1489 {
1490 name+=tempArgListToString(cd->templateArguments(),lang);
1491 }
1492 }
1493 }
1494 else
1495 {
1496 name+=d->qualifiedName();
1497 }
1498}
1499
1501 const QCString &type,SrcLangExt lang) const
1502{
1503 ArgumentLists specs;
1504 QCString name;
1505 searchTemplateSpecs(d,specs,name,lang);
1506 if (!specs.empty()) // class has template scope specifiers
1507 {
1509 for (const ArgumentList &al : specs)
1510 {
1511 ol.docify("template<");
1512 auto it = al.begin();
1513 while (it!=al.end())
1514 {
1515 Argument a = *it;
1517 d, // scope
1518 getFileDef(), // fileScope
1519 this, // self
1520 a.type, // text
1521 FALSE // autoBreak
1522 );
1523 if (!a.name.isEmpty())
1524 {
1525 ol.docify(" ");
1526 ol.docify(a.name);
1527 }
1528 if (a.defval.length()!=0)
1529 {
1530 ol.docify(" = ");
1531 ol.docify(a.defval);
1532 }
1533 ++it;
1534 if (it!=al.end()) ol.docify(", ");
1535 }
1536 ol.docify(">");
1537 ol.lineBreak();
1538 }
1539 if (!m_requiresClause.isEmpty())
1540 {
1541 ol.docify("requires ");
1543 d, // scope
1544 getFileDef(), // fileScope
1545 this, // self
1546 m_requiresClause, // text
1547 FALSE // autoBreak
1548 );
1549 ol.lineBreak();
1550 }
1551 ol.docify(type.lower()+" "+name);
1553 }
1554}
1555
1556void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) const
1557{
1558 if (hasBriefDescription())
1559 {
1560 ol.startParagraph();
1561 ol.pushGeneratorState();
1563 ol.writeString(" - ");
1564 ol.popGeneratorState();
1565 ol.generateDoc(briefFile(),briefLine(),this,nullptr,
1567 TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
1568 ol.pushGeneratorState();
1570 ol.writeString(" \n");
1572 ol.popGeneratorState();
1573
1574 if (hasDetailedDescription() || exampleFlag)
1575 {
1576 writeMoreLink(ol,anchor());
1577 }
1578
1579 ol.endParagraph();
1580 }
1581 ol.writeSynopsis();
1582}
1583
1585{
1586 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1587
1588 ol.startTextBlock();
1589
1591 {
1593 }
1594
1595 // repeat brief description
1596 if (!briefDescription().isEmpty() && repeatBrief)
1597 {
1599 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
1600 }
1601 if (!briefDescription().isEmpty() && repeatBrief &&
1602 !documentation().isEmpty())
1603 {
1604 ol.pushGeneratorState();
1606 ol.writeString("\n\n");
1607 ol.popGeneratorState();
1608 }
1609 // write documentation
1610 if (!documentation().isEmpty())
1611 {
1612 ol.generateDoc(docFile(),docLine(),this,nullptr,documentation(),TRUE,FALSE,
1613 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
1614 }
1615 // write type constraints
1617
1618 // write examples
1619 if (hasExamples())
1620 {
1621 ol.startExamples();
1622 ol.startDescForItem();
1624 ol.endDescForItem();
1625 ol.endExamples();
1626 }
1627 writeSourceDef(ol);
1628 ol.endTextBlock();
1629}
1630
1632{
1633 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1634 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1635 return ((!briefDescription().isEmpty() && repeatBrief) ||
1636 !documentation().isEmpty() ||
1637 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()));
1638}
1639
1640// write the detailed description for this class
1641void ClassDefImpl::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag,
1642 const QCString &title,const QCString &anchor) const
1643{
1644 if (hasDetailedDescription() || exampleFlag)
1645 {
1646 ol.pushGeneratorState();
1648 ol.writeRuler();
1649 ol.popGeneratorState();
1650
1651 ol.pushGeneratorState();
1653 ol.writeAnchor(QCString(),anchor.isEmpty() ? QCString("details") : anchor);
1654 ol.popGeneratorState();
1655
1656 if (!anchor.isEmpty())
1657 {
1658 ol.pushGeneratorState();
1662 ol.popGeneratorState();
1663 }
1664
1665 ol.startGroupHeader();
1666 ol.parseText(title);
1667 ol.endGroupHeader();
1668
1670 }
1671 else
1672 {
1673 //writeTemplateSpec(ol,this,pageType);
1674 }
1675}
1676
1678{
1679 QCString result;
1680 SrcLangExt lang = getLanguage();
1681 size_t numFiles = m_files.size();
1682 if (lang==SrcLangExt::Fortran)
1683 {
1684 result = theTranslator->trGeneratedFromFilesFortran(
1686 numFiles==1);
1687 }
1688 else if (isJavaEnum())
1689 {
1690 result = theTranslator->trEnumGeneratedFromFiles(numFiles==1);
1691 }
1692 else if (m_compType==Service)
1693 {
1694 result = theTranslator->trServiceGeneratedFromFiles(numFiles==1);
1695 }
1696 else if (m_compType==Singleton)
1697 {
1698 result = theTranslator->trSingletonGeneratedFromFiles(numFiles==1);
1699 }
1700 else
1701 {
1702 result = theTranslator->trGeneratedFromFiles(
1704 numFiles==1);
1705 }
1706 return result;
1707}
1708
1710{
1711 ol.pushGeneratorState();
1713
1714
1715 ol.writeRuler();
1716 ol.pushGeneratorState();
1718 ol.startParagraph();
1720 ol.endParagraph();
1721 ol.popGeneratorState();
1725
1726 bool first=TRUE;
1727 for (const auto &fd : m_files)
1728 {
1729 if (first)
1730 {
1731 first=FALSE;
1732 ol.startItemList();
1733 }
1734
1735 ol.startItemListItem();
1736 QCString path=fd->getPath();
1737 if (Config_getBool(FULL_PATH_NAMES))
1738 {
1739 ol.docify(stripFromPath(path));
1740 }
1741
1742 QCString fname = fd->name();
1743 if (!fd->getVersion().isEmpty()) // append version if available
1744 {
1745 fname += " (" + fd->getVersion() + ")";
1746 }
1747
1748 // for HTML
1749 ol.pushGeneratorState();
1751 if (fd->generateSourceFile())
1752 {
1753 ol.writeObjectLink(QCString(),fd->getSourceFileBase(),QCString(),fname);
1754 }
1755 else if (fd->isLinkable())
1756 {
1757 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
1758 }
1759 else
1760 {
1761 ol.startBold();
1762 ol.docify(fname);
1763 ol.endBold();
1764 }
1765 ol.popGeneratorState();
1766
1767 // for other output formats
1768 ol.pushGeneratorState();
1770 if (fd->isLinkable())
1771 {
1772 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
1773 }
1774 else
1775 {
1776 ol.docify(fname);
1777 }
1778 ol.popGeneratorState();
1779
1780 ol.endItemListItem();
1781 }
1782 if (!first) ol.endItemList();
1783
1784 ol.popGeneratorState();
1785}
1786
1788{
1789 int count=0;
1790 for (const auto &ibcd : m_inheritedBy)
1791 {
1792 const ClassDef *icd=ibcd.classDef;
1793 if ( icd->isVisibleInHierarchy()) count++;
1794 }
1795 return count;
1796}
1797
1799{
1800 int count=0;
1801 for (const auto &ibcd : m_inherits)
1802 {
1803 const ClassDef *icd=ibcd.classDef;
1804 if ( icd->isVisibleInHierarchy()) count++;
1805 }
1806 return count;
1807}
1808
1813
1815{
1816 bool haveDot = Config_getBool(HAVE_DOT);
1817 auto classGraph = m_typeInheritanceGraph;
1818
1819 if (classGraph == CLASS_GRAPH_t::NO) return;
1820 // count direct inheritance relations
1821 int count=countInheritanceNodes();
1822
1823 bool renderDiagram = FALSE;
1824 if (haveDot && (classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH))
1825 // write class diagram using dot
1826 {
1827 DotClassGraph inheritanceGraph(this,GraphType::Inheritance);
1828 if (inheritanceGraph.isTooBig())
1829 {
1830 warn_uncond("Inheritance graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
1831 name(), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
1832 }
1833 else if (!inheritanceGraph.isTrivial())
1834 {
1835 ol.pushGeneratorState();
1837 ol.startDotGraph();
1838 ol.parseText(theTranslator->trClassDiagram(displayName()));
1839 ol.endDotGraph(inheritanceGraph);
1840 ol.popGeneratorState();
1841 renderDiagram = TRUE;
1842 }
1843 }
1844 else if ((classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH || classGraph==CLASS_GRAPH_t::BUILTIN) && count>0)
1845 // write class diagram using built-in generator
1846 {
1847 ClassDiagram diagram(this); // create a diagram of this class.
1848 ol.startClassDiagram();
1850 ol.parseText(theTranslator->trClassDiagram(displayName()));
1853 renderDiagram = TRUE;
1854 }
1855
1856 if (renderDiagram) // if we already show the inheritance relations graphically,
1857 // then hide the text version
1858 {
1860 }
1861
1862 count = countInheritsNodes();
1863 if (count>0)
1864 {
1865 auto replaceFunc = [this,&ol](size_t entryIndex)
1866 {
1867 for (size_t index=0; index<m_inherits.size() ; index++)
1868 {
1869 const BaseClassDef &bcd=m_inherits[index];
1870 const ClassDef *cd=bcd.classDef;
1871
1872 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1873 {
1874 if (index==entryIndex) // found the requested index
1875 {
1876 // use the class name but with the template arguments as given
1877 // in the inheritance relation
1879 cd->displayName(),bcd.templSpecifiers);
1880
1881 if (cd->isLinkable())
1882 {
1884 cd->getOutputFileBase(),
1885 cd->anchor(),
1886 displayName);
1887 }
1888 else
1889 {
1890 ol.docify(displayName);
1891 }
1892 return;
1893 }
1894 }
1895 }
1896 };
1897
1898 ol.startParagraph();
1899 writeMarkerList(ol,
1900 theTranslator->trInheritsList(count).str(),
1901 static_cast<size_t>(count),
1902 replaceFunc);
1903 ol.endParagraph();
1904 }
1905
1906 // write subclasses
1907 count = countInheritedByNodes();
1908 if (count>0)
1909 {
1910 auto replaceFunc = [this,&ol](size_t entryIndex)
1911 {
1912 for (size_t index=0; index<m_inheritedBy.size() ; index++)
1913 {
1914 const BaseClassDef &bcd=m_inheritedBy[index];
1915 const ClassDef *cd=bcd.classDef;
1916 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1917 {
1918 if (index==entryIndex) // found the requested index
1919 {
1920 if (cd->isLinkable())
1921 {
1924 }
1925 else
1926 {
1927 ol.docify(cd->displayName());
1928 }
1929 return;
1930 }
1931 }
1932 }
1933 };
1934
1935 ol.startParagraph();
1936 writeMarkerList(ol,
1937 theTranslator->trInheritedByList(count).str(),
1938 static_cast<size_t>(count),
1939 replaceFunc);
1940 ol.endParagraph();
1941 }
1942
1943 if (renderDiagram)
1944 {
1945 ol.enableAll();
1946 }
1947}
1948
1950{
1951 if (Config_getBool(HAVE_DOT) && m_hasCollaborationGraph /*&& Config_getBool(COLLABORATION_GRAPH)*/)
1952 {
1953 DotClassGraph usageImplGraph(this,GraphType::Collaboration);
1954 if (usageImplGraph.isTooBig())
1955 {
1956 warn_uncond("Collaboration graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
1957 name(), usageImplGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
1958 }
1959 else if (!usageImplGraph.isTrivial())
1960 {
1961 ol.pushGeneratorState();
1963 ol.startDotGraph();
1964 ol.parseText(theTranslator->trCollaborationDiagram(displayName()));
1965 ol.endDotGraph(usageImplGraph);
1966 ol.popGeneratorState();
1967 }
1968 }
1969}
1970
1971
1973{
1974 if (m_incInfo)
1975 {
1976 QCString nm;
1977 const StringVector &paths = Config_getList(STRIP_FROM_PATH);
1978 if (!paths.empty() && m_incInfo->fileDef)
1979 {
1980 QCString abs = m_incInfo->fileDef->absFilePath();
1981 QCString potential;
1982 size_t length = 0;
1983 for (const auto &s : paths)
1984 {
1985 FileInfo info(s);
1986 if (info.exists())
1987 {
1988 QCString prefix = info.absFilePath();
1989 if (prefix.at(prefix.length() - 1) != '/')
1990 {
1991 prefix += '/';
1992 }
1993
1994 if (prefix.length() > length &&
1995 qstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare
1996 {
1997 length = prefix.length();
1998 potential = abs.right(abs.length() - prefix.length());
1999 }
2000 }
2001 }
2002
2003 if (length > 0)
2004 {
2005 nm = potential;
2006 }
2007 }
2008
2009 if (nm.isEmpty())
2010 {
2011 nm = m_incInfo->includeName;
2012 }
2013
2014 ol.startParagraph();
2015 ol.docify(theTranslator->trDefinedIn()+" ");
2016 ol.startTypewriter();
2017 ol.docify("<");
2018 if (m_incInfo->fileDef)
2019 {
2020 ol.writeObjectLink(QCString(),m_incInfo->fileDef->includeName(),QCString(),nm);
2021 }
2022 else
2023 {
2024 ol.docify(nm);
2025 }
2026 ol.docify(">");
2027 ol.endTypewriter();
2028 ol.endParagraph();
2029 }
2030
2031 // Write a summary of the Slice definition including metadata.
2032 ol.startParagraph();
2033 ol.startTypewriter();
2034 if (!m_metaData.isEmpty())
2035 {
2036 ol.docify(m_metaData);
2037 ol.lineBreak();
2038 }
2039 if (m_spec.isLocal())
2040 {
2041 ol.docify("local ");
2042 }
2043 if (m_spec.isInterface())
2044 {
2045 ol.docify("interface ");
2046 }
2047 else if (m_spec.isStruct())
2048 {
2049 ol.docify("struct ");
2050 }
2051 else if (m_spec.isException())
2052 {
2053 ol.docify("exception ");
2054 }
2055 else
2056 {
2057 ol.docify("class ");
2058 }
2059 ol.docify(stripScope(name()));
2060 if (!m_inherits.empty())
2061 {
2062 if (m_spec.isInterface() || m_spec.isException())
2063 {
2064 ol.docify(" extends ");
2065 bool first=true;
2066 for (const auto &ibcd : m_inherits)
2067 {
2068 if (!first) ol.docify(", ");
2069 ClassDef *icd = ibcd.classDef;
2070 ol.docify(icd->name());
2071 first=false;
2072 }
2073 }
2074 else
2075 {
2076 // Must be a class.
2077 bool implements = false;
2078 for (const auto &ibcd : m_inherits)
2079 {
2080 ClassDef *icd = ibcd.classDef;
2081 if (icd->isInterface())
2082 {
2083 implements = true;
2084 }
2085 else
2086 {
2087 ol.docify(" extends ");
2088 ol.docify(icd->name());
2089 }
2090 }
2091 if (implements)
2092 {
2093 ol.docify(" implements ");
2094 bool first = true;
2095 for (const auto &ibcd : m_inherits)
2096 {
2097 ClassDef *icd = ibcd.classDef;
2098 if (icd->isInterface())
2099 {
2100 if (!first) ol.docify(", ");
2101 first = false;
2102 ol.docify(icd->name());
2103 }
2104 }
2105 }
2106 }
2107 }
2108 ol.docify(" { ... }");
2109 ol.endTypewriter();
2110 ol.endParagraph();
2111}
2112
2114{
2115 if (m_incInfo /*&& Config_getBool(SHOW_HEADERFILE)*/)
2116 {
2117 SrcLangExt lang = getLanguage();
2118 QCString nm=m_incInfo->includeName.isEmpty() ?
2119 (m_incInfo->fileDef ?
2120 m_incInfo->fileDef->docName() : QCString()
2121 ) :
2122 m_incInfo->includeName;
2123 if (!nm.isEmpty())
2124 {
2125 ol.startParagraph();
2126 ol.startTypewriter();
2127 ol.docify(::includeStatement(lang,m_incInfo->kind));
2128 ol.docify(::includeOpen(lang,m_incInfo->kind));
2129 ol.pushGeneratorState();
2131 ol.docify(nm);
2134 if (m_incInfo->fileDef)
2135 {
2136 ol.writeObjectLink(QCString(),m_incInfo->fileDef->includeName(),QCString(),nm);
2137 }
2138 else
2139 {
2140 ol.docify(nm);
2141 }
2142 ol.popGeneratorState();
2143 ol.docify(::includeClose(lang,m_incInfo->kind));
2144 ol.endTypewriter();
2145 ol.endParagraph();
2146 }
2147 }
2148}
2149
2150void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) const
2151{
2152 // write user defined member groups
2153 for (const auto &mg : m_memberGroups)
2154 {
2155 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
2156 {
2157 mg->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,showInline);
2158 }
2159 else // add this group to the corresponding member section
2160 {
2161 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
2162 //mg->addToDeclarationSection();
2163 }
2164 }
2165}
2166
2168{
2169 // nested classes
2170 m_innerClasses.writeDeclaration(ol,nullptr,title,TRUE);
2171}
2172
2174{
2175 m_innerClasses.writeDocumentation(ol,this);
2176}
2177
2179{
2180 //printf("%s: ClassDefImpl::startMemberDocumentation()\n",qPrint(name()));
2181 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2182 {
2185 }
2186}
2187
2189{
2190 //printf("%s: ClassDefImpl::endMemberDocumentation()\n",qPrint(name()));
2191 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2192 {
2195 }
2196}
2197
2199{
2200 //printf("%s: ClassDefImpl::startMemberDeclarations()\n",qPrint(name()));
2202}
2203
2205{
2206 //printf("%s: ClassDefImpl::endMemberDeclarations()\n",qPrint(name()));
2207 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
2208 if (!inlineInheritedMembers && countAdditionalInheritedMembers()>0)
2209 {
2210 ol.startMemberHeader("inherited");
2211 ol.parseText(theTranslator->trAdditionalInheritedMembers());
2212 ol.endMemberHeader();
2214 }
2215 ol.endMemberSections();
2216}
2217
2219{
2220 ol.pushGeneratorState();
2222 ol.writeString("\n");
2223 ol.startGroupHeader();
2224 ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
2225 ol.endGroupHeader();
2226 ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString(PROJECT_NAME)));
2227 ol.popGeneratorState();
2228}
2229
2230
2232{
2233 static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2234 ol.pushGeneratorState();
2236 bool first=TRUE;
2237 SrcLangExt lang = getLanguage();
2238
2239 if (lang!=SrcLangExt::VHDL)
2240 {
2241 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2242 {
2243 if (lde->kind()==LayoutDocEntry::ClassNestedClasses &&
2244 m_innerClasses.declVisible()
2245 )
2246 {
2247 for (const auto &innerCd : m_innerClasses)
2248 {
2249 if (!innerCd->isAnonymous() &&
2250 !innerCd->isExtension() &&
2251 (innerCd->protection()!=Protection::Private || extractPrivate) &&
2252 innerCd->visibleInParentsDeclList()
2253 )
2254 {
2255 const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
2256 ol.writeSummaryLink(QCString(),"nested-classes",ls->title(lang),first);
2257 first=FALSE;
2258 break;
2259 }
2260 }
2261 }
2262 else if (lde->kind()==LayoutDocEntry::ClassAllMembersLink &&
2264 !Config_getBool(OPTIMIZE_OUTPUT_FOR_C)
2265 )
2266 {
2267 ol.writeSummaryLink(getMemberListFileName(),"all-members-list",theTranslator->trListOfAllMembers(),first);
2268 first=FALSE;
2269 }
2270 else if (lde->kind()==LayoutDocEntry::MemberDecl)
2271 {
2272 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2273 if (lmd)
2274 {
2275 MemberList * ml = getMemberList(lmd->type);
2276 if (ml && ml->declVisible())
2277 {
2278 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
2279 first=FALSE;
2280 }
2281 }
2282 }
2283 }
2284 }
2285 else // VDHL only
2286 {
2287 for (const auto &s : m_vhdlSummaryTitles)
2288 {
2290 first=FALSE;
2291 }
2292 }
2293 if (!first)
2294 {
2295 ol.writeString(" </div>\n");
2296 }
2297 ol.popGeneratorState();
2298}
2299
2301{
2302 if (!isLinkableInProject() || isArtificial()) return;
2303 tagFile << " <compound kind=\"";
2304 if (isFortran() && (compoundTypeString() == "type"))
2305 tagFile << "struct";
2306 else
2307 tagFile << compoundTypeString();
2308 tagFile << "\"";
2309 if (isObjectiveC()) { tagFile << " objc=\"yes\""; }
2310 tagFile << ">\n";
2311 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
2314 tagFile << " <filename>" << convertToXML(fn) << "</filename>\n";
2315 if (!anchor().isEmpty())
2316 {
2317 tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
2318 }
2319 QCString idStr = id();
2320 if (!idStr.isEmpty())
2321 {
2322 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
2323 }
2324 for (const Argument &a : m_tempArgs)
2325 {
2326 tagFile << " <templarg>" << convertToXML(a.type);
2327 if (!a.name.isEmpty())
2328 {
2329 tagFile << " " << convertToXML(a.name);
2330 }
2331 tagFile << "</templarg>\n";
2332 }
2333 for (const auto &ibcd : m_inherits)
2334 {
2335 ClassDef *cd=ibcd.classDef;
2336 if (cd && cd->isLinkable())
2337 {
2338 tagFile << " <base";
2339 if (ibcd.prot==Protection::Protected)
2340 {
2341 tagFile << " protection=\"protected\"";
2342 }
2343 else if (ibcd.prot==Protection::Private)
2344 {
2345 tagFile << " protection=\"private\"";
2346 }
2347 if (ibcd.virt==Specifier::Virtual)
2348 {
2349 tagFile << " virtualness=\"virtual\"";
2350 }
2352 cd->displayName(),ibcd.templSpecifiers);
2353 tagFile << ">" << convertToXML(displayName) << "</base>\n";
2354 }
2355 }
2356 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2357 {
2358 switch (lde->kind())
2359 {
2360 case LayoutDocEntry::ClassNestedClasses:
2361 {
2362 for (const auto &innerCd : m_innerClasses)
2363 {
2364 if (innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
2365 protectionLevelVisible(innerCd->protection()) &&
2366 !innerCd->isEmbeddedInOuterScope()
2367 )
2368 {
2369 tagFile << " <class kind=\"" << innerCd->compoundTypeString() <<
2370 "\">" << convertToXML(innerCd->name()) << "</class>\n";
2371 }
2372 }
2373 }
2374 break;
2375 case LayoutDocEntry::MemberDecl:
2376 {
2377 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2378 if (lmd)
2379 {
2380 MemberList * ml = getMemberList(lmd->type);
2381 if (ml)
2382 {
2383 ml->writeTagFile(tagFile);
2384 }
2385 }
2386 }
2387 break;
2388 case LayoutDocEntry::MemberGroups:
2389 {
2390 for (const auto &mg : m_memberGroups)
2391 {
2392 mg->writeTagFile(tagFile);
2393 }
2394 }
2395 break;
2396 default:
2397 break;
2398 }
2399 }
2400 writeDocAnchorsToTagFile(tagFile);
2401 tagFile << " </compound>\n";
2402}
2403
2404/** Write class documentation inside another container (i.e. a group) */
2406{
2407 bool isSimple = m_isSimple;
2408
2409 ol.addIndexItem(name(),QCString());
2410 //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",qPrint(name()));
2411
2412 // part 1: anchor and title
2413 QCString s = compoundTypeString()+" "+name();
2414
2415 // part 1a
2416 ol.pushGeneratorState();
2418 { // only HTML only
2419 ol.writeAnchor(QCString(),anchor());
2422 ol.parseText(s);
2423 ol.endMemberDocName();
2424 ol.endMemberDoc(FALSE);
2425 ol.writeString("</div>");
2426 ol.startIndent();
2427 }
2428 ol.popGeneratorState();
2429
2430 // part 1b
2431 ol.pushGeneratorState();
2434 { // for LaTeX/RTF only
2436 }
2437 ol.popGeneratorState();
2438
2439 // part 1c
2440 ol.pushGeneratorState();
2442 {
2443 // for LaTeX/RTF/Man
2444 ol.startGroupHeader(1);
2445 ol.parseText(s);
2446 ol.endGroupHeader(1);
2447 }
2448 ol.popGeneratorState();
2449
2450 SrcLangExt lang=getLanguage();
2451
2452 // part 2: the header and detailed description
2453 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2454 {
2455 switch (lde->kind())
2456 {
2457 case LayoutDocEntry::BriefDesc:
2458 {
2459 // since we already shown the brief description in the
2460 // declaration part of the container, so we use this to
2461 // show the details on top.
2463 }
2464 break;
2465 case LayoutDocEntry::ClassInheritanceGraph:
2467 break;
2468 case LayoutDocEntry::ClassCollaborationGraph:
2470 break;
2471 case LayoutDocEntry::MemberDeclStart:
2473 break;
2474 case LayoutDocEntry::MemberDecl:
2475 {
2476 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2477 if (lmd)
2478 {
2479 ClassDefSet visitedClasses;
2480 if (!isSimple) writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang),TRUE);
2481 }
2482 }
2483 break;
2484 case LayoutDocEntry::MemberGroups:
2486 break;
2487 case LayoutDocEntry::MemberDeclEnd:
2489 break;
2490 case LayoutDocEntry::MemberDefStart:
2492 break;
2493 case LayoutDocEntry::MemberDef:
2494 {
2495 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2496 if (lmd)
2497 {
2498 if (isSimple)
2499 {
2501 }
2502 else
2503 {
2504 writeMemberDocumentation(ol,lmd->type,lmd->title(lang),TRUE);
2505 }
2506 }
2507 }
2508 break;
2509 case LayoutDocEntry::MemberDefEnd:
2511 break;
2512 default:
2513 break;
2514 }
2515 }
2516
2517 // part 3: close the block
2518 ol.pushGeneratorState();
2520 { // HTML only
2521 ol.endIndent();
2522 }
2523 ol.popGeneratorState();
2524}
2525
2527{
2528 // TODO: clean up this mess by moving it to
2529 // the output generators...
2530 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
2531 bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
2532 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
2533
2534 // HTML only
2535 ol.pushGeneratorState();
2537 ol.docify(" ");
2539 anchor.isEmpty() ? QCString("details") : anchor);
2540 ol.parseText(theTranslator->trMore());
2541 ol.endTextLink();
2542 ol.popGeneratorState();
2543
2544 if (!anchor.isEmpty())
2545 {
2546 ol.pushGeneratorState();
2547 // LaTeX + RTF
2551 if (!(usePDFLatex && pdfHyperlinks))
2552 {
2554 }
2555 if (!rtfHyperlinks)
2556 {
2558 }
2559 ol.docify(" ");
2561 ol.parseText(theTranslator->trMore());
2562 ol.endTextLink();
2563 // RTF only
2565 ol.writeString("\\par");
2566 ol.popGeneratorState();
2567 }
2568}
2569
2571{
2572 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2573 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
2574 bool extractLocalClasses = Config_getBool(EXTRACT_LOCAL_CLASSES);
2575 bool linkable = isLinkable();
2576 return (!isAnonymous() && !isExtension() &&
2577 (protection()!=Protection::Private || extractPrivate) &&
2578 (linkable || (!hideUndocClasses && (!isLocal() || extractLocalClasses)))
2579 );
2580}
2581
2582void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const
2583{
2584 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2585 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2586 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2587 SrcLangExt lang = getLanguage();
2589 {
2590 if (!found) // first class
2591 {
2592 if (sliceOpt)
2593 {
2594 if (compoundType()==Interface)
2595 {
2596 ol.startMemberHeader("interfaces");
2597 }
2598 else if (compoundType()==Struct)
2599 {
2600 ol.startMemberHeader("structs");
2601 }
2602 else if (compoundType()==Exception)
2603 {
2604 ol.startMemberHeader("exceptions");
2605 }
2606 else // compoundType==Class
2607 {
2608 ol.startMemberHeader("nested-classes");
2609 }
2610 }
2611 else // non-Slice optimization: single header for class/struct/..
2612 {
2613 ol.startMemberHeader("nested-classes");
2614 }
2615 if (!header.isEmpty())
2616 {
2617 ol.parseText(header);
2618 }
2619 else if (lang==SrcLangExt::VHDL)
2620 {
2622 }
2623 else
2624 {
2626 theTranslator->trDataTypes() :
2627 theTranslator->trCompounds());
2628 }
2629 ol.endMemberHeader();
2630 ol.startMemberList();
2631 found=TRUE;
2632 }
2635 QCString ctype = compoundTypeString();
2636 QCString cname = displayName(!localNames);
2637
2638 if (lang!=SrcLangExt::VHDL) // for VHDL we swap the name and the type
2639 {
2640 if (isSliceLocal())
2641 {
2642 ol.writeString("local ");
2643 }
2644 ol.writeString(ctype);
2645 ol.writeString(" ");
2646 ol.insertMemberAlign();
2647 }
2648 if (isLinkable())
2649 {
2652 anchor(),
2653 cname
2654 );
2655 }
2656 else
2657 {
2658 ol.startBold();
2659 ol.docify(cname);
2660 ol.endBold();
2661 }
2662 if (lang==SrcLangExt::VHDL) // now write the type
2663 {
2664 ol.writeString(" ");
2665 ol.insertMemberAlign();
2667 }
2669
2670 // add the brief description if available
2671 if (!briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
2672 {
2673 auto parser { createDocParser() };
2674 auto ast { validatingParseDoc(*parser.get(),
2675 briefFile(),briefLine(),this,nullptr,
2677 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
2678 if (!ast->isEmpty())
2679 {
2681 ol.writeDoc(ast.get(),this,nullptr);
2682 if (isLinkableInProject())
2683 {
2684 writeMoreLink(ol,anchor());
2685 }
2687 }
2688 }
2690 }
2691}
2692
2694{
2695 StringVector sl;
2696 if (isFinal()) sl.emplace_back("final");
2697 if (isSealed()) sl.emplace_back("sealed");
2698 if (isAbstract()) sl.emplace_back("abstract");
2699 if (isExported()) sl.emplace_back("export");
2700 if (getLanguage()==SrcLangExt::IDL && isPublished()) sl.emplace_back("published");
2701
2702 for (const auto &sx : m_qualifiers)
2703 {
2704 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2705 if (!alreadyAdded)
2706 {
2707 sl.push_back(sx);
2708 }
2709 }
2710
2711 ol.pushGeneratorState();
2713 if (!sl.empty())
2714 {
2715 ol.startLabels();
2716 size_t i=0;
2717 for (const auto &s : sl)
2718 {
2719 i++;
2720 ol.writeLabel(s.c_str(),i==sl.size());
2721 }
2722 ol.endLabels();
2723 }
2724 ol.popGeneratorState();
2725}
2726
2728{
2729 ol.startContents();
2730
2731 QCString pageType = " ";
2732 pageType += compoundTypeString();
2733
2734 bool exampleFlag=hasExamples();
2735
2736 //---------------------------------------- start flexible part -------------------------------
2737
2738 SrcLangExt lang = getLanguage();
2739
2740 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2741 {
2742 switch (lde->kind())
2743 {
2744 case LayoutDocEntry::BriefDesc:
2745 writeBriefDescription(ol,exampleFlag);
2746 break;
2747 case LayoutDocEntry::ClassIncludes:
2748 if (lang==SrcLangExt::Slice)
2749 {
2751 }
2752 else
2753 {
2755 }
2756 break;
2757 case LayoutDocEntry::ClassInheritanceGraph:
2759 break;
2760 case LayoutDocEntry::ClassCollaborationGraph:
2762 break;
2763 case LayoutDocEntry::ClassAllMembersLink:
2764 //writeAllMembersLink(ol); // this is now part of the summary links
2765 break;
2766 case LayoutDocEntry::MemberDeclStart:
2768 break;
2769 case LayoutDocEntry::MemberGroups:
2771 break;
2772 case LayoutDocEntry::MemberDecl:
2773 {
2774 ClassDefSet visitedClasses;
2775 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2776 if (lmd)
2777 {
2778 writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang));
2779 }
2780 }
2781 break;
2782 case LayoutDocEntry::ClassNestedClasses:
2783 {
2784 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2785 if (ls)
2786 {
2787 writeNestedClasses(ol,ls->title(lang));
2788 }
2789 }
2790 break;
2791 case LayoutDocEntry::MemberDeclEnd:
2793 break;
2794 case LayoutDocEntry::DetailedDesc:
2795 {
2796 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2797 if (ls)
2798 {
2799 writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang));
2800 }
2801 }
2802 break;
2803 case LayoutDocEntry::MemberDefStart:
2805 break;
2806 case LayoutDocEntry::ClassInlineClasses:
2808 break;
2809 case LayoutDocEntry::MemberDef:
2810 {
2811 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2812 if (lmd)
2813 {
2814 writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
2815 }
2816 }
2817 break;
2818 case LayoutDocEntry::MemberDefEnd:
2820 break;
2821 case LayoutDocEntry::ClassUsedFiles:
2822 showUsedFiles(ol);
2823 break;
2824 case LayoutDocEntry::AuthorSection:
2826 break;
2827 case LayoutDocEntry::NamespaceNestedNamespaces:
2828 case LayoutDocEntry::NamespaceNestedConstantGroups:
2829 case LayoutDocEntry::NamespaceClasses:
2830 case LayoutDocEntry::NamespaceConcepts:
2831 case LayoutDocEntry::NamespaceInterfaces:
2832 case LayoutDocEntry::NamespaceStructs:
2833 case LayoutDocEntry::NamespaceExceptions:
2834 case LayoutDocEntry::NamespaceInlineClasses:
2835 case LayoutDocEntry::ConceptDefinition:
2836 case LayoutDocEntry::FileClasses:
2837 case LayoutDocEntry::FileConcepts:
2838 case LayoutDocEntry::FileInterfaces:
2839 case LayoutDocEntry::FileStructs:
2840 case LayoutDocEntry::FileExceptions:
2841 case LayoutDocEntry::FileNamespaces:
2842 case LayoutDocEntry::FileConstantGroups:
2843 case LayoutDocEntry::FileIncludes:
2844 case LayoutDocEntry::FileIncludeGraph:
2845 case LayoutDocEntry::FileIncludedByGraph:
2846 case LayoutDocEntry::FileSourceLink:
2847 case LayoutDocEntry::FileInlineClasses:
2848 case LayoutDocEntry::GroupClasses:
2849 case LayoutDocEntry::GroupConcepts:
2850 case LayoutDocEntry::GroupModules:
2851 case LayoutDocEntry::GroupInlineClasses:
2852 case LayoutDocEntry::GroupNamespaces:
2853 case LayoutDocEntry::GroupDirs:
2854 case LayoutDocEntry::GroupNestedGroups:
2855 case LayoutDocEntry::GroupFiles:
2856 case LayoutDocEntry::GroupGraph:
2857 case LayoutDocEntry::GroupPageDocs:
2858 case LayoutDocEntry::ModuleExports:
2859 case LayoutDocEntry::ModuleClasses:
2860 case LayoutDocEntry::ModuleConcepts:
2861 case LayoutDocEntry::ModuleUsedFiles:
2862 case LayoutDocEntry::DirSubDirs:
2863 case LayoutDocEntry::DirFiles:
2864 case LayoutDocEntry::DirGraph:
2865 err("Internal inconsistency: member '{}' should not be part of LayoutDocManager::Class entry list\n",lde->entryToString());
2866 break;
2867 }
2868 }
2869
2870 ol.endContents();
2871}
2872
2874{
2875 QCString pageTitle;
2876 SrcLangExt lang = getLanguage();
2877
2878 if (lang==SrcLangExt::Fortran)
2879 {
2880 pageTitle = theTranslator->trCompoundReferenceFortran(displayName(),
2881 m_compType,
2882 !m_tempArgs.empty());
2883 }
2884 else if (lang==SrcLangExt::Slice)
2885 {
2886 pageTitle = theTranslator->trCompoundReferenceSlice(displayName(),
2887 m_compType,
2888 isSliceLocal());
2889 }
2890 else if (lang==SrcLangExt::VHDL)
2891 {
2892 pageTitle = theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this));
2893 }
2894 else if (isJavaEnum())
2895 {
2896 pageTitle = theTranslator->trEnumReference(displayName());
2897 }
2898 else if (m_compType==Service)
2899 {
2900 pageTitle = theTranslator->trServiceReference(displayName());
2901 }
2902 else if (m_compType==Singleton)
2903 {
2904 pageTitle = theTranslator->trSingletonReference(displayName());
2905 }
2906 else
2907 {
2908 if (Config_getBool(HIDE_COMPOUND_REFERENCE))
2909 {
2910 pageTitle = displayName();
2911 }
2912 else
2913 {
2914 pageTitle = theTranslator->trCompoundReference(displayName(),
2916 !m_tempArgs.empty());
2917 }
2918 }
2919 return pageTitle;
2920}
2921
2922// write all documentation for this class
2924{
2925 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
2926 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2927 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2928 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2929 QCString pageTitle = title();
2930
2932 if (sliceOpt)
2933 {
2934 if (compoundType()==Interface)
2935 {
2937 }
2938 else if (compoundType()==Struct)
2939 {
2941 }
2942 else if (compoundType()==Exception)
2943 {
2945 }
2946 else
2947 {
2949 }
2950 }
2951 else
2952 {
2954 }
2955
2956 AUTO_TRACE("name='{}' getOutputFileBase='{}'",name(),getOutputFileBase());
2957 startFile(ol,getOutputFileBase(),name(),pageTitle,hli,!generateTreeView);
2958 if (!generateTreeView)
2959 {
2961 {
2963 }
2964 ol.endQuickIndices();
2965 }
2966
2967 startTitle(ol,getOutputFileBase(),this);
2968 ol.parseText(pageTitle);
2970 addGroupListToTitle(ol,this);
2972 writeDocumentationContents(ol,pageTitle);
2973
2974 endFileWithNavPath(ol,this);
2975
2976 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2977 {
2978 writeMemberPages(ol);
2979 }
2980}
2981
2983{
2984 ///////////////////////////////////////////////////////////////////////////
2985 //// Member definitions on separate pages
2986 ///////////////////////////////////////////////////////////////////////////
2987
2988 ol.pushGeneratorState();
2990
2991 for (const auto &ml : m_memberLists)
2992 {
2993 if (ml->numDocMembers()>ml->numDocEnumValues() && ml->listType().isDetailed())
2994 {
2995 ml->writeDocumentationPage(ol,displayName(),this);
2996 }
2997 }
2998
2999 ol.popGeneratorState();
3000}
3001
3003{
3004 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
3005
3006 ol.writeString(" <div class=\"navtab\">\n");
3007 ol.writeString(" <table>\n");
3008
3009 for (auto &mni : m_allMemberNameInfoLinkedMap)
3010 {
3011 for (auto &mi : *mni)
3012 {
3013 const MemberDef *md=mi->memberDef();
3014 if (md->getClassDef()==this && md->isLinkable() && !md->isEnumValue())
3015 {
3016 if (md->isLinkableInProject())
3017 {
3018 if (md==currentMd) // selected item => highlight
3019 {
3020 ol.writeString(" <tr><td class=\"navtabHL\">");
3021 }
3022 else
3023 {
3024 ol.writeString(" <tr><td class=\"navtab\">");
3025 }
3026 ol.writeString("<a class=\"navtab\" ");
3027 ol.writeString("href=\"");
3028 if (createSubDirs) ol.writeString("../../");
3029 QCString url = md->getOutputFileBase();
3031 ol.writeString(url+"#"+md->anchor());
3032 ol.writeString("\">");
3033 ol.writeString(convertToHtml(md->name()));
3034 ol.writeString("</a>");
3035 ol.writeString("</td></tr>\n");
3036 }
3037 }
3038 }
3039 }
3040
3041 ol.writeString(" </table>\n");
3042 ol.writeString(" </div>\n");
3043}
3044
3045
3046
3048{
3049 // write inner classes after the parent, so the tag files contain
3050 // the definition in proper order!
3051 for (const auto &innerCd : m_innerClasses)
3052 {
3053 if (
3054 innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
3055 protectionLevelVisible(innerCd->protection()) &&
3056 !innerCd->isEmbeddedInOuterScope()
3057 )
3058 {
3059 msg("Generating docs for nested compound {}...\n",innerCd->displayName());
3060 innerCd->writeDocumentation(ol);
3061 innerCd->writeMemberList(ol);
3062 }
3063 innerCd->writeDocumentationForInnerClasses(ol);
3064 }
3065}
3066
3067// write the list of all (inherited) members for this class
3069{
3070 bool cOpt = Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
3071 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3072 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3073 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3074 if (m_allMemberNameInfoLinkedMap.empty() || cOpt) return;
3075 // only for HTML
3076 ol.pushGeneratorState();
3078
3080 if (sliceOpt)
3081 {
3082 if (compoundType()==Interface)
3083 {
3085 }
3086 else if (compoundType()==Struct)
3087 {
3089 }
3090 else if (compoundType()==Exception)
3091 {
3093 }
3094 else
3095 {
3097 }
3098 }
3099 else
3100 {
3102 }
3103
3104 QCString memListFile = getMemberListFileName();
3105 startFile(ol,memListFile,memListFile,theTranslator->trMemberList(),hli,!generateTreeView,getOutputFileBase());
3106 if (!generateTreeView)
3107 {
3109 {
3111 }
3112 ol.endQuickIndices();
3113 }
3114 startTitle(ol,QCString());
3115 ol.parseText(displayName()+" "+theTranslator->trMemberList());
3116 endTitle(ol,QCString(),QCString());
3117 ol.startContents();
3118 ol.startParagraph();
3119 ol.parseText(theTranslator->trThisIsTheListOfAllMembers());
3120 ol.docify(" ");
3122 ol.parseText(theTranslator->trIncludingInheritedMembers());
3123 ol.endParagraph();
3124
3125 //ol.startItemList();
3126
3127 bool first = true; // to prevent empty table
3128 int idx=0;
3129 for (auto &mni : m_allMemberNameInfoLinkedMap)
3130 {
3131 for (auto &mi : *mni)
3132 {
3133 const MemberDef *md=mi->memberDef();
3134 const ClassDef *cd=md->getClassDef();
3135 Protection prot = mi->prot();
3136 Specifier virt=md->virtualness();
3137
3138 //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n",
3139 // qPrint(name()),qPrint(md->name()),qPrint(cd->name()),md->protection(),mi->prot,prot,mi->inherited);
3140
3141 if (cd && !md->name().isEmpty() && !md->isAnonymous())
3142 {
3143 bool memberWritten=FALSE;
3144 if (cd->isLinkable() && md->isLinkable())
3145 // create a link to the documentation
3146 {
3147 QCString name=mi->ambiguityResolutionScope()+md->name();
3148 //ol.writeListItem();
3149 if (first)
3150 {
3151 ol.writeString("<table class=\"directory\">\n");
3152 first = false;
3153 }
3154 ol.writeString(" <tr");
3155 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3156 idx++;
3157 ol.writeString("><td class=\"entry\">");
3158 if (cd->isObjectiveC())
3159 {
3160 if (md->isObjCMethod())
3161 {
3162 if (md->isStatic())
3163 ol.writeString("+&#160;</td><td>");
3164 else
3165 ol.writeString("-&#160;</td><td>");
3166 }
3167 else
3168 ol.writeString("</td><td class=\"entry\">");
3169 }
3170 if (md->isObjCMethod())
3171 {
3173 md->getOutputFileBase(),
3174 md->anchor(),md->name());
3175 }
3176 else
3177 {
3178 //Definition *bd = md->getGroupDef();
3179 //if (bd==nullptr) bd=cd;
3181 md->getOutputFileBase(),
3182 md->anchor(),name);
3183
3184 if ( md->isFunction() || md->isSignal() || md->isSlot() ||
3185 (md->isFriend() && !md->argsString().isEmpty()))
3186 ol.docify(md->argsString());
3187 else if (md->isEnumerate())
3188 ol.parseText(" "+theTranslator->trEnumName());
3189 else if (md->isEnumValue())
3190 ol.parseText(" "+theTranslator->trEnumValue());
3191 else if (md->isTypedef())
3192 ol.docify(" typedef");
3193 else if (md->isFriend() && md->typeString()=="friend class")
3194 ol.docify(" class");
3195 //ol.writeString("\n");
3196 }
3197 ol.writeString("</td>");
3198 memberWritten=TRUE;
3199 }
3200 else if (!cd->isArtificial() &&
3201 !Config_getBool(HIDE_UNDOC_MEMBERS) &&
3203 ) // no documentation,
3204 // generate link to the class instead.
3205 {
3206 //ol.writeListItem();
3207 if (first)
3208 {
3209 ol.writeString("<table class=\"directory\">\n");
3210 first = false;
3211 }
3212 ol.writeString(" <tr bgcolor=\"#f0f0f0\"");
3213 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3214 idx++;
3215 ol.writeString("><td class=\"entry\">");
3216 if (cd->isObjectiveC())
3217 {
3218 if (md->isObjCMethod())
3219 {
3220 if (md->isStatic())
3221 ol.writeString("+&#160;</td><td class=\"entry\">");
3222 else
3223 ol.writeString("-&#160;</td><td class=\"entry\">");
3224 }
3225 else
3226 ol.writeString("</td><td class=\"entry\">");
3227 }
3228 ol.startBold();
3229 ol.docify(md->name());
3230 ol.endBold();
3231 if (!md->isObjCMethod())
3232 {
3233 if ( md->isFunction() || md->isSignal() || md->isSlot() )
3234 ol.docify(md->argsString());
3235 else if (md->isEnumerate())
3236 ol.parseText(" "+theTranslator->trEnumName());
3237 else if (md->isEnumValue())
3238 ol.parseText(" "+theTranslator->trEnumValue());
3239 else if (md->isTypedef())
3240 ol.docify(" typedef");
3241 }
3242 ol.writeString(" (");
3243 ol.parseText(theTranslator->trDefinedIn()+" ");
3244 if (cd->isLinkable())
3245 {
3246 ol.writeObjectLink(
3247 cd->getReference(),
3248 cd->getOutputFileBase(),
3249 cd->anchor(),
3250 cd->displayName());
3251 }
3252 else
3253 {
3254 ol.startBold();
3255 ol.docify(cd->displayName());
3256 ol.endBold();
3257 }
3258 ol.writeString(")");
3259 ol.writeString("</td>");
3260 memberWritten=TRUE;
3261 }
3262 if (memberWritten)
3263 {
3264 ol.writeString("<td class=\"entry\">");
3266 cd->getOutputFileBase(),
3267 cd->anchor(),
3268 md->category() ?
3269 md->category()->displayName() :
3270 cd->displayName());
3271 ol.writeString("</td>");
3272 ol.writeString("<td class=\"entry\">");
3273 }
3274 SrcLangExt lang = md->getLanguage();
3275 if (
3277 md->isFriend() || md->isRelated() || md->isExplicit() ||
3278 md->isMutable() || (md->isInline() && Config_getBool(INLINE_INFO)) ||
3279 md->isSignal() || md->isSlot() ||
3281 (md->isOptional() || md->isAttribute() || md->isUNOProperty())) ||
3282 md->isStatic() || lang==SrcLangExt::VHDL
3283 )
3284 && memberWritten)
3285 {
3286 StringVector sl;
3287 if (lang==SrcLangExt::VHDL)
3288 {
3289 sl.push_back(theTranslator->trVhdlType(md->getVhdlSpecifiers(),TRUE).str()); //append vhdl type
3290 }
3291 else if (md->isFriend()) sl.emplace_back("friend");
3292 else if (md->isRelated()) sl.emplace_back("related");
3293 else
3294 {
3295 if (Config_getBool(INLINE_INFO) && md->isInline())
3296 sl.emplace_back("inline");
3297 if (md->isExplicit()) sl.emplace_back("explicit");
3298 if (md->isMutable()) sl.emplace_back("mutable");
3299 if (prot==Protection::Protected) sl.emplace_back("protected");
3300 else if (prot==Protection::Private) sl.emplace_back("private");
3301 else if (prot==Protection::Package) sl.emplace_back("package");
3303 sl.emplace_back("virtual");
3304 else if (virt==Specifier::Pure) sl.emplace_back("pure virtual");
3305 if (md->isStatic()) sl.emplace_back("static");
3306 if (md->isSignal()) sl.emplace_back("signal");
3307 if (md->isSlot()) sl.emplace_back("slot");
3308// this is the extra member page
3309 if (md->isOptional()) sl.emplace_back("optional");
3310 if (md->isAttribute()) sl.emplace_back("attribute");
3311 if (md->isUNOProperty()) sl.emplace_back("property");
3312 if (md->isReadonly()) sl.emplace_back("readonly");
3313 if (md->isBound()) sl.emplace_back("bound");
3314 if (md->isRemovable()) sl.emplace_back("removable");
3315 if (md->isConstrained()) sl.emplace_back("constrained");
3316 if (md->isTransient()) sl.emplace_back("transient");
3317 if (md->isMaybeVoid()) sl.emplace_back("maybevoid");
3318 if (md->isMaybeDefault()) sl.emplace_back("maybedefault");
3319 if (md->isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
3320 }
3321 bool firstSpan=true;
3322 for (const auto &s : sl)
3323 {
3324 if (!firstSpan)
3325 {
3326 ol.writeString("</span><span class=\"mlabel\">");
3327 }
3328 else
3329 {
3330 ol.writeString("<span class=\"mlabel\">");
3331 firstSpan=false;
3332 }
3333 ol.docify(s.c_str());
3334 }
3335 if (!firstSpan) ol.writeString("</span>");
3336 }
3337 if (memberWritten)
3338 {
3339 ol.writeString("</td>");
3340 ol.writeString("</tr>\n");
3341 }
3342 }
3343 }
3344 }
3345 //ol.endItemList();
3346
3347 if (!first) ol.writeString("</table>");
3348
3349 endFile(ol);
3350 ol.popGeneratorState();
3351}
3352
3353// add a reference to an example
3354bool ClassDefImpl::addExample(const QCString &anchor,const QCString &nameStr, const QCString &file)
3355{
3356 return m_examples.inSort(Example(anchor,nameStr,file));
3357}
3358
3359// returns TRUE if this class is used in an example
3361{
3362 return !m_examples.empty();
3363}
3364
3365void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCString &type)
3366{
3367 //printf("addTypeConstraint(%s,%s)\n",qPrint(type),qPrint(typeConstraint));
3368 bool hideUndocRelation = Config_getBool(HIDE_UNDOC_RELATIONS);
3369 if (typeConstraint.isEmpty() || type.isEmpty()) return;
3370 SymbolResolver resolver(getFileDef());
3371 ClassDefMutable *cd = resolver.resolveClassMutable(this,typeConstraint);
3372 if (cd==nullptr && !hideUndocRelation)
3373 {
3374 cd = toClassDefMutable(
3375 Doxygen::hiddenClassLinkedMap->add(typeConstraint,
3376 std::unique_ptr<ClassDef>(
3377 new ClassDefImpl(
3379 getDefColumn(),
3380 typeConstraint,
3381 ClassDef::Class))));
3382 if (cd)
3383 {
3384 cd->setUsedOnly(TRUE);
3385 cd->setLanguage(getLanguage());
3386 //printf("Adding undocumented constraint '%s' to class %s on type %s\n",
3387 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3388 }
3389 }
3390 if (cd)
3391 {
3392 auto it = std::find_if(m_constraintClassList.begin(),
3394 [&cd](const auto &ccd) { return ccd.classDef==cd; });
3395
3396 if (it==m_constraintClassList.end())
3397 {
3398 m_constraintClassList.emplace_back(cd);
3399 it = m_constraintClassList.end()-1;
3400 }
3401 (*it).addAccessor(type);
3402 //printf("Adding constraint '%s' to class %s on type %s\n",
3403 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3404 }
3405}
3406
3407// Java Type Constrains: A<T extends C & I>
3409{
3410 for (const Argument &a : m_tempArgs)
3411 {
3412 if (!a.typeConstraint.isEmpty())
3413 {
3414 QCString typeConstraint;
3415 int i=0,p=0;
3416 while ((i=a.typeConstraint.find('&',p))!=-1) // typeConstraint="A &I" for C<T extends A & I>
3417 {
3418 typeConstraint = a.typeConstraint.mid(p,i-p).stripWhiteSpace();
3419 addTypeConstraint(typeConstraint,a.type);
3420 p=i+1;
3421 }
3422 typeConstraint = a.typeConstraint.right(a.typeConstraint.length()-p).stripWhiteSpace();
3423 addTypeConstraint(typeConstraint,a.type);
3424 }
3425 }
3426}
3427
3428// C# Type Constraints: D<T> where T : C, I
3433
3435{
3436 m_tempArgs = al;
3437}
3438
3439static bool hasNonReferenceSuperClassRec(const ClassDef *cd,int level)
3440{
3441 bool found=!cd->isReference() && cd->isLinkableInProject() && !cd->isHidden();
3442 if (found)
3443 {
3444 return TRUE; // we're done if this class is not a reference
3445 }
3446 for (const auto &ibcd : cd->subClasses())
3447 {
3448 const ClassDef *bcd=ibcd.classDef;
3449 if (level>256)
3450 {
3451 err("Possible recursive class relation while inside {} and looking for base class {}\n",cd->name(),bcd->name());
3452 return FALSE;
3453 }
3454 // recurse into the super class branch
3455 found = found || hasNonReferenceSuperClassRec(bcd,level+1);
3456 if (!found)
3457 {
3458 // look for template instances that might have non-reference super classes
3459 for (const auto &cil : bcd->getTemplateInstances())
3460 {
3461 // recurse into the template instance branch
3462 found = hasNonReferenceSuperClassRec(cil.classDef,level+1);
3463 if (found) break;
3464 }
3465 }
3466 else
3467 {
3468 break;
3469 }
3470 }
3471 return found;
3472}
3473
3474/*! Returns \c TRUE iff this class or a class inheriting from this class
3475 * is \e not defined in an external tag file.
3476 */
3478{
3479 return hasNonReferenceSuperClassRec(this,0);
3480}
3481
3486
3488{
3489 m_requiresClause = req;
3490}
3491
3492/*! called from MemberDef::writeDeclaration() to (recursively) write the
3493 * definition of an anonymous struct, union or class.
3494 */
3495void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,int indentLevel,
3496 const ClassDef *inheritedFrom,const QCString &inheritId) const
3497{
3498 //printf("ClassName='%s' inGroup=%d\n",qPrint(name()),inGroup);
3499
3502 if (!cn.isEmpty())
3503 {
3504 ol.docify(" ");
3505 if (md && isLinkable())
3506 {
3507 ol.writeObjectLink(QCString(),QCString(),md->anchor(),cn);
3508 }
3509 else
3510 {
3511 ol.startBold();
3512 ol.docify(cn);
3513 ol.endBold();
3514 }
3515 }
3516 ol.docify(" {");
3518 ol.endMemberDeclaration(md ? md->anchor() : QCString(),inheritId);
3519
3520 // write user defined member groups
3521 for (const auto &mg : m_memberGroups)
3522 {
3523 mg->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
3524 }
3525
3526 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3527 {
3528 if (lde->kind()==LayoutDocEntry::MemberDecl)
3529 {
3530 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
3531 if (lmd)
3532 {
3533 writePlainMemberDeclaration(ol,lmd->type,inGroup,indentLevel,inheritedFrom,inheritId);
3534 }
3535 }
3536 }
3537}
3538
3539/*! a link to this class is possible within this project */
3541{
3542 bool extractLocal = Config_getBool(EXTRACT_LOCAL_CLASSES);
3543 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3544 bool hideUndoc = Config_getBool(HIDE_UNDOC_CLASSES);
3546 {
3547 return m_templateMaster->isLinkableInProject();
3548 }
3549 else
3550 {
3551 //printf("%s::isLinkableInProject() conditions: artificial=%d hidden=%d anonymous=%d protection=%d local=%d docs=%d static=%d ref=%d\n",
3552 // qPrint(name()),
3553 // !isArtificial(),
3554 // !isHidden(),
3555 // !isAnonymous(),
3556 // m_prot,
3557 // !m_isLocal || extractLocal,
3558 // hasDocumentation() || !hideUndoc,
3559 // !m_isStatic || extractStatic,
3560 // !isReference());
3561 return
3562 !isArtificial() && !isHidden() && /* not hidden */
3563 !isAnonymous() && /* not anonymous */
3564 protectionLevelVisible(m_prot) && /* private/internal */
3565 (!m_isLocal || extractLocal) && /* local */
3566 (hasDocumentation() || !hideUndoc) && /* documented */
3567 (!m_isStatic || extractStatic) && /* static */
3568 !isReference(); /* not an external reference */
3569 }
3570}
3571
3573{
3575 {
3576 return m_templateMaster->isLinkable();
3577 }
3578 else
3579 {
3580 return isReference() || isLinkableInProject();
3581 }
3582}
3583
3584
3585/*! the class is visible in a class diagram, or class hierarchy */
3587{
3588 bool allExternals = Config_getBool(ALLEXTERNALS);
3589 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
3590 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3591
3592 return // show all classes or a subclass is visible
3593 ((allExternals && !isArtificial()) || hasNonReferenceSuperClass()) &&
3594 // and not an anonymous compound
3595 !isAnonymous() &&
3596 // and not privately inherited
3598 // documented or shown anyway or documentation is external
3599 (hasDocumentation() ||
3600 !hideUndocClasses ||
3601 (m_templateMaster && m_templateMaster->hasDocumentation()) ||
3602 isReference()
3603 ) &&
3604 // if this is an implicit template instance then it most be part of the inheritance hierarchy
3605 (!m_implicitTemplateInstance || !m_inherits.empty() || !m_inheritedBy.empty()) &&
3606 // is not part of an unnamed namespace or shown anyway
3607 (!m_isStatic || extractStatic);
3608}
3609
3614
3615//----------------------------------------------------------------------
3616// recursive function:
3617// returns the distance to the base class definition 'bcd' represents an (in)direct base
3618// class of class definition 'cd' or nullptr if it does not.
3619
3620int ClassDefImpl::isBaseClass(const ClassDef *bcd, bool followInstances,const QCString &templSpec) const
3621{
3622 int distance=0;
3623 //printf("isBaseClass(cd=%s) looking for %s templSpec=%s\n",qPrint(name()),qPrint(bcd->name()),qPrint(templSpec));
3624 for (const auto &bclass : baseClasses())
3625 {
3626 const ClassDef *ccd = bclass.classDef;
3627 if (!followInstances && ccd->templateMaster())
3628 {
3629 ccd=ccd->templateMaster();
3630 }
3631 if (ccd==bcd && (templSpec.isEmpty() || templSpec==bclass.templSpecifiers))
3632 {
3633 distance=1;
3634 break; // no shorter path possible
3635 }
3636 else
3637 {
3638 int d = ccd->isBaseClass(bcd,followInstances,templSpec);
3639 if (d>256)
3640 {
3641 err("Possible recursive class relation while inside {} and looking for base class {}\n",name(),bcd->name());
3642 return 0;
3643 }
3644 else if (d>0) // path found
3645 {
3646 if (distance==0 || d+1<distance) // update if no path found yet or shorter path found
3647 {
3648 distance=d+1;
3649 }
3650 }
3651 }
3652 }
3653 return distance;
3654}
3655
3656//----------------------------------------------------------------------
3657
3658bool ClassDefImpl::isSubClass(ClassDef *cd,int level) const
3659{
3660 bool found=FALSE;
3661 if (level>256)
3662 {
3663 err("Possible recursive class relation while inside {} and looking for derived class {}\n",name(),cd->name());
3664 return FALSE;
3665 }
3666 for (const auto &iscd : subClasses())
3667 {
3668 ClassDef *ccd=iscd.classDef;
3669 found = (ccd==cd) || ccd->isSubClass(cd,level+1);
3670 if (found) break;
3671 }
3672 return found;
3673}
3674
3675//----------------------------------------------------------------------------
3676
3677static bool isStandardFunc(const MemberDef *md)
3678{
3679 return md->name()=="operator=" || // assignment operator
3680 md->isConstructor() || // constructor
3681 md->isDestructor(); // destructor
3682}
3683
3684void ClassDefImpl::mergeMembersFromBaseClasses(bool mergeVirtualBaseClass)
3685{
3686 SrcLangExt lang = getLanguage();
3688 size_t sepLen = sep.length();
3689 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
3690 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
3691
3692 //printf(" mergeMembers for %s mergeVirtualBaseClass=%d\n",qPrint(name()),mergeVirtualBaseClass);
3693 // the merge the base members with this class' members
3694 for (const auto &bcd : baseClasses())
3695 {
3696 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
3697 if (bClass)
3698 {
3699 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
3701
3702 for (auto &srcMni : srcMnd)
3703 {
3704 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
3705 if (dstMni)
3706 // a member with that name is already in the class.
3707 // the member may hide or reimplement the one in the sub class
3708 // or there may be another path to the base class that is already
3709 // visited via another branch in the class hierarchy.
3710 {
3711 //printf(" %s hides member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
3712 for (auto &srcMi : *srcMni)
3713 {
3714 MemberDef *srcMd = srcMi->memberDef();
3715 bool found=FALSE;
3716 bool ambiguous=FALSE;
3717 bool hidden=FALSE;
3718 const ClassDef *srcCd = srcMd->getClassDef();
3719 for (auto &dstMi : *dstMni)
3720 {
3721 const MemberDef *dstMd = dstMi->memberDef();
3722 if (srcMd!=dstMd) // different members
3723 {
3724 const ClassDef *dstCd = dstMd->getClassDef();
3725 //printf(" Is %s a base class of %s?\n",qPrint(srcCd->name()),qPrint(dstCd->name()));
3726 if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE))
3727 // member is in the same or a base class
3728 {
3729 const ArgumentList &srcAl = srcMd->argumentList();
3730 const ArgumentList &dstAl = dstMd->argumentList();
3732 srcMd->getOuterScope(),srcMd->getFileDef(),&srcAl,
3733 dstMd->getOuterScope(),dstMd->getFileDef(),&dstAl,
3734 TRUE,lang
3735 );
3736 //printf(" Yes, matching (%s<->%s): %d\n",
3737 // qPrint(argListToString(srcMd->argumentList())),
3738 // qPrint(argListToString(dstMd->argumentList())),
3739 // found);
3740 hidden = hidden || !found;
3741 }
3742 else // member is in a non base class => multiple inheritance
3743 // using the same base class.
3744 {
3745 //printf(" $$ Existing member %s %s add scope %s\n",
3746 // qPrint(dstMi->ambiguityResolutionScope()),
3747 // qPrint(dstMd->name()),
3748 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3749
3750 QCString scope=dstMi->scopePath().left(dstMi->scopePath().find(sep)+sepLen);
3751 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3752 {
3753 dstMi->setAmbiguityResolutionScope(scope+dstMi->ambiguityResolutionScope());
3754 }
3755 ambiguous=TRUE;
3756 }
3757 }
3758 else // same members
3759 {
3760 // do not add if base class is virtual or
3761 // if scope paths are equal or
3762 // if base class is an interface (and thus implicitly virtual).
3763 //printf(" same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt(),dstMi->virt());
3764 if ((srcMi->virt()!=Specifier::Normal && dstMi->virt()!=Specifier::Normal) ||
3765 bClass->name()+sep+srcMi->scopePath() == dstMi->scopePath() ||
3767 )
3768 {
3769 found=TRUE;
3770 }
3771 else // member can be reached via multiple paths in the
3772 // inheritance tree
3773 {
3774 //printf(" $$ Existing member %s %s add scope %s\n",
3775 // qPrint(dstMi->ambiguityResolutionScope()),
3776 // qPrint(dstMd->name()),
3777 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3778
3779 QCString scope=dstMi->scopePath().left(dstMi->scopePath().find(sep)+sepLen);
3780 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3781 {
3782 dstMi->setAmbiguityResolutionScope(dstMi->ambiguityResolutionScope()+scope);
3783 }
3784 ambiguous=TRUE;
3785 }
3786 }
3787 if (found) break;
3788 }
3789 //printf(" member %s::%s hidden %d ambiguous %d srcMi->ambigClass=%p found=%d\n",
3790 // qPrint(srcCd->name()),qPrint(srcMd->name()),hidden,ambiguous,
3791 // (void*)srcMi->ambigClass(),found);
3792
3793 // TODO: fix the case where a member is hidden by inheritance
3794 // of a member with the same name but with another prototype,
3795 // while there is more than one path to the member in the
3796 // base class due to multiple inheritance. In this case
3797 // it seems that the member is not reachable by prefixing a
3798 // scope name either (according to my compiler). Currently,
3799 // this case is shown anyway.
3800 if (!found && srcMd->protection()!=Protection::Private && !srcMd->isFriend() &&
3801 srcMi->virtualBaseClass()==mergeVirtualBaseClass && lang!=SrcLangExt::Python)
3802 {
3803 Protection prot = srcMd->protection();
3804 if (bcd.prot==Protection::Protected && prot==Protection::Public)
3805 {
3806 prot = bcd.prot;
3807 }
3808 else if (bcd.prot==Protection::Private)
3809 {
3810 prot = bcd.prot;
3811 }
3812
3813 if (inlineInheritedMembers)
3814 {
3815 if (!isStandardFunc(srcMd))
3816 {
3817 //printf(" %s::insertMember(%s)\n",qPrint(name()),qPrint(srcMd->name()));
3818 internalInsertMember(srcMd,prot,FALSE);
3819 }
3820 }
3821
3822 Specifier virt=srcMi->virt();
3823 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
3824 bool virtualBaseClass = bcd.virt!=Specifier::Normal;
3825
3826 auto newMi = std::make_unique<MemberInfo>(srcMd,prot,virt,TRUE,virtualBaseClass);
3827 newMi->setScopePath(bClass->name()+sep+srcMi->scopePath());
3828 if (ambiguous)
3829 {
3830 //printf("$$ New member %s %s add scope %s::\n",
3831 // qPrint(srcMi->ambiguityResolutionScope),
3832 // qPrint(srcMd->name()),
3833 // qPrint(bClass->name()));
3834
3835 QCString scope=bClass->name()+sep;
3836 if (scope!=srcMi->ambiguityResolutionScope().left(scope.length()))
3837 {
3838 newMi->setAmbiguityResolutionScope(scope+srcMi->ambiguityResolutionScope());
3839 }
3840 }
3841 if (hidden)
3842 {
3843 if (srcMi->ambigClass()==nullptr)
3844 {
3845 newMi->setAmbigClass(bClass);
3846 newMi->setAmbiguityResolutionScope(bClass->name()+sep);
3847 }
3848 else
3849 {
3850 newMi->setAmbigClass(srcMi->ambigClass());
3851 newMi->setAmbiguityResolutionScope(srcMi->ambigClass()->name()+sep);
3852 }
3853 }
3854 dstMni->push_back(std::move(newMi));
3855 }
3856 }
3857 }
3858 else // base class has a member that is not in the sub class => copy
3859 {
3860 //printf(" %s adds member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
3861 // create a deep copy of the list (only the MemberInfo's will be
3862 // copied, not the actual MemberDef's)
3863 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
3864
3865 // copy the member(s) from the base to the sub class
3866 for (auto &mi : *srcMni)
3867 {
3868 if (mi->virtualBaseClass()==mergeVirtualBaseClass && !mi->memberDef()->isFriend()) // don't inherit friends
3869 {
3870 Protection prot = mi->prot();
3871 if (bcd.prot==Protection::Protected)
3872 {
3874 }
3875 else if (bcd.prot==Protection::Private)
3876 {
3878 }
3879 Specifier virt=mi->virt();
3880 bool virtualBaseClass = bcd.virt!=Specifier::Normal || mi->virtualBaseClass();
3881 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
3882 //printf(" %s::%s: [mi.prot=%d, bcd.prot=%d => prot=%d], [mi.virt=%d, bcd.virt=%d => virt=%d] virtualBase=%d\n",
3883 // qPrint(name()),qPrint(mi->memberDef()->name()),
3884 // mi->prot(),bcd.prot,prot,
3885 // mi->virt(),bcd.virt,virt,
3886 // virtualBaseClass
3887 // );
3888
3889 if (prot!=Protection::Private || extractPrivate)
3890 {
3891
3892 if (inlineInheritedMembers)
3893 {
3894 if (!isStandardFunc(mi->memberDef()))
3895 {
3896 //printf(" %s::insertMember '%s'\n",qPrint(name()),qPrint(mi->memberDef()->name()));
3897 internalInsertMember(mi->memberDef(),prot,FALSE);
3898 }
3899 }
3900 //printf("Adding!\n");
3901 std::unique_ptr<MemberInfo> newMi = std::make_unique<MemberInfo>(mi->memberDef(),prot,virt,TRUE,virtualBaseClass);
3902 newMi->setScopePath(bClass->name()+sep+mi->scopePath());
3903 newMi->setAmbigClass(mi->ambigClass());
3904 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
3905 newMni->push_back(std::move(newMi));
3906 }
3907 }
3908 }
3909 }
3910 }
3911 }
3912 }
3913}
3914
3915// See issue11260, referring to a variable in a base class will make doxygen
3916// add it as a member to the derived class, but this is not correct for non-private variables
3917// so we correct this here, now we know the inheritance hierarchy
3919{
3920 //printf("hideDerivedVariableInPython()\n");
3921 if (bClass)
3922 {
3923 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
3925
3926 // recurse up the inheritance hierarchy
3927 for (const auto &bcd : bClass->baseClasses())
3928 {
3930 }
3931
3932 for (auto &srcMni : srcMnd) // for each member in a base class
3933 {
3934 //printf(" candidate(%s)\n",qPrint(srcMni->memberName()));
3935 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
3936 if (dstMni) // that is also in this class
3937 {
3939 //printf("%s member in %s and %s\n",qPrint(name()),qPrint(bClass->name()),qPrint(name()));
3940 for (it=dstMni->begin();it!=dstMni->end();)
3941 {
3942 MemberDefMutable *dstMd = toMemberDefMutable((*it)->memberDef());
3943 if (dstMd && dstMd->isVariable() && !dstMd->name().startsWith("__"))
3944 {
3945 //printf(" hiding member %s\n",qPrint(dstMd->name()));
3946 // hide a member variable if it is already defined in a base class, unless
3947 // it is a __private variable
3948 removeMemberFromLists(dstMd);
3949 it = dstMni->erase(it);
3950 }
3951 else
3952 {
3953 ++it;
3954 }
3955 }
3956 if (dstMni->empty()) // if the list has become empty, remove the entry from the dictionary
3957 {
3958 dstMnd.del(srcMni->memberName());
3959 }
3960 }
3961 }
3962 }
3963}
3964
3965/*!
3966 * recursively merges the 'all members' lists of a class base
3967 * with that of this class. Must only be called for classes without
3968 * subclasses!
3969 */
3971{
3972 if (m_membersMerged) return;
3974 {
3975 for (const auto &bcd : baseClasses())
3976 {
3977 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
3979 }
3980 }
3981
3982 //printf("> %s::mergeMembers()\n",qPrint(name()));
3983
3985
3986 // first merge the members of the base class recursively
3987 for (const auto &bcd : baseClasses())
3988 {
3989 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
3990 if (bClass)
3991 {
3992 // merge the members in the base class of this inheritance branch first
3993 bClass->mergeMembers();
3994 }
3995 }
3996
3997 // first merge the member that are not inherited via a virtual base class
3998 // (as this can end up reimplemented via multiple paths, see #10717 for examples)
4000 // then process the member that are inherited via a virtual base class to add the
4001 // ones that are not reimplemented via any path
4003
4004 //printf("< %s::mergeMembers()\n",qPrint(name()));
4005}
4006
4007//----------------------------------------------------------------------------
4008
4009/*! Merges the members of a Objective-C category into this class.
4010 */
4012{
4013 AUTO_TRACE();
4014 ClassDefMutable *category = toClassDefMutable(cat);
4015 if (category)
4016 {
4017 bool extractLocalMethods = Config_getBool(EXTRACT_LOCAL_METHODS);
4018 bool makePrivate = category->isLocal();
4019 // in case extract local methods is not enabled we don't add the methods
4020 // of the category in case it is defined in the .m file.
4021 if (makePrivate && !extractLocalMethods) return;
4022 bool isExtension = category->isExtension();
4023
4024 category->setCategoryOf(this);
4025 if (isExtension)
4026 {
4027 category->setArtificial(TRUE);
4028
4029 // copy base classes/protocols from extension
4030 for (const auto &bcd : category->baseClasses())
4031 {
4032 insertBaseClass(bcd.classDef,bcd.usedName,bcd.prot,bcd.virt,bcd.templSpecifiers);
4033 // correct bcd.classDef so that they do no longer derive from
4034 // category, but from this class!
4035 BaseClassList scl = bcd.classDef->subClasses();
4036 for (auto &scd : scl)
4037 {
4038 if (scd.classDef==category)
4039 {
4040 scd.classDef=this;
4041 }
4042 }
4043 bcd.classDef->updateSubClasses(scl);
4044 }
4045 }
4046 // make methods private for categories defined in the .m file
4047 //printf("%s::mergeCategory makePrivate=%d\n",qPrint(name()),makePrivate);
4048
4049 const MemberNameInfoLinkedMap &srcMnd = category->memberNameInfoLinkedMap();
4051
4052 for (auto &srcMni : srcMnd)
4053 {
4054 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4055 if (dstMni) // method is already defined in the class
4056 {
4057 AUTO_TRACE_ADD("Existing member {}",srcMni->memberName());
4058 const auto &dstMi = dstMni->front();
4059 const auto &srcMi = srcMni->front();
4060 if (srcMi && dstMi)
4061 {
4062 MemberDefMutable *smdm = toMemberDefMutable(srcMi->memberDef());
4063 MemberDefMutable *dmdm = toMemberDefMutable(dstMi->memberDef());
4064 if (smdm && dmdm)
4065 {
4067 dmdm->setCategory(category);
4068 dmdm->setCategoryRelation(smdm);
4069 smdm->setCategoryRelation(dmdm);
4070 }
4071 }
4072 }
4073 else // new method name
4074 {
4075 AUTO_TRACE_ADD("New member {}",srcMni->memberName());
4076 // create a deep copy of the list
4077 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
4078
4079 // copy the member(s) from the category to this class
4080 for (auto &mi : *srcMni)
4081 {
4082 //printf("Adding '%s'\n",qPrint(mi->memberDef->name()));
4083 Protection prot = mi->prot();
4084 //if (makePrivate) prot = Private;
4085 auto newMd = mi->memberDef()->deepCopy();
4086 if (newMd)
4087 {
4088 auto mmd = toMemberDefMutable(newMd.get());
4089 AUTO_TRACE_ADD("Copying member {}",mmd->name());
4090 mmd->moveTo(this);
4091
4092 auto newMi=std::make_unique<MemberInfo>(newMd.get(),prot,mi->virt(),mi->inherited(),mi->virtualBaseClass());
4093 newMi->setScopePath(mi->scopePath());
4094 newMi->setAmbigClass(mi->ambigClass());
4095 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
4096 newMni->push_back(std::move(newMi));
4097
4098 // also add the newly created member to the global members list
4099
4100 QCString name = newMd->name();
4102
4103 mmd->setCategory(category);
4104 mmd->setCategoryRelation(mi->memberDef());
4105 auto miMmd = toMemberDefMutable(mi->memberDef());
4106 if (miMmd) miMmd->setCategoryRelation(newMd.get());
4107
4108 if (makePrivate || isExtension)
4109 {
4110 mmd->makeImplementationDetail();
4111 }
4112 internalInsertMember(newMd.get(),prot,FALSE);
4113 mn->push_back(std::move(newMd));
4114 }
4115 }
4116 }
4117 }
4118 }
4119}
4120
4121//----------------------------------------------------------------------------
4122
4124 Protection prot)
4125{
4126 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4127 bool umlLook = Config_getBool(UML_LOOK);
4128 if (prot==Protection::Private && !extractPrivate) return;
4129 //printf("%s::addUsedClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4130
4131 auto it = std::find_if(m_usesImplClassList.begin(),
4132 m_usesImplClassList.end(),
4133 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4134 if (it==m_usesImplClassList.end())
4135 {
4136 m_usesImplClassList.emplace_back(cd);
4137 //printf("Adding used class %s to class %s via accessor %s\n",
4138 // qPrint(cd->name()),qPrint(name()),accessName);
4139 it = m_usesImplClassList.end()-1;
4140 }
4141 QCString acc = accessName;
4142 if (umlLook)
4143 {
4144 switch(prot)
4145 {
4146 case Protection::Public: acc.prepend("+"); break;
4147 case Protection::Private: acc.prepend("-"); break;
4148 case Protection::Protected: acc.prepend("#"); break;
4149 case Protection::Package: acc.prepend("~"); break;
4150 }
4151 }
4152 (*it).addAccessor(acc);
4153}
4154
4156 Protection prot)
4157{
4158 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4159 bool umlLook = Config_getBool(UML_LOOK);
4160 if (prot==Protection::Private && !extractPrivate) return;
4161 //printf("%s::addUsedByClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4162 //
4163 auto it = std::find_if(m_usedByImplClassList.begin(),
4165 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4166 if (it==m_usedByImplClassList.end())
4167 {
4168 m_usedByImplClassList.emplace_back(cd);
4169 //printf("Adding used by class %s to class %s\n",
4170 // qPrint(cd->name()),qPrint(name()));
4171 it = m_usedByImplClassList.end()-1;
4172 }
4173 QCString acc = accessName;
4174 if (umlLook)
4175 {
4176 switch(prot)
4177 {
4178 case Protection::Public: acc.prepend("+"); break;
4179 case Protection::Private: acc.prepend("-"); break;
4180 case Protection::Protected: acc.prepend("#"); break;
4181 case Protection::Package: acc.prepend("~"); break;
4182 }
4183 }
4184 (*it).addAccessor(acc);
4185}
4186
4187
4192
4194{
4195 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
4196 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
4198 {
4199 Definition *scope=nullptr;
4200 if (inlineGroupedClasses && !partOfGroups().empty())
4201 {
4202 // point to the group that embeds this class
4203 return partOfGroups().front()->getOutputFileBase();
4204 }
4205 else if (inlineSimpleClasses && m_isSimple && !partOfGroups().empty())
4206 {
4207 // point to simple struct inside a group
4208 return partOfGroups().front()->getOutputFileBase();
4209 }
4210 else if (inlineSimpleClasses && m_isSimple && (scope=getOuterScope()))
4211 {
4212 if (scope==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) // simple struct embedded in file
4213 {
4214 return getFileDef()->getOutputFileBase();
4215 }
4216 else if (scope->isLinkableInProject()) // simple struct embedded in other container (namespace/group/class)
4217 {
4218 return getOuterScope()->getOutputFileBase();
4219 }
4220 }
4221 }
4222 AUTO_TRACE("name='{}' m_templateMaster={} m_implicitTemplateInstance={}",name(),(void*)m_templateMaster,m_implicitTemplateInstance);
4224 {
4225 // point to the template of which this class is an instance
4226 return m_templateMaster->getOutputFileBase();
4227 }
4228 return m_fileName;
4229}
4230
4235
4237{
4239 {
4240 return m_templateMaster->getSourceFileBase();
4241 }
4242 else
4243 {
4245 }
4246}
4247
4248void ClassDefImpl::setGroupDefForAllMembers(GroupDef *gd,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs)
4249{
4250 gd->addClass(this);
4251 //printf("ClassDefImpl::setGroupDefForAllMembers(%s)\n",qPrint(gd->name()));
4252 for (auto &mni : m_allMemberNameInfoLinkedMap)
4253 {
4254 for (auto &mi : *mni)
4255 {
4256 MemberDefMutable *md = toMemberDefMutable(mi->memberDef());
4257 if (md)
4258 {
4259 md->setGroupDef(gd,pri,fileName,startLine,hasDocs);
4260 gd->insertMember(md,TRUE);
4262 if (innerClass) innerClass->setGroupDefForAllMembers(gd,pri,fileName,startLine,hasDocs);
4263 }
4264 }
4265 }
4266}
4267
4269{
4270 //printf("**** %s::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
4271 if (d->definitionType()==Definition::TypeClass) // only classes can be
4272 // nested in classes.
4273 {
4274 m_innerClasses.add(d->localName(),toClassDef(d));
4275 }
4276}
4277
4279{
4280 return m_innerClasses.find(name);
4281}
4282
4284 int startLine, int startColumn, const QCString &templSpec,bool &freshInstance)
4285{
4286 freshInstance = FALSE;
4287 auto it = std::find_if(m_templateInstances.begin(),
4288 m_templateInstances.end(),
4289 [&templSpec](const auto &ti) { return templSpec==ti.templSpec; });
4290 ClassDefMutable *templateClass=nullptr;
4291 if (it!=m_templateInstances.end())
4292 {
4293 templateClass = toClassDefMutable((*it).classDef);
4294 }
4295 if (templateClass==nullptr)
4296 {
4297 QCString tcname = removeRedundantWhiteSpace(name()+templSpec);
4298 AUTO_TRACE("New template instance class name='{}' templSpec='{}' inside '{}' hidden={}",
4299 name(),templSpec,name(),isHidden());
4300
4301 ClassDef *foundCd = Doxygen::classLinkedMap->find(tcname);
4302 if (foundCd)
4303 {
4304 return foundCd;
4305 }
4306 templateClass =
4308 Doxygen::classLinkedMap->add(tcname,
4309 std::unique_ptr<ClassDef>(
4310 new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
4311 if (templateClass)
4312 {
4313 templateClass->setTemplateMaster(this);
4314 ArgumentList tal = *stringToArgumentList(getLanguage(),templSpec);
4315 templateClass->setTemplateArguments(tal);
4316 templateClass->setOuterScope(getOuterScope());
4317 templateClass->setHidden(isHidden());
4318 templateClass->setArtificial(isArtificial());
4319 templateClass->setImplicitTemplateInstance(true);
4320 m_templateInstances.emplace_back(templSpec,templateClass);
4321
4322 // also add nested classes
4323 for (const auto &innerCd : m_innerClasses)
4324 {
4325 QCString innerName = tcname+"::"+innerCd->localName();
4326 ClassDefMutable *innerClass =
4328 Doxygen::classLinkedMap->add(innerName,
4329 std::unique_ptr<ClassDef>(
4330 new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
4331 if (innerClass)
4332 {
4333 templateClass->addInnerCompound(innerClass);
4334 innerClass->setOuterScope(templateClass);
4335 innerClass->setHidden(isHidden());
4336 innerClass->setArtificial(TRUE);
4337 innerClass->setImplicitTemplateInstance(true);
4338 }
4339 }
4340 freshInstance=TRUE;
4341 }
4342 }
4343 return templateClass;
4344}
4345
4347{
4348 m_templateInstances.emplace_back(templSpec,templateClass);
4349}
4350
4352{
4353 m_templBaseClassNames = templateNames;
4354}
4355
4360
4363 const QCString &templSpec)
4364{
4365 auto actualArguments_p = stringToArgumentList(getLanguage(),templSpec);
4366 auto imd = md->createTemplateInstanceMember(templateArguments,actualArguments_p);
4367 //printf("%s->setMemberClass(%p)\n",qPrint(imd->name()),this);
4368 auto mmd = toMemberDefMutable(imd.get());
4369 mmd->setMemberClass(this);
4370 mmd->setTemplateMaster(md);
4371 mmd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
4372 mmd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
4373 mmd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
4374 mmd->setMemberSpecifiers(md->getMemberSpecifiers());
4375 mmd->setMemberGroupId(md->getMemberGroupId());
4376 mmd->setArtificial(true);
4377 insertMember(imd.get());
4378 //printf("Adding member=%s %s%s to class %s templSpec %s\n",
4379 // imd->typeString(),qPrint(imd->name()),imd->argsString(),
4380 // qPrint(imd->getClassDef()->name()),templSpec);
4381 // insert imd in the list of all members
4382 //printf("Adding member=%s class=%s\n",qPrint(imd->name()),qPrint(name()));
4383 MemberName *mn = Doxygen::memberNameLinkedMap->add(imd->name());
4384 mn->push_back(std::move(imd));
4385}
4386
4388{
4389 //printf("%s::addMembersToTemplateInstance(%s,%s)\n",qPrint(name()),qPrint(cd->name()),templSpec);
4390 for (const auto &mni : cd->memberNameInfoLinkedMap())
4391 {
4392 for (const auto &mi : *mni)
4393 {
4394 addMemberToTemplateInstance(mi->memberDef(),templateArguments,templSpec);
4395 }
4396 }
4397 // also instantatie members for nested classes
4398 for (const auto &innerCd : cd->getClasses())
4399 {
4400 ClassDefMutable *ncd = toClassDefMutable(m_innerClasses.find(innerCd->localName()));
4401 if (ncd)
4402 {
4403 ncd->addMembersToTemplateInstance(innerCd,cd->templateArguments(),templSpec);
4404 }
4405 }
4406}
4407
4409{
4411 {
4412 return m_templateMaster->getReference();
4413 }
4414 else
4415 {
4417 }
4418}
4419
4421{
4423 {
4424 return m_templateMaster->isReference();
4425 }
4426 else
4427 {
4429 }
4430}
4431
4433{
4434 ArgumentLists result;
4436 while (d && d->definitionType()==Definition::TypeClass)
4437 {
4438 result.insert(result.begin(),toClassDef(d)->templateArguments());
4439 d = d->getOuterScope();
4440 }
4441 if (!templateArguments().empty())
4442 {
4443 result.push_back(templateArguments());
4444 }
4445 return result;
4446}
4447
4449 const ArgumentLists *actualParams,uint32_t *actualParamIndex) const
4450{
4451 return makeQualifiedNameWithTemplateParameters(this,actualParams,actualParamIndex);
4452}
4453
4455{
4456 QCString name = m_className.isEmpty() ? localName() : m_className;
4457 auto lang = getLanguage();
4458 if (lang==SrcLangExt::CSharp)
4459 {
4461 }
4462 return name;
4463}
4464
4469
4471{
4472 SrcLangExt lang = getLanguage();
4473 if (!isLinkableInProject()) return;
4474 //printf("ClassDef(%s)::addListReferences()\n",qPrint(name()));
4475 {
4476 const RefItemVector &xrefItems = xrefListItems();
4477 addRefItem(xrefItems,
4478 qualifiedName(),
4479 theTranslator->trCompoundType(compoundType(), lang),
4481 displayName(),
4482 QCString(),
4483 this
4484 );
4485 }
4486 for (const auto &mg : m_memberGroups)
4487 {
4488 mg->addListReferences(this);
4489 }
4490 for (auto &ml : m_memberLists)
4491 {
4492 if (ml->listType().isDetailed())
4493 {
4494 ml->addListReferences(this);
4495 }
4496 }
4497}
4498
4500{
4501 const MemberDef *xmd = nullptr;
4503 if (mni)
4504 {
4505 const int maxInheritanceDepth = 100000;
4506 int mdist=maxInheritanceDepth;
4507 for (auto &mi : *mni)
4508 {
4509 const ClassDef *mcd=mi->memberDef()->getClassDef();
4510 int m=minClassDistance(this,mcd);
4511 //printf("found member in %s linkable=%d m=%d\n",
4512 // qPrint(mcd->name()),mcd->isLinkable(),m);
4513 if (m<mdist)
4514 {
4515 mdist=m;
4516 xmd=mi->memberDef();
4517 }
4518 }
4519 }
4520 //printf("getMemberByName(%s)=%p\n",qPrint(name),xmd);
4521 return xmd;
4522}
4523
4525{
4526 return md->getClassDef() && isBaseClass(md->getClassDef(),TRUE,QCString());
4527}
4528
4530{
4531 for (auto &ml : m_memberLists)
4532 {
4533 if (ml->listType()==lt)
4534 {
4535 return ml.get();
4536 }
4537 }
4538 return nullptr;
4539}
4540
4542{
4543 AUTO_TRACE("{} md={} lt={} isBrief={}",name(),md->name(),lt,isBrief);
4544 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
4545 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
4546 const auto &ml = m_memberLists.get(lt,MemberListContainer::Class);
4547 ml->setNeedsSorting((isBrief && sortBriefDocs) || (!isBrief && sortMemberDocs));
4548 ml->push_back(md);
4549
4550 // for members in the declaration lists we set the section, needed for member grouping
4551 if (!ml->listType().isDetailed())
4552 {
4554 if (mdm)
4555 {
4556 mdm->setSectionList(this,ml.get());
4557 }
4558 }
4559}
4560
4562{
4563 for (auto &ml : m_memberLists)
4564 {
4565 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
4566 }
4567 std::stable_sort(m_innerClasses.begin(),
4568 m_innerClasses.end(),
4569 [](const auto &c1,const auto &c2)
4570 {
4571 return Config_getBool(SORT_BY_SCOPE_NAME) ?
4572 qstricmp_sort(c1->name(), c2->name() )<0 :
4573 qstricmp_sort(c1->className(), c2->className())<0 ;
4574 });
4575}
4576
4578 MemberListType lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const
4579{
4580 //printf("%s: countMemberDeclarations for %s and %s\n",qPrint(name()),lt.to_string(),lt2.to_string());
4581 int count=0;
4582 MemberList * ml = getMemberList(lt);
4583 MemberList * ml2 = getMemberList(lt2);
4584 if (getLanguage()!=SrcLangExt::VHDL) // use specific declarations function
4585 {
4586 if (ml)
4587 {
4588 count+=ml->numDecMembers(inheritedFrom);
4589 //printf("-> ml=%d\n",ml->numDecMembers());
4590 }
4591 if (ml2)
4592 {
4593 count+=ml2->numDecMembers(inheritedFrom);
4594 //printf("-> ml2=%d\n",ml2->numDecMembers());
4595 }
4596 // also include grouped members that have their own section in the class (see bug 722759)
4597 if (inheritedFrom)
4598 {
4599 for (const auto &mg : m_memberGroups)
4600 {
4601 count+=mg->countGroupedInheritedMembers(lt);
4602 if (!lt2.isInvalid()) count+=mg->countGroupedInheritedMembers(lt2);
4603 }
4604 }
4605 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4606 if (!inlineInheritedMembers) // show inherited members as separate lists
4607 {
4608 count+=countInheritedDecMembers(lt,inheritedFrom,invert,showAlways,visitedClasses);
4609 }
4610 }
4611 //printf("-> %d\n",count);
4612 return count;
4613}
4614
4616{
4617 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4618 {
4619 if (lde->kind()==LayoutDocEntry::MemberDecl)
4620 {
4621 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4622 if (lmd)
4623 {
4624 MemberList * ml = getMemberList(lmd->type);
4625 if (ml)
4626 {
4628 }
4629 }
4630 }
4631 else if (lde->kind()==LayoutDocEntry::MemberGroups)
4632 {
4633 for (const auto &mg : m_memberGroups)
4634 {
4635 mg->setAnonymousEnumType();
4636 }
4637 }
4638 }
4639}
4640
4642{
4643 for (auto &ml : m_memberLists)
4644 {
4645 ml->countDecMembers();
4646 ml->countDocMembers();
4647 }
4648 for (const auto &mg : m_memberGroups)
4649 {
4650 mg->countDecMembers();
4651 mg->countDocMembers();
4652 }
4653}
4654
4656 const ClassDef *inheritedFrom,bool invert,bool showAlways,
4657 ClassDefSet &visitedClasses) const
4658{
4659 int inhCount = 0;
4660 int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
4661 bool process = count>0;
4662 //printf("%s: countInheritedDecMembers: lt=%s process=%d count=%d invert=%d\n",
4663 // qPrint(name()),lt.to_string(),process,count,invert);
4664 if ((process^invert) || showAlways)
4665 {
4666 for (const auto &ibcd : m_inherits)
4667 {
4668 ClassDefMutable *icd = toClassDefMutable(ibcd.classDef);
4671 if (icd && icd->isLinkable())
4672 {
4673 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt2);
4674 //printf("%s: convert %s->(%s,%s) prot=%d\n",
4675 // qPrint(icd->name()),lt.to_string(),lt1.to_string(),lt2.to_string(),ibcd.prot);
4676 if (visitedClasses.find(icd)==visitedClasses.end())
4677 {
4678 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4679 if (!lt1.isInvalid())
4680 {
4681 inhCount+=icd->countMemberDeclarations(lt1,inheritedFrom,lt2,FALSE,TRUE,visitedClasses);
4682 }
4683 }
4684 }
4685 }
4686 }
4687 //printf("%s: count=%d\n",qPrint(name()),inhCount);
4688 return inhCount;
4689}
4690
4692 QCString &title,QCString &subtitle) const
4693{
4694 SrcLangExt lang = getLanguage();
4695 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4696 {
4697 if (lde->kind()==LayoutDocEntry::MemberDecl)
4698 {
4699 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4700 if (lmd && lmd->type==type)
4701 {
4702 title = lmd->title(lang);
4703 subtitle = lmd->subtitle(lang);
4704 return;
4705 }
4706 }
4707 }
4708 title="";
4709 subtitle="";
4710}
4711
4713{
4714 int totalCount=0;
4715 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4716 {
4717 if (lde->kind()==LayoutDocEntry::MemberDecl)
4718 {
4719 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4720 if (lmd && lmd->type!=MemberListType::Friends()) // friendship is not inherited
4721 {
4722 ClassDefSet visited;
4723 totalCount+=countInheritedDecMembers(lmd->type,this,TRUE,FALSE,visited);
4724 }
4725 }
4726 }
4727 //printf("countAdditionalInheritedMembers()=%d\n",totalCount);
4728 return totalCount;
4729}
4730
4732{
4733 //printf("**** writeAdditionalInheritedMembers()\n");
4734 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4735 {
4736 if (lde->kind()==LayoutDocEntry::MemberDecl)
4737 {
4738 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4739 if (lmd && lmd->type!=MemberListType::Friends())
4740 {
4741 ClassDefSet visited;
4743 }
4744 }
4745 }
4746}
4747
4749 const ClassDef *inheritedFrom,bool additional) const
4750{
4751 int count=0;
4752 MemberList *ml = getMemberList(lt);
4753 if (ml)
4754 {
4755 count=ml->countInheritableMembers(inheritedFrom);
4756 }
4757 //printf("%s:countMembersIncludingGrouped: count=%d\n",qPrint(name()),count);
4758 for (const auto &mg : m_memberGroups)
4759 {
4760 bool hasOwnSection = !mg->allMembersInSameSection() ||
4761 !m_subGrouping; // group is in its own section
4762 if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
4763 {
4764 count+=mg->countGroupedInheritedMembers(lt);
4765 }
4766 }
4767 //printf("%s:countMembersIncludingGrouped(lt=%s,%s)=%d\n",
4768 // qPrint(name()),qPrint(lt.to_string()),ml?qPrint(ml->listType().to_string()):"<none>",count);
4769 return count;
4770}
4771
4772
4775 const ClassDef *inheritedFrom,bool invert,bool showAlways) const
4776{
4777 int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
4778 bool process = count>0;
4779 //printf("%s: writeInheritedMemberDec: lt=%s process=%d invert=%d always=%d\n",
4780 // qPrint(name()),qPrint(lt.to_string()),process,invert,showAlways);
4781 if ((process^invert) || showAlways)
4782 {
4783 for (const auto &ibcd : m_inherits)
4784 {
4785 ClassDefMutable *icd=toClassDefMutable(ibcd.classDef);
4786 if (icd && icd->isLinkable())
4787 {
4790 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt3);
4791 if (lt2.isInvalid() && !lt3.isInvalid())
4792 {
4793 lt2=lt3;
4794 }
4795 //printf("%s:convert %s->(%s,%s) prot=%d\n",qPrint(icd->name()),qPrint(lt.to_string()),
4796 // qPrint(lt1.to_string()),qPrint(lt2.to_string()),ibcd.prot);
4797 if (visitedClasses.find(icd)==visitedClasses.end())
4798 {
4799 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4800 if (!lt1.isInvalid())
4801 {
4802 //printf("--> writeMemberDeclarations for type %s\n",qPrint(lt1.to_string()));
4803 icd->writeMemberDeclarations(ol,visitedClasses,lt1,
4804 title,QCString(),FALSE,inheritedFrom,lt2,FALSE,TRUE);
4805 }
4806 }
4807 else
4808 {
4809 //printf("%s: class already visited!\n",qPrint(icd->name()));
4810 }
4811 }
4812 }
4813 }
4814}
4815
4817 MemberListType lt,const QCString &title,
4818 const QCString &subTitle,bool showInline,const ClassDef *inheritedFrom,MemberListType lt2,
4819 bool invert,bool showAlways) const
4820{
4821 //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%s lt2=%s\n",qPrint(name()),qPrint(lt.to_string()),qPrint(lt2.to_string()));
4822 MemberList * ml = getMemberList(lt);
4823 MemberList * ml2 = getMemberList(lt2);
4824 if (getLanguage()==SrcLangExt::VHDL) // use specific declarations function
4825 {
4826 static const ClassDef *cdef;
4827 if (cdef!=this)
4828 { // only one inline link
4830 cdef=this;
4831 }
4832 if (ml)
4833 {
4834 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,this,nullptr,nullptr,nullptr);
4835 }
4836 }
4837 else
4838 {
4839 //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",qPrint(name()),qPrint(title),(void*)ml,(void*)ml2);
4840 QCString tt = title, st = subTitle;
4841 if (ml)
4842 {
4843 //printf(" writeDeclarations ml type=%s count=%d\n",qPrint(lt.to_string()),ml->numDecMembers(inheritedFrom));
4844 ml->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,true);
4845 tt.clear();
4846 st.clear();
4847 }
4848 if (ml2)
4849 {
4850 //printf(" writeDeclarations ml2 type=%s count=%d\n",qPrint(lt2.to_string()),ml2->numDecMembers(inheritedFrom));
4851 ml2->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,ml==nullptr);
4852 }
4853 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4854 if (!inlineInheritedMembers) // show inherited members as separate lists
4855 {
4856 writeInheritedMemberDeclarations(ol,visitedClasses,lt,lt2,title,
4857 inheritedFrom ? inheritedFrom : this,
4858 invert,showAlways);
4859 }
4860 }
4861}
4862
4864 const ClassDef *inheritedFrom,const QCString &inheritId) const
4865{
4866 //printf("** %s::addGroupedInheritedMembers() inheritId=%s\n",qPrint(name()),qPrint(inheritId));
4867 for (const auto &mg : m_memberGroups)
4868 {
4869 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
4870 {
4871 mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId);
4872 }
4873 }
4874}
4875
4877{
4878 //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",qPrint(name()));
4879 MemberList * ml = getMemberList(lt);
4880 if (ml) ml->writeDocumentation(ol,displayName(),this,title,FALSE,showInline);
4881}
4882
4884{
4885 //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",qPrint(name()));
4886 MemberList * ml = getMemberList(lt);
4887 if (ml) ml->writeSimpleDocumentation(ol,this);
4888}
4889
4891 MemberListType lt,bool inGroup,
4892 int indentLevel,const ClassDef *inheritedFrom,const QCString &inheritId) const
4893{
4894 //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",qPrint(name()));
4895 MemberList * ml = getMemberList(lt);
4896 if (ml)
4897 {
4898 ml->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
4899 }
4900}
4901
4903{
4904 return m_isLocal;
4905}
4906
4911
4916
4918{
4919 return m_inherits;
4920}
4921
4923{
4924 m_inherits = bcd;
4925}
4926
4928{
4929 return m_inheritedBy;
4930}
4931
4933{
4934 m_inheritedBy = bcd;
4935}
4936
4941
4943{
4944 std::stable_sort(m_allMemberNameInfoLinkedMap.begin(),
4946 [](const auto &m1,const auto &m2)
4947 {
4948 return qstricmp_sort(m1->memberName(),m2->memberName())<0;
4949 });
4950}
4951
4953{
4954 return m_prot;
4955}
4956
4958{
4959 return m_tempArgs;
4960}
4961
4963{
4964 return m_fileDef;
4965}
4966
4968{
4969 return m_moduleDef;
4970}
4971
4976
4978{
4979 return m_templateMaster;
4980}
4981
4986
4991
4993{
4994 return !m_tempArgs.empty();
4995}
4996
4998{
4999 return m_incInfo.get();
5000}
5001
5006
5011
5016
5018{
5019 return m_isTemplArg;
5020}
5021
5023{
5024 return m_isAbstract || m_spec.isAbstract();
5025}
5026
5028{
5029 return m_spec.isFinal();
5030}
5031
5033{
5034 return m_spec.isSealed();
5035}
5036
5038{
5039 return m_spec.isPublished();
5040}
5041
5043{
5044 return m_spec.isForwardDecl();
5045}
5046
5048{
5049 return m_spec.isInterface();
5050}
5051
5053{
5054 return getLanguage()==SrcLangExt::ObjC;
5055}
5056
5058{
5060}
5061
5063{
5065}
5066
5068{
5069 return m_categoryOf;
5070}
5071
5073{
5074 return m_memberLists;
5075}
5076
5078{
5079 return m_memberGroups;
5080}
5081
5083{
5084 m_fileDef = fd;
5085}
5086
5088{
5089 m_moduleDef = mod;
5090}
5091
5093{
5094 m_subGrouping = enabled;
5095}
5096
5105
5107{
5108 m_isStatic=b;
5109}
5110
5115
5117{
5118 assert(tm!=this);
5120}
5121
5123{
5124 m_isTemplArg = b;
5125}
5126
5128{
5129 m_categoryOf = cd;
5130}
5131
5133{
5134 m_usedOnly = b;
5135}
5136
5138{
5139 return m_usedOnly;
5140}
5141
5143{
5144 return m_isSimple;
5145}
5146
5148{
5149 return m_arrowOperator;
5150}
5151
5153{
5154 md->setMemberType(t);
5155 for (auto &ml : m_memberLists)
5156 {
5157 ml->remove(md);
5158 }
5159 insertMember(md);
5160}
5161
5163{
5164 QCString anc;
5166 {
5168 {
5169 // point to the template of which this class is an instance
5170 anc = m_templateMaster->getOutputFileBase();
5171 }
5172 else
5173 {
5174 anc = m_fileName;
5175 }
5176 }
5177 return anc;
5178}
5179
5181{
5182 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
5183 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
5184
5185 Definition *container = getOuterScope();
5186
5187 bool containerLinkable =
5188 container &&
5189 (
5190 (container==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) || // global class in documented file
5191 container->isLinkableInProject() // class in documented scope
5192 );
5193
5194 // inline because of INLINE_GROUPED_CLASSES=YES ?
5195 bool b1 = (inlineGroupedClasses && !partOfGroups().empty()); // a grouped class
5196 // inline because of INLINE_SIMPLE_STRUCTS=YES ?
5197 bool b2 = (inlineSimpleClasses && m_isSimple && // a simple class
5198 (containerLinkable || // in a documented container
5199 !partOfGroups().empty() // or part of a group
5200 )
5201 );
5202 //printf("%s::isEmbeddedInOuterScope(): inlineGroupedClasses=%d "
5203 // "inlineSimpleClasses=%d partOfGroups()=%p m_isSimple=%d "
5204 // "getOuterScope()=%s b1=%d b2=%d\n",
5205 // qPrint(name()),inlineGroupedClasses,inlineSimpleClasses,
5206 // partOfGroups().pointer(),m_isSimple,getOuterScope()?qPrint(getOuterScope()->name()):"<none>",b1,b2);
5207 return b1 || b2; // either reason will do
5208}
5209
5211{
5212 return m_tagLessRef;
5213}
5214
5216{
5217 m_tagLessRef = cd;
5218}
5219
5221{
5222 for (auto &ml : m_memberLists)
5223 {
5224 ml->remove(md);
5225 }
5226}
5227
5229{
5230 return m_isJavaEnum;
5231}
5232
5234{
5235 m_spec = spec;
5236}
5237
5239{
5240 for (const auto &sx : qualifiers)
5241 {
5242 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5243 if (!alreadyAdded)
5244 {
5245 m_qualifiers.push_back(sx);
5246 }
5247 }
5248}
5249
5254
5256{
5257 AUTO_TRACE("name={}",md->name());
5258 const auto &mni = m_allMemberNameInfoLinkedMap.find(md->name());
5259 if (mni)
5260 {
5261 for (const auto &mi : *mni)
5262 {
5263 const MemberDef *classMd = mi->memberDef();
5264 const ArgumentList &classAl = classMd->argumentList();
5265 const ArgumentList &al = md->argumentList();
5266 bool found = matchArguments2(
5267 classMd->getOuterScope(),classMd->getFileDef(),&classAl,
5268 md->getOuterScope(),md->getFileDef(),&al,
5269 true,getLanguage()
5270 );
5271 if (found)
5272 {
5273 AUTO_TRACE_EXIT("true");
5274 return true;
5275 }
5276 }
5277 }
5278 AUTO_TRACE_EXIT("false");
5279 return false;
5280}
5281
5283{
5284 QCString n = name();
5285 int si = n.find('(');
5286 int ei = n.find(')');
5287 bool b = ei>si && n.mid(si+1,ei-si-1).stripWhiteSpace().isEmpty();
5288 return b;
5289}
5290
5292{
5293 return m_files;
5294}
5295
5297{
5298 return m_typeConstraints;
5299}
5300
5302{
5303 return m_examples;
5304}
5305
5307{
5308 return m_subGrouping;
5309}
5310
5312{
5313 return m_spec.isLocal();
5314}
5315
5317{
5318 m_metaData = md;
5319}
5320
5325
5330
5332{
5334}
5335
5337{
5339}
5340
5342{
5343 switch (compoundType())
5344 {
5345 case Class: return CodeSymbolType::Class; break;
5346 case Struct: return CodeSymbolType::Struct; break;
5347 case Union: return CodeSymbolType::Union; break;
5348 case Interface: return CodeSymbolType::Interface; break;
5349 case Protocol: return CodeSymbolType::Protocol; break;
5350 case Category: return CodeSymbolType::Category; break;
5351 case Exception: return CodeSymbolType::Exception; break;
5352 case Service: return CodeSymbolType::Service; break;
5353 case Singleton: return CodeSymbolType::Singleton; break;
5354 }
5355 return CodeSymbolType::Class;
5356}
5357
5362
5367
5368
5369// --- Cast functions
5370//
5372{
5373 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5374 {
5375 return static_cast<ClassDef*>(d);
5376 }
5377 else
5378 {
5379 return nullptr;
5380 }
5381}
5382
5384{
5385 Definition *d = toDefinition(md);
5386 if (d && typeid(*d)==typeid(ClassDefImpl))
5387 {
5388 return static_cast<ClassDef*>(d);
5389 }
5390 else
5391 {
5392 return nullptr;
5393 }
5394}
5395
5397{
5398 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5399 {
5400 return static_cast<const ClassDef*>(d);
5401 }
5402 else
5403 {
5404 return nullptr;
5405 }
5406}
5407
5409{
5410 if (d && typeid(*d)==typeid(ClassDefImpl))
5411 {
5412 return static_cast<ClassDefMutable*>(d);
5413 }
5414 else
5415 {
5416 return nullptr;
5417 }
5418}
5419
5420// --- Helpers
5421
5422/*! Get a class definition given its name.
5423 * Returns nullptr if the class is not found.
5424 */
5426{
5427 if (n.isEmpty()) return nullptr;
5428 return Doxygen::classLinkedMap->find(n);
5429}
5430
5432{
5433 for (const auto &bcd : bcl)
5434 {
5435 const ClassDef *cd=bcd.classDef;
5436 if (cd->isVisibleInHierarchy()) return true;
5437 if (classHasVisibleRoot(cd->baseClasses())) return true;
5438 }
5439 return false;
5440}
5441
5443{
5444 BaseClassList bcl;
5445
5446 if (cd->getLanguage()==SrcLangExt::VHDL) // reverse baseClass/subClass relation
5447 {
5448 if (cd->baseClasses().empty()) return FALSE;
5449 bcl=cd->baseClasses();
5450 }
5451 else
5452 {
5453 if (cd->subClasses().empty()) return FALSE;
5454 bcl=cd->subClasses();
5455 }
5456
5457 for (const auto &bcd : bcl)
5458 {
5459 if (bcd.classDef->isVisibleInHierarchy())
5460 {
5461 return TRUE;
5462 }
5463 }
5464 return FALSE;
5465}
5466
5468{
5469 bool allExternals = Config_getBool(ALLEXTERNALS);
5470 return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
5471}
5472
5473//----------------------------------------------------------------------
5474// recursive function that returns the number of branches in the
5475// inheritance tree that the base class 'bcd' is below the class 'cd'
5476
5477int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level)
5478{
5479 const int maxInheritanceDepth = 100000;
5480 if (bcd->categoryOf()) // use class that is being extended in case of
5481 // an Objective-C category
5482 {
5483 bcd=bcd->categoryOf();
5484 }
5485 if (cd==bcd) return level;
5486 if (level==256)
5487 {
5488 warn_uncond("class {} seem to have a recursive inheritance relation!\n",cd->name());
5489 return -1;
5490 }
5491 int m=maxInheritanceDepth;
5492 for (const auto &bcdi : cd->baseClasses())
5493 {
5494 int mc=minClassDistance(bcdi.classDef,bcd,level+1);
5495 if (mc<m) m=mc;
5496 if (m<0) break;
5497 }
5498 return m;
5499}
5500
5502{
5503 if (bcd->categoryOf()) // use class that is being extended in case of
5504 // an Objective-C category
5505 {
5506 bcd=bcd->categoryOf();
5507 }
5508 if (cd==bcd)
5509 {
5510 goto exit;
5511 }
5512 if (level==256)
5513 {
5514 err("Internal inconsistency: found class {} seem to have a recursive "
5515 "inheritance relation! Please send a bug report to doxygen@gmail.com\n",cd->name());
5516 }
5517 else if (prot!=Protection::Private)
5518 {
5519 for (const auto &bcdi : cd->baseClasses())
5520 {
5521 Protection baseProt = classInheritedProtectionLevel(bcdi.classDef,bcd,bcdi.prot,level+1);
5522 if (baseProt==Protection::Private) prot=Protection::Private;
5523 else if (baseProt==Protection::Protected) prot=Protection::Protected;
5524 }
5525 }
5526exit:
5527 //printf("classInheritedProtectionLevel(%s,%s)=%d\n",qPrint(cd->name()),qPrint(bcd->name()),prot);
5528 return prot;
5529}
5530
5531
constexpr auto prefix
Definition anchor.cpp:44
std::vector< ArgumentList > ArgumentLists
Definition arguments.h:138
This class represents an function or template argument list.
Definition arguments.h:60
bool empty() const
Definition arguments.h:92
Argument & at(size_t i)
Definition arguments.h:100
bool isSimple() const override
Definition classdef.cpp:705
bool isFortran() const override
Returns TRUE if this class is implemented in Fortran.
Definition classdef.cpp:671
QCString requiresClause() const override
Definition classdef.cpp:733
void writeTagFile(TextStream &ol) const override
Definition classdef.cpp:769
int countMemberDeclarations(MemberListType lt, const ClassDef *inheritedFrom, MemberListType lt2, bool invert, bool showAlways, ClassDefSet &visitedClasses) const override
Definition classdef.cpp:742
bool isSubClass(ClassDef *bcd, int level=0) const override
Returns TRUE iff bcd is a direct or indirect sub class of this class.
Definition classdef.cpp:640
const UsesClassList & usedByImplementationClasses() const override
Definition classdef.cpp:654
bool hasDetailedDescription() const override
returns TRUE if this class has a non-empty detailed description
Definition classdef.cpp:602
ModuleDef * getModuleDef() const override
Returns the C++20 module in which this compound's definition can be found.
Definition classdef.cpp:634
void writeDocumentation(OutputList &ol) const override
Definition classdef.cpp:752
const UsesClassList & usedImplementationClasses() const override
Definition classdef.cpp:652
StringVector getQualifiers() const override
Definition classdef.cpp:735
void writeSummaryLinks(OutputList &ol) const override
Definition classdef.cpp:765
bool isVisibleInHierarchy() const override
the class is visible in a class diagram, or class hierarchy
Definition classdef.cpp:626
QCString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const override
Definition classdef.cpp:664
bool isPublished() const override
Returns TRUE if this class is marked as published.
Definition classdef.cpp:679
const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const override
Returns a dictionary of all members.
Definition classdef.cpp:618
QCString anchor() const override
Definition classdef.cpp:701
QCString title() const override
Definition classdef.cpp:713
bool isImplicitTemplateInstance() const override
Definition classdef.cpp:749
const FileList & usedFiles() const override
Definition classdef.cpp:717
CodeSymbolType codeSymbolType() const override
Definition classdef.cpp:584
bool isFinal() const override
Returns TRUE if this class is marked as final.
Definition classdef.cpp:675
const ExampleList & getExamples() const override
Definition classdef.cpp:721
void moveTo(Definition *) override
Definition classdef.cpp:582
bool isReference() const override
Definition classdef.cpp:594
bool isTemplateArgument() const override
Definition classdef.cpp:658
void updateSubClasses(const BaseClassList &) override
Update the list of sub classes to the one passed.
Definition classdef.cpp:782
bool isForwardDeclared() const override
Returns TRUE if this class represents a forward declaration of a template class.
Definition classdef.cpp:683
const ArgumentList & typeConstraints() const override
Definition classdef.cpp:719
const IncludeInfo * includeInfo() const override
Definition classdef.cpp:650
bool isAccessibleMember(const MemberDef *md) const override
returns TRUE iff md is a member of this class or of the the public/protected members of a base class
Definition classdef.cpp:642
QCString getSourceFileBase() const override
Definition classdef.cpp:590
void writeMemberPages(OutputList &ol) const override
Definition classdef.cpp:756
ClassDefAliasImpl(const Definition *newScope, const ClassDef *cd)
Definition classdef.cpp:571
void writeDeclaration(OutputList &ol, const MemberDef *md, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const override
Definition classdef.cpp:760
void writeQuickMemberLinks(OutputList &ol, const MemberDef *md) const override
Definition classdef.cpp:763
void updateBaseClasses(const BaseClassList &) override
Update the list of base classes to the one passed.
Definition classdef.cpp:781
bool containsOverload(const MemberDef *md) const override
Definition classdef.cpp:737
bool subGrouping() const override
Definition classdef.cpp:727
const ArgumentList & templateArguments() const override
Returns the template arguments of this class.
Definition classdef.cpp:630
Protection protection() const override
Return the protection level (Public,Protected,Private) in which this compound was found.
Definition classdef.cpp:620
bool isCSharp() const override
Returns TRUE if this class is implemented in C#.
Definition classdef.cpp:673
const MemberGroupList & getMemberGroups() const override
Returns the member groups defined for this class.
Definition classdef.cpp:695
bool isEmbeddedInOuterScope() const override
Definition classdef.cpp:703
QCString getReference() const override
Definition classdef.cpp:592
int isBaseClass(const ClassDef *bcd, bool followInstances, const QCString &templSpec) const override
Returns TRUE iff bcd is a direct or indirect base class of this class.
Definition classdef.cpp:638
int countMembersIncludingGrouped(MemberListType lt, const ClassDef *inheritedFrom, bool additional) const override
Definition classdef.cpp:740
void addGroupedInheritedMembers(OutputList &ol, MemberListType lt, const ClassDef *inheritedFrom, const QCString &inheritId) const override
Definition classdef.cpp:777
bool isSealed() const override
Returns TRUE if this class is marked as sealed.
Definition classdef.cpp:677
bool hasDocumentation() const override
Definition classdef.cpp:600
FileDef * getFileDef() const override
Returns the namespace this compound is in, or 0 if it has a global scope.
Definition classdef.cpp:632
ArgumentLists getTemplateParameterLists() const override
Returns the template parameter lists that form the template declaration of this class.
Definition classdef.cpp:662
QCString getMemberListFileName() const override
Definition classdef.cpp:725
bool hasNonReferenceSuperClass() const override
Definition classdef.cpp:731
void writeInlineDocumentation(OutputList &ol) const override
Definition classdef.cpp:767
const BaseClassList & subClasses() const override
Returns the list of sub classes that directly derive from this class.
Definition classdef.cpp:616
bool isJavaEnum() const override
Definition classdef.cpp:711
QCString inheritanceGraphFileName() const override
returns the file name to use for the inheritance graph
Definition classdef.cpp:606
~ClassDefAliasImpl() override
Definition classdef.cpp:573
const TemplateInstanceList & getTemplateInstances() const override
Returns a sorted dictionary with all template instances found for this template class.
Definition classdef.cpp:644
QCString compoundTypeString() const override
Returns the type of compound as a string.
Definition classdef.cpp:612
bool isLinkableInProject() const override
Definition classdef.cpp:622
QCString displayName(bool includeScope=TRUE) const override
Definition classdef.cpp:608
QCString className() const override
Returns the name of the class including outer classes, but not including namespaces.
Definition classdef.cpp:689
bool isLocal() const override
Returns TRUE if this is a local class definition, see EXTRACT_LOCAL_CLASSES.
Definition classdef.cpp:596
QCString getInstanceOutputFileBase() const override
Definition classdef.cpp:588
void writeDocumentationForInnerClasses(OutputList &ol) const override
Definition classdef.cpp:754
const MemberLists & getMemberLists() const override
Returns the list containing the list of members sorted per type.
Definition classdef.cpp:693
MemberList * getMemberList(MemberListType lt) const override
Returns the members in the list identified by lt.
Definition classdef.cpp:691
ClassDef * categoryOf() const override
Returns the class of which this is a category (Objective-C only)
Definition classdef.cpp:687
const ClassDef * getCdAlias() const
Definition classdef.cpp:578
QCString collaborationGraphFileName() const override
returns the file name to use for the collaboration graph
Definition classdef.cpp:604
void writeMemberDeclarations(OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, const QCString &title, const QCString &subTitle=QCString(), bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt2=MemberListType::Invalid(), bool invert=FALSE, bool showAlways=FALSE) const override
Definition classdef.cpp:771
QCString getOutputFileBase() const override
Definition classdef.cpp:586
CompoundType compoundType() const override
Returns the type of compound this is, i.e.
Definition classdef.cpp:610
const TemplateNameMap & getTemplateBaseClassNames() const override
Definition classdef.cpp:697
void writeDeclarationLink(OutputList &ol, bool &found, const QCString &header, bool localNames) const override
Definition classdef.cpp:746
const Definition * findInnerCompound(const QCString &name) const override
Definition classdef.cpp:660
DefType definitionType() const override
Definition classdef.cpp:576
QCString generatedFromFiles() const override
Definition classdef.cpp:715
bool isLinkable() const override
Definition classdef.cpp:624
const BaseClassList & baseClasses() const override
Returns the list of base classes from which this class directly inherits.
Definition classdef.cpp:614
const ClassDef * tagLessReference() const override
Definition classdef.cpp:707
bool isExtension() const override
Returns TRUE if this class represents an Objective-C 2.0 extension (nameless category)
Definition classdef.cpp:681
ClassLinkedRefMap getClasses() const override
returns the classes nested into this class
Definition classdef.cpp:598
const ConstraintClassList & templateTypeConstraints() const override
Definition classdef.cpp:656
bool isInterface() const override
Returns TRUE if this class represents an interface.
Definition classdef.cpp:685
std::unique_ptr< ClassDef > deepCopy(const QCString &name) const override
Definition classdef.cpp:579
bool isAbstract() const override
Returns TRUE if there is at least one pure virtual member in this class.
Definition classdef.cpp:667
bool hasExamples() const override
Definition classdef.cpp:723
bool visibleInParentsDeclList() const override
show this class in the declaration section of its parent?
Definition classdef.cpp:628
const MemberDef * getMemberByName(const QCString &s) const override
Returns the member with the given name.
Definition classdef.cpp:636
const ClassDef * templateMaster() const override
Returns the template master of which this class is an instance.
Definition classdef.cpp:646
bool isTemplate() const override
Returns TRUE if this class is a template.
Definition classdef.cpp:648
bool isSliceLocal() const override
Definition classdef.cpp:729
bool isUsedOnly() const override
Definition classdef.cpp:699
const MemberDef * isSmartPointer() const override
Definition classdef.cpp:709
bool isObjectiveC() const override
Returns TRUE if this class is implemented in Objective-C.
Definition classdef.cpp:669
void writeMemberList(OutputList &ol) const override
Definition classdef.cpp:758
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual int countMemberDeclarations(MemberListType lt, const ClassDef *inheritedFrom, MemberListType lt2, bool invert, bool showAlways, ClassDefSet &visitedClasses) const =0
virtual bool isSliceLocal() const =0
virtual ModuleDef * getModuleDef() const =0
Returns the C++20 module in which this compound's definition can be found.
virtual bool isAbstract() const =0
Returns TRUE if there is at least one pure virtual member in this class.
virtual bool isFinal() const =0
Returns TRUE if this class is marked as final.
virtual bool visibleInParentsDeclList() const =0
show this class in the declaration section of its parent?
virtual bool subGrouping() const =0
virtual void writeSummaryLinks(OutputList &ol) const =0
virtual bool hasDetailedDescription() const =0
returns TRUE if this class has a non-empty detailed description
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual void writeMemberPages(OutputList &ol) const =0
virtual QCString compoundTypeString() const =0
Returns the type of compound as a string.
virtual bool isFortran() const =0
Returns TRUE if this class is implemented in Fortran.
virtual void writeDocumentation(OutputList &ol) const =0
virtual const MemberLists & getMemberLists() const =0
Returns the list containing the list of members sorted per type.
virtual QCString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
virtual void writeMemberList(OutputList &ol) const =0
virtual bool isVisibleInHierarchy() const =0
the class is visible in a class diagram, or class hierarchy
virtual bool isTemplate() const =0
Returns TRUE if this class is a template.
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual bool isSealed() const =0
Returns TRUE if this class is marked as sealed.
virtual const MemberDef * getMemberByName(const QCString &) const =0
Returns the member with the given name.
virtual const TemplateInstanceList & getTemplateInstances() const =0
Returns a sorted dictionary with all template instances found for this template class.
virtual int isBaseClass(const ClassDef *bcd, bool followInstances, const QCString &templSpec=QCString()) const =0
Returns TRUE iff bcd is a direct or indirect base class of this class.
virtual ArgumentLists getTemplateParameterLists() const =0
Returns the template parameter lists that form the template declaration of this class.
virtual const UsesClassList & usedImplementationClasses() const =0
virtual bool isObjectiveC() const =0
Returns TRUE if this class is implemented in Objective-C.
virtual bool hasExamples() const =0
virtual QCString inheritanceGraphFileName() const =0
returns the file name to use for the inheritance graph
virtual StringVector getQualifiers() const =0
virtual bool isLocal() const =0
Returns TRUE if this is a local class definition, see EXTRACT_LOCAL_CLASSES.
virtual void writeQuickMemberLinks(OutputList &ol, const MemberDef *md) const =0
virtual bool isSimple() const =0
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
virtual const ClassDef * tagLessReference() const =0
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt.
virtual ClassDef * categoryOf() const =0
Returns the class of which this is a category (Objective-C only)
virtual QCString getInstanceOutputFileBase() const =0
virtual const MemberDef * isSmartPointer() const =0
virtual bool isExtension() const =0
Returns TRUE if this class represents an Objective-C 2.0 extension (nameless category)
virtual bool hasNonReferenceSuperClass() const =0
virtual bool isCSharp() const =0
Returns TRUE if this class is implemented in C#.
virtual bool isForwardDeclared() const =0
Returns TRUE if this class represents a forward declaration of a template class.
virtual QCString generatedFromFiles() const =0
virtual const ExampleList & getExamples() const =0
virtual bool isJavaEnum() const =0
virtual bool isSubClass(ClassDef *bcd, int level=0) const =0
Returns TRUE iff bcd is a direct or indirect sub class of this class.
virtual bool isTemplateArgument() const =0
virtual int countMembersIncludingGrouped(MemberListType lt, const ClassDef *inheritedFrom, bool additional) const =0
virtual const ArgumentList & typeConstraints() const =0
virtual bool isAccessibleMember(const MemberDef *md) const =0
returns TRUE iff md is a member of this class or of the the public/protected members of a base class
virtual QCString collaborationGraphFileName() const =0
returns the file name to use for the collaboration graph
virtual const TemplateNameMap & getTemplateBaseClassNames() const =0
virtual bool isPublished() const =0
Returns TRUE if this class is marked as published.
virtual const FileList & usedFiles() const =0
virtual void writeMemberDeclarations(OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, const QCString &title, const QCString &subTitle=QCString(), bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt2=MemberListType::Invalid(), bool invert=FALSE, bool showAlways=FALSE) const =0
virtual QCString getMemberListFileName() const =0
virtual bool isEmbeddedInOuterScope() const =0
virtual void addGroupedInheritedMembers(OutputList &ol, MemberListType lt, const ClassDef *inheritedFrom, const QCString &inheritId) const =0
virtual const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const =0
Returns a dictionary of all members.
virtual void writeDeclarationLink(OutputList &ol, bool &found, const QCString &header, bool localNames) const =0
virtual const ConstraintClassList & templateTypeConstraints() const =0
virtual void writeDeclaration(OutputList &ol, const MemberDef *md, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const =0
virtual bool isImplicitTemplateInstance() const =0
virtual QCString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const =0
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class.
virtual const UsesClassList & usedByImplementationClasses() const =0
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
CompoundType
The various compound types.
Definition classdef.h:109
@ Singleton
Definition classdef.h:117
@ Interface
Definition classdef.h:112
@ Exception
Definition classdef.h:115
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e.
virtual bool containsOverload(const MemberDef *md) const =0
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
virtual bool isInterface() const =0
Returns TRUE if this class represents an interface.
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
virtual const IncludeInfo * includeInfo() const =0
virtual QCString requiresClause() const =0
virtual void writeInlineDocumentation(OutputList &ol) const =0
virtual void writeTagFile(TextStream &) const =0
virtual QCString title() const =0
virtual void writeDocumentationForInnerClasses(OutputList &ol) const =0
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
virtual bool isUsedOnly() const =0
Implementation of the ClassDef interface.
Definition classdef.cpp:185
bool isSubClass(ClassDef *bcd, int level=0) const override
Returns TRUE iff bcd is a direct or indirect sub class of this class.
bool addExample(const QCString &anchor, const QCString &name, const QCString &file) override
QCString getReference() const override
QCString getInstanceOutputFileBase() const override
TemplateInstanceList m_templateInstances
Definition classdef.cpp:486
void writeIncludeFilesForSlice(OutputList &ol) const
void overrideInheritanceGraph(CLASS_GRAPH_t e) override
ClassLinkedRefMap getClasses() const override
returns the classes nested into this class
QCString m_collabFileName
Definition classdef.cpp:418
ArgumentList m_typeConstraints
Definition classdef.cpp:455
void addMembersToMemberGroup() override
bool subGrouping() const override
void setMetaData(const QCString &md) override
void distributeMemberGroupDocumentation() override
void addMemberToList(MemberListType lt, MemberDef *md, bool isBrief)
bool isObjectiveC() const override
Returns TRUE if this class is implemented in Objective-C.
StringSet m_vhdlSummaryTitles
List of titles to use for the summary.
Definition classdef.cpp:530
QCString compoundTypeString() const override
Returns the type of compound as a string.
ExampleList m_examples
Definition classdef.cpp:461
void setImplicitTemplateInstance(bool b) override
void insertUsedFile(const FileDef *) override
QCString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const override
void writeTemplateSpec(OutputList &ol, const Definition *d, const QCString &type, SrcLangExt lang) const
void addUsedByClass(ClassDef *cd, const QCString &accessName, Protection prot) override
QCString m_fileName
Definition classdef.cpp:412
const MemberDef * m_arrowOperator
Does this class overloaded the -> operator?
Definition classdef.cpp:536
void addClassAttributes(OutputList &ol) const
void updateSubClasses(const BaseClassList &bcd) override
Update the list of sub classes to the one passed.
void addMemberToTemplateInstance(const MemberDef *md, const ArgumentList &templateArguments, const QCString &templSpec) override
MemberGroupList m_memberGroups
Definition classdef.cpp:504
TypeSpecifier m_spec
Definition classdef.cpp:543
ClassDef * m_categoryOf
Definition classdef.cpp:499
FileDef * getFileDef() const override
Returns the namespace this compound is in, or 0 if it has a global scope.
bool isTemplateArgument() const override
void writeInheritanceGraph(OutputList &ol) const
QCString className() const override
Returns the name of the class including outer classes, but not including namespaces.
const ClassDef * m_tagLessRef
Definition classdef.cpp:538
void setAnonymousEnumType() override
void setTagLessReference(const ClassDef *cd) override
Protection m_prot
Definition classdef.cpp:470
bool isLinkableInProject() const override
BaseClassList m_inheritedBy
Definition classdef.cpp:435
FileList m_files
Definition classdef.cpp:458
const TemplateInstanceList & getTemplateInstances() const override
Returns a sorted dictionary with all template instances found for this template class.
MemberLists m_memberLists
Definition classdef.cpp:501
const UsesClassList & usedByImplementationClasses() const override
ArgumentLists getTemplateParameterLists() const override
Returns the template parameter lists that form the template declaration of this class.
void writeMemberList(OutputList &ol) const override
void writeMemberDeclarations(OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, const QCString &title, const QCString &subTitle=QCString(), bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt2=MemberListType::Invalid(), bool invert=FALSE, bool showAlways=FALSE) const override
void writeBriefDescription(OutputList &ol, bool exampleFlag) const
void writeInlineClasses(OutputList &ol) const
void moveTo(Definition *) override
Definition classdef.cpp:967
const ExampleList & getExamples() const override
UsesClassList m_usesImplClassList
Definition classdef.cpp:478
void addListReferences() override
const ArgumentList & templateArguments() const override
Returns the template arguments of this class.
QCString m_inheritFileName
Definition classdef.cpp:421
void writeDetailedDocumentationBody(OutputList &ol) const
ClassDefImpl(const QCString &fileName, int startLine, int startColumn, const QCString &name, CompoundType ct, const QCString &ref=QCString(), const QCString &fName=QCString(), bool isSymbol=TRUE, bool isJavaEnum=FALSE)
Definition classdef.cpp:797
QCString generatedFromFiles() const override
const ClassDef * m_templateMaster
Definition classdef.cpp:491
void writeTagFile(TextStream &) const override
void endMemberDeclarations(OutputList &ol) const
bool m_membersMerged
Definition classdef.cpp:513
const MemberGroupList & getMemberGroups() const override
Returns the member groups defined for this class.
void sortMemberLists() override
const FileList & usedFiles() const override
void insertExplicitTemplateInstance(ClassDef *instance, const QCString &spec) override
void setTemplateArguments(const ArgumentList &al) override
void mergeCategory(ClassDef *category) override
void countMembers() override
void setClassSpecifier(TypeSpecifier spec) override
const MemberDef * getMemberByName(const QCString &) const override
Returns the member with the given name.
void reclassifyMember(MemberDefMutable *md, MemberType t) override
int countAdditionalInheritedMembers() const
void writePlainMemberDeclaration(OutputList &ol, MemberListType lt, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const
bool isFinal() const override
Returns TRUE if this class is marked as final.
void insertSubClass(ClassDef *, Protection p, Specifier s, const QCString &t=QCString()) override
void writeDocumentationForInnerClasses(OutputList &ol) const override
bool isUsedOnly() const override
QCString m_requiresClause
C++20 requires clause.
Definition classdef.cpp:548
void addQualifiers(const StringVector &qualifiers) override
void setTypeConstraints(const ArgumentList &al) override
bool isInterface() const override
Returns TRUE if this class represents an interface.
void writeSimpleMemberDocumentation(OutputList &ol, MemberListType lt) const
int countMemberDeclarations(MemberListType lt, const ClassDef *inheritedFrom, MemberListType lt2, bool invert, bool showAlways, ClassDefSet &visitedClasses) const override
void writeInlineDocumentation(OutputList &ol) const override
Write class documentation inside another container (i.e.
int countMembersIncludingGrouped(MemberListType lt, const ClassDef *inheritedFrom, bool additional) const override
bool isLocal() const override
Returns TRUE if this is a local class definition, see EXTRACT_LOCAL_CLASSES.
const BaseClassList & baseClasses() const override
Returns the list of base classes from which this class directly inherits.
void writeCollaborationGraph(OutputList &ol) const
void writeDeclarationLink(OutputList &ol, bool &found, const QCString &header, bool localNames) const override
void setRequiresClause(const QCString &req) override
void writeAuthorSection(OutputList &ol) const
void writeDetailedDescription(OutputList &ol, const QCString &pageType, bool exampleFlag, const QCString &title, const QCString &anchor=QCString()) const
TemplateNameMap m_templBaseClassNames
Definition classdef.cpp:488
const ConstraintClassList & templateTypeConstraints() const override
const UsesClassList & usedImplementationClasses() const override
std::unique_ptr< IncludeInfo > m_incInfo
Definition classdef.cpp:426
ClassDef * categoryOf() const override
Returns the class of which this is a category (Objective-C only)
bool isReference() const override
bool isPublished() const override
Returns TRUE if this class is marked as published.
bool m_isJavaEnum
Does this class represent a Java style enum?
Definition classdef.cpp:541
void writeDeclaration(OutputList &ol, const MemberDef *md, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const override
void addGroupedInheritedMembers(OutputList &ol, MemberListType lt, const ClassDef *inheritedFrom, const QCString &inheritId) const override
bool isFortran() const override
Returns TRUE if this class is implemented in Fortran.
BaseClassList m_inherits
Definition classdef.cpp:431
void writeMemberPages(OutputList &ol) const override
MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap
Definition classdef.cpp:449
void makeTemplateArgument(bool b=TRUE) override
void endMemberDocumentation(OutputList &ol) const
void writeDocumentation(OutputList &ol) const override
void writeMoreLink(OutputList &ol, const QCString &anchor) const
void setModuleDef(ModuleDef *mod) override
const BaseClassList & subClasses() const override
Returns the list of sub classes that directly derive from this class.
std::unique_ptr< ClassDef > deepCopy(const QCString &name) const override
Definition classdef.cpp:859
bool isSimple() const override
ModuleDef * m_moduleDef
Definition classdef.cpp:446
void hideDerivedVariablesInPython(ClassDefMutable *cls)
void addUsedInterfaceClasses(MemberDef *md, const QCString &typeStr)
bool hasCollaborationGraph() const override
void writeInheritedMemberDeclarations(OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, MemberListType lt2, const QCString &title, const ClassDef *inheritedFrom, bool invert, bool showAlways) const
void writeQuickMemberLinks(OutputList &ol, const MemberDef *md) const override
bool containsOverload(const MemberDef *md) const override
void getTitleForMemberListType(MemberListType type, QCString &title, QCString &subtitle) const
bool isJavaEnum() const override
void setCompoundType(CompoundType t) override
void insertMember(MemberDef *) override
int countInheritedDecMembers(MemberListType lt, const ClassDef *inheritedFrom, bool invert, bool showAlways, ClassDefSet &visitedClasses) const
bool m_isSimple
Is this a simple (non-nested) C structure?
Definition classdef.cpp:533
const ClassDef * tagLessReference() const override
bool isForwardDeclared() const override
Returns TRUE if this class represents a forward declaration of a template class.
CLASS_GRAPH_t m_typeInheritanceGraph
Definition classdef.cpp:553
int countInheritanceNodes() const
void setTemplateBaseClassNames(const TemplateNameMap &templateNames) override
void findSectionsInDocumentation() override
bool isTemplate() const override
Returns TRUE if this class is a template.
int countInheritsNodes() const
void addMembersToTemplateInstance(const ClassDef *cd, const ArgumentList &templateArguments, const QCString &templSpec) override
void mergeMembersFromBaseClasses(bool mergeVirtualBaseClass)
const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const override
Returns a dictionary of all members.
bool m_isAbstract
Definition classdef.cpp:507
StringVector m_qualifiers
Definition classdef.cpp:550
FileDef * m_fileDef
Definition classdef.cpp:443
const ClassDef * templateMaster() const override
Returns the template master of which this class is an instance.
const TemplateNameMap & getTemplateBaseClassNames() const override
ClassDef::CompoundType m_compType
Definition classdef.cpp:464
bool m_hasCollaborationGraph
Definition classdef.cpp:552
bool isExtension() const override
Returns TRUE if this class represents an Objective-C 2.0 extension (nameless category)
void addTypeConstraint(const QCString &typeConstraint, const QCString &type)
void setIncludeFile(FileDef *fd, const QCString &incName, bool local, bool force) override
bool isAbstract() const override
Returns TRUE if there is at least one pure virtual member in this class.
QCString getOutputFileBase() const override
void setGroupDefForAllMembers(GroupDef *g, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs) override
const IncludeInfo * includeInfo() const override
void setCategoryOf(ClassDef *cd) override
QCString m_className
Definition classdef.cpp:494
void addUsedClass(ClassDef *cd, const QCString &accessName, Protection prot) override
void addTypeConstraints() override
void setClassName(const QCString &name) override
QCString title() const override
bool visibleInParentsDeclList() const override
show this class in the declaration section of its parent?
const MemberLists & getMemberLists() const override
Returns the list containing the list of members sorted per type.
void overrideCollaborationGraph(bool e) override
bool isSealed() const override
Returns TRUE if this class is marked as sealed.
ClassLinkedRefMap m_innerClasses
Definition classdef.cpp:475
UsesClassList m_usedByImplClassList
Definition classdef.cpp:479
bool isSliceLocal() const override
ConstraintClassList m_constraintClassList
Definition classdef.cpp:481
void setIsStatic(bool b) override
int countInheritedByNodes() const
QCString getMemberListFileName() const override
Definition classdef.cpp:981
void setFileDef(FileDef *fd) override
void insertBaseClass(ClassDef *, const QCString &name, Protection p, Specifier s, const QCString &t=QCString()) override
Definition classdef.cpp:992
bool m_isTemplArg
Definition classdef.cpp:518
DefType definitionType() const override
Definition classdef.cpp:192
CodeSymbolType codeSymbolType() const override
QCString collaborationGraphFileName() const override
returns the file name to use for the collaboration graph
bool m_usedOnly
Reason of existence is a "use" relation.
Definition classdef.cpp:527
bool isCSharp() const override
Returns TRUE if this class is implemented in C#.
void computeAnchors() override
void writeIncludeFiles(OutputList &ol) const
QCString m_metaData
Definition classdef.cpp:545
QCString anchor() const override
void addInnerCompound(Definition *d) override
void setSubGrouping(bool enabled) override
void mergeMembers() override
void writeSummaryLinks(OutputList &ol) const override
void writeMemberGroups(OutputList &ol, bool showInline=FALSE) const
int isBaseClass(const ClassDef *bcd, bool followInstances, const QCString &templSpec) const override
Returns TRUE iff bcd is a direct or indirect base class of this class.
QCString requiresClause() const override
void writeAdditionalInheritedMembers(OutputList &ol) const
void writeNestedClasses(OutputList &ol, const QCString &title) const
void removeMemberFromLists(MemberDef *md) override
QCString displayName(bool includeScope=TRUE) const override
Definition classdef.cpp:986
bool isVisibleInHierarchy() const override
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title, bool showInline=FALSE) const
QCString m_memberListFileName
Definition classdef.cpp:415
bool isLinkable() const override
bool m_implicitTemplateInstance
Definition classdef.cpp:555
bool hasDocumentation() const override
ModuleDef * getModuleDef() const override
Returns the C++20 module in which this compound's definition can be found.
ArgumentList m_tempArgs
Definition classdef.cpp:452
void internalInsertMember(MemberDef *md, Protection prot, bool addToAllList)
void startMemberDeclarations(OutputList &ol) const
bool m_subGrouping
Definition classdef.cpp:524
void writeDocumentationContents(OutputList &ol, const QCString &pageTitle) const
bool hasExamples() const override
StringVector getQualifiers() const override
const MemberDef * isSmartPointer() const override
void updateBaseClasses(const BaseClassList &bcd) override
Update the list of base classes to the one passed.
CLASS_GRAPH_t hasInheritanceGraph() const override
MemberList * getMemberList(MemberListType lt) const override
Returns the members in the list identified by lt.
void setUsedOnly(bool b) override
Protection protection() const override
Return the protection level (Public,Protected,Private) in which this compound was found.
const ArgumentList & typeConstraints() const override
void showUsedFiles(OutputList &ol) const
const Definition * findInnerCompound(const QCString &name) const override
ClassDef * insertTemplateInstance(const QCString &fileName, int startLine, int startColumn, const QCString &templSpec, bool &freshInstance) override
bool isEmbeddedInOuterScope() const override
void sortAllMembersList() override
CompoundType compoundType() const override
Returns the type of compound this is, i.e.
bool isAccessibleMember(const MemberDef *md) const override
returns TRUE iff md is a member of this class or of the the public/protected members of a base class
bool isImplicitTemplateInstance() const override
bool hasNonReferenceSuperClass() const override
void setTemplateMaster(const ClassDef *tm) override
QCString inheritanceGraphFileName() const override
returns the file name to use for the inheritance graph
void startMemberDocumentation(OutputList &ol) const
QCString getSourceFileBase() const override
void setProtection(Protection p) override
bool hasDetailedDescription() const override
returns TRUE if this class has a non-empty detailed description
virtual void setGroupDefForAllMembers(GroupDef *g, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs)=0
virtual void setTemplateArguments(const ArgumentList &al)=0
virtual void setTemplateMaster(const ClassDef *tm)=0
virtual void setImplicitTemplateInstance(bool b)=0
virtual void addMemberToTemplateInstance(const MemberDef *md, const ArgumentList &templateArguments, const QCString &templSpec)=0
virtual void insertUsedFile(const FileDef *)=0
virtual void setUsedOnly(bool b)=0
virtual void setCategoryOf(ClassDef *cd)=0
virtual void addMembersToTemplateInstance(const ClassDef *cd, const ArgumentList &templateArguments, const QCString &templSpec)=0
virtual void mergeMembers()=0
Class representing a built-in class diagram.
Definition diagram.h:31
const QCString & name() const override
const Definition * getAlias() const
const Definition * getScope() const
DefinitionAliasMixin(const Definition *scope, const Definition *alias)
The common base class of all entity definitions found in the sources.
Definition definition.h:76
virtual QCString docFile() const =0
virtual const QCString & localName() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual QCString getDefFileName() const =0
virtual bool isLinkable() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual int inbodyLine() const =0
virtual int briefLine() const =0
virtual bool hasDocumentation() const =0
virtual bool isLinkableInProject() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual bool isAnonymous() const =0
virtual bool isHidden() const =0
virtual const Definition * findInnerCompound(const QCString &name) const =0
virtual QCString getReference() const =0
virtual QCString getSourceFileBase() const =0
virtual QCString documentation() const =0
virtual QCString qualifiedName() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual bool isArtificial() const =0
virtual QCString briefFile() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual bool isReference() const =0
virtual QCString inbodyDocumentation() const =0
virtual QCString inbodyFile() const =0
virtual const QCString & name() const =0
bool isReference() const override
const QCString & name() const override
void writeSourceDef(OutputList &ol) const override
QCString inbodyFile() const override
QCString getDefFileName() const override
void writeNavigationPath(OutputList &ol) const override
bool hasBriefDescription() const override
QCString docFile() const override
QCString briefFile() const override
QCString qualifiedName() const override
QCString id() const override
void setOuterScope(Definition *def) override
void setReference(const QCString &r) override
QCString getSourceFileBase() const override
const RefItemVector & xrefListItems() const override
QCString briefDescription(bool abbreviate=FALSE) const override
Definition * getOuterScope() const override
QCString getReference() const override
DefinitionMixin(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
const QCString & localName() const override
const GroupList & partOfGroups() const override
const FileDef * getBodyDef() const override
int getStartBodyLine() const override
QCString inbodyDocumentation() const override
QCString documentation() const override
void writeDocAnchorsToTagFile(TextStream &fs) const override
bool hasDocumentation() const override
SrcLangExt getLanguage() const override
virtual void setHidden(bool b)=0
virtual void addInnerCompound(Definition *d)=0
virtual void setLanguage(SrcLangExt lang)=0
virtual void setOuterScope(Definition *d)=0
virtual void setArtificial(bool b)=0
Representation of a class inheritance or dependency graph.
bool isTooBig() const
bool isTrivial() const
int numNodes() const
static bool suppressDocWarnings
Definition doxygen.h:132
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:96
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
static ClassLinkedMap * hiddenClassLinkedMap
Definition doxygen.h:97
static bool generatingXmlOutput
Definition doxygen.h:136
static MemberNameLinkedMap * memberNameLinkedMap
Definition doxygen.h:111
A model of a file symbol.
Definition filedef.h:99
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
bool exists() const
Definition fileinfo.cpp:30
std::string absFilePath() const
Definition fileinfo.cpp:101
A model of a group of symbols.
Definition groupdef.h:52
virtual bool addClass(ClassDef *def)=0
virtual bool insertMember(MemberDef *def, bool docOnly=FALSE)=0
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1435
bool del(const QCString &key)
Definition linkedmap.h:183
T * add(const char *k, Args &&... args)
Definition linkedmap.h:90
const T * find(const std::string &key) const
Definition linkedmap.h:47
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual QCString typeString() const =0
virtual bool isSignal() const =0
virtual bool isDestructor() const =0
virtual bool isExplicit() const =0
virtual bool isObjCMethod() const =0
virtual bool isMaybeVoid() const =0
virtual bool isConstructor() const =0
virtual bool isFriend() const =0
virtual bool isRelated() const =0
virtual const ClassDef * getClassDef() const =0
virtual bool isOverride() const =0
virtual bool isTypedef() const =0
virtual ClassDef * category() const =0
virtual bool isSlot() const =0
virtual const FileDef * getFileDef() const =0
virtual bool isInline() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isMaybeAmbiguous() const =0
virtual VhdlSpecifier getVhdlSpecifiers() const =0
virtual bool isFunction() const =0
virtual bool isAttribute() const =0
virtual int getMemberGroupId() const =0
virtual bool isStatic() const =0
virtual bool isMaybeDefault() const =0
virtual bool isRemovable() const =0
virtual bool isConstrained() const =0
virtual bool isReadonly() const =0
virtual bool isBound() const =0
virtual ClassDef * getClassDefOfAnonymousType() const =0
virtual std::unique_ptr< MemberDef > createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs) const =0
virtual bool isTransient() const =0
virtual Protection protection() const =0
virtual TypeSpecifier getMemberSpecifiers() const =0
virtual bool isOptional() const =0
virtual bool isEnumerate() const =0
virtual MemberType memberType() const =0
virtual std::unique_ptr< MemberDef > deepCopy() const =0
virtual QCString memberTypeName() const =0
virtual bool isVariable() const =0
virtual QCString argsString() const =0
virtual Specifier virtualness(int count=0) const =0
virtual bool isUNOProperty() const =0
virtual bool isFinal() const =0
virtual bool isMutable() const =0
virtual bool isEnumValue() const =0
virtual void setMemberType(MemberType t)=0
virtual void setSectionList(const Definition *container, const MemberList *sl)=0
virtual void setCategory(ClassDef *)=0
virtual void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr)=0
virtual void setCategoryRelation(const MemberDef *)=0
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:109
void writeDeclarations(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const QCString &title, const QCString &subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt=MemberListType::PubMethods(), bool showSectionTitle=true) const
Writes the list of members to the output.
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
void writePlainDeclarations(OutputList &ol, bool inGroup, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const
void setAnonymousEnumType()
int countInheritableMembers(const ClassDef *inheritedFrom) const
void writeSimpleDocumentation(OutputList &ol, const Definition *container) const
MemberListType listType() const
Definition memberlist.h:114
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, bool showEnumValues=FALSE, bool showInline=FALSE) const
int numDecMembers(const ClassDef *inheritedFrom) const
Definition memberlist.h:117
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:184
static MemberListType Invalid()
Definition types.h:209
constexpr const char * toLabel() const
Definition types.h:240
constexpr bool isInvalid() const
Definition types.h:210
void push_back(Ptr &&p)
Definition membername.h:54
bool empty() const
Definition membername.h:135
void push_back(Ptr &&p)
Definition membername.h:141
iterator begin()
Definition membername.h:131
iterator end()
Definition membername.h:132
typename Vec::iterator iterator
Definition membername.h:125
iterator erase(iterator pos)
Definition membername.h:142
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:314
void endTextBlock(bool paraBreak=FALSE)
Definition outputlist.h:671
void endIndent()
Definition outputlist.h:585
void writeString(const QCString &text)
Definition outputlist.h:412
void startGroupHeader(int extraLevels=0)
Definition outputlist.h:454
void startMemberDeclaration()
Definition outputlist.h:570
void startMemberDoc(const QCString &clName, const QCString &memName, const QCString &anchor, const QCString &title, int memCount, int memTotal, bool showInline)
Definition outputlist.h:532
void startMemberDocName(bool align)
Definition outputlist.h:679
void startClassDiagram()
Definition outputlist.h:595
void startItemList()
Definition outputlist.h:430
void disable(OutputType o)
void endMemberDocName()
Definition outputlist.h:681
void endMemberDoc(bool hasArgs)
Definition outputlist.h:536
void writeRuler()
Definition outputlist.h:522
void enable(OutputType o)
void endContents()
Definition outputlist.h:619
void endMemberDescription()
Definition outputlist.h:568
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:440
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md)
Definition outputlist.h:384
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition outputlist.h:566
void endCompoundTemplateParams()
Definition outputlist.h:504
void docify(const QCString &s)
Definition outputlist.h:438
void startIndent()
Definition outputlist.h:583
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:408
void endDescForItem()
Definition outputlist.h:550
void startTextBlock(bool dense=FALSE)
Definition outputlist.h:669
void endExamples()
Definition outputlist.h:581
void endParagraph()
Definition outputlist.h:410
void addIndexItem(const QCString &s1, const QCString &s2)
Definition outputlist.h:591
void startExamples()
Definition outputlist.h:579
void startMemberSections()
Definition outputlist.h:462
void startMemberList()
Definition outputlist.h:482
void endTextLink()
Definition outputlist.h:445
void startItemListItem()
Definition outputlist.h:458
void endItemListItem()
Definition outputlist.h:460
void startBold()
Definition outputlist.h:562
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:496
void writeSynopsis()
Definition outputlist.h:593
void startTypewriter()
Definition outputlist.h:450
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
void pushGeneratorState()
void insertMemberAlign(bool templ=FALSE)
Definition outputlist.h:518
void startDescForItem()
Definition outputlist.h:548
void disableAllBut(OutputType o)
void popGeneratorState()
void writeSummaryLink(const QCString &file, const QCString &anchor, const QCString &title, bool first)
Definition outputlist.h:615
void writeAnchor(const QCString &fileName, const QCString &name)
Definition outputlist.h:524
void endBold()
Definition outputlist.h:564
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:456
void endClassDiagram(const ClassDiagram &d, const QCString &f, const QCString &n)
Definition outputlist.h:597
void endLabels()
Definition outputlist.h:741
void endQuickIndices()
Definition outputlist.h:605
void endDotGraph(DotClassGraph &g)
Definition outputlist.h:649
void endItemList()
Definition outputlist.h:432
void startDotGraph()
Definition outputlist.h:647
void writeLabel(const QCString &l, bool isLast)
Definition outputlist.h:739
void startLabels()
Definition outputlist.h:737
void startContents()
Definition outputlist.h:617
void startCompoundTemplateParams()
Definition outputlist.h:502
void endMemberDeclaration(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:572
void enableAll()
void endMemberHeader()
Definition outputlist.h:472
void startMemberItem(const QCString &anchor, OutputGenerator::MemberItemType type, const QCString &id=QCString())
Definition outputlist.h:494
void endTypewriter()
Definition outputlist.h:452
void lineBreak(const QCString &style=QCString())
Definition outputlist.h:560
void parseText(const QCString &textStr)
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:443
void startMemberHeader(const QCString &anchor, int typ=2)
Definition outputlist.h:470
void endMemberSections()
Definition outputlist.h:464
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:407
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
bool startsWith(const char *s) const
Definition qcstring.h:492
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
QCString lower() const
Definition qcstring.h:234
bool endsWith(const char *s) const
Definition qcstring.h:509
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
QCString right(size_t len) const
Definition qcstring.h:219
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159
QCString left(size_t len) const
Definition qcstring.h:214
void clear()
Definition qcstring.h:169
ClassDefMutable * resolveClassMutable(const Definition *scope, const QCString &name, bool mayBeUnlinkable=false, bool mayBeHidden=false)
Wrapper around resolveClass that returns a mutable interface to the class object or a nullptr if the ...
Implements TextGeneratorIntf for an OutputDocInterface stream.
Definition util.h:77
Text streaming class that buffers data.
Definition textstream.h:36
Wrapper class for a number of boolean properties.
Definition types.h:492
@ ARCHITECTURECLASS
Definition vhdldocgen.h:77
static QCString getClassName(const ClassDef *)
static QCString getProtectionName(int prot)
static void writeInlineClassLink(const ClassDef *, OutputList &ol)
static void writeVhdlDeclarations(const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)
static VhdlClasses convert(Protection prot)
Definition vhdldocgen.h:80
static QCString getClassTitle(const ClassDef *)
static QCString makeQualifiedNameWithTemplateParameters(const ClassDef *cd, const ArgumentLists *actualParams, uint32_t *actualParamIndex)
Definition classdef.cpp:56
static QCString getCompoundTypeString(SrcLangExt lang, ClassDef::CompoundType compType, bool isJavaEnum)
Definition classdef.cpp:146
ClassDefMutable * toClassDefMutable(Definition *d)
static bool hasNonReferenceSuperClassRec(const ClassDef *cd, int level)
static QCString makeDisplayName(const ClassDef *cd, bool includeScope)
Definition classdef.cpp:107
int minClassDistance(const ClassDef *cd, const ClassDef *bcd, int level)
static bool isStandardFunc(const MemberDef *md)
ClassDef * getClass(const QCString &n)
std::unique_ptr< ClassDef > createClassDefAlias(const Definition *newScope, const ClassDef *cd)
Definition classdef.cpp:785
static void writeInheritanceSpecifier(OutputList &ol, const BaseClassDef &bcd)
bool classHasVisibleRoot(const BaseClassList &bcl)
std::unique_ptr< ClassDef > createClassDef(const QCString &fileName, int startLine, int startColumn, const QCString &name, ClassDef::CompoundType ct, const QCString &ref, const QCString &fName, bool isSymbol, bool isJavaEnum)
Factory method to create a new ClassDef object.
Definition classdef.cpp:558
static void searchTemplateSpecs(const Definition *d, ArgumentLists &result, QCString &name, SrcLangExt lang)
bool classVisibleInIndex(const ClassDef *cd)
ClassDef * toClassDef(Definition *d)
Protection classInheritedProtectionLevel(const ClassDef *cd, const ClassDef *bcd, Protection prot, int level)
bool classHasVisibleChildren(const ClassDef *cd)
std::vector< BaseClassDef > BaseClassList
Definition classdef.h:81
std::unordered_set< const ClassDef * > ClassDefSet
Definition classdef.h:95
std::map< std::string, int > TemplateNameMap
Definition classdef.h:93
std::vector< TemplateInstanceDef > TemplateInstanceList
Definition classdef.h:91
#define Config_getInt(name)
Definition config.h:34
#define Config_getList(name)
Definition config.h:38
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
#define Config_getEnum(name)
Definition config.h:35
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
std::set< std::string > StringSet
Definition containers.h:31
std::vector< std::string > StringVector
Definition containers.h:33
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=nullptr)
Definition defargs.l:814
Definition * toDefinition(DefinitionMutable *dm)
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:47
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:54
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
@ Collaboration
Definition dotgraph.h:31
@ Inheritance
Definition dotgraph.h:31
static bool isSpecialization(const ArgumentLists &srcTempArgLists, const ArgumentLists &dstTempArgLists)
Definition doxygen.cpp:5920
static void writeTagFile()
QCString includeClose(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:86
QCString includeStatement(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:56
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1894
QCString includeOpen(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:73
@ IncludeLocal
Definition filedef.h:50
@ IncludeSystem
Definition filedef.h:49
void startTitle(OutputList &ol, const QCString &fileName, const DefinitionMutable *def)
Definition index.cpp:386
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const QCString &navPath)
Definition index.cpp:421
void endTitle(OutputList &ol, const QCString &fileName, const QCString &name)
Definition index.cpp:395
void startFile(OutputList &ol, const QCString &name, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel)
Definition index.cpp:402
void endFileWithNavPath(OutputList &ol, const Definition *d)
Definition index.cpp:441
HighlightedItem
Definition index.h:59
@ InterfaceVisible
Definition index.h:89
@ ExceptionVisible
Definition index.h:91
Translator * theTranslator
Definition language.cpp:71
MemberDefMutable * toMemberDefMutable(Definition *d)
void combineDeclarationAndDefinition(MemberDefMutable *mdec, MemberDefMutable *mdef)
#define warn_uncond(fmt,...)
Definition message.h:122
#define warn(file, line, fmt,...)
Definition message.h:97
#define msg(fmt,...)
Definition message.h:94
#define err(fmt,...)
Definition message.h:127
ModuleDef * toModuleDef(Definition *d)
int qstricmp(const char *s1, const char *s2)
Definition qcstring.cpp:442
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
std::vector< RefItem * > RefItemVector
Definition reflist.h:133
Web server based search engine.
This class contains the information about the argument of a function or template.
Definition arguments.h:27
QCString type
Definition arguments.h:37
QCString name
Definition arguments.h:39
QCString defval
Definition arguments.h:41
Class that contains information about an inheritance relation.
Definition classdef.h:55
ClassDef * classDef
Class definition that this relation inherits from.
Definition classdef.h:60
QCString templSpecifiers
Template arguments used for the base class.
Definition classdef.h:78
Specifier virt
Virtualness of the inheritance relation: Normal, or Virtual.
Definition classdef.h:75
Protection prot
Protection level of the inheritance relation: Public, Protected, or Private.
Definition classdef.h:70
Data associated with an example.
Definition example.h:29
GroupPri_t
Grouping priority.
Definition types.h:68
Class representing the data associated with a #include statement.
Definition filedef.h:75
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:112
QCString title(SrcLangExt lang) const
Definition layout.cpp:1786
MemberListType type
Definition layout.h:118
QCString subtitle(SrcLangExt lang) const
Definition layout.cpp:1791
Represents of a member definition list with configurable title.
Definition layout.h:132
MemberListType type
Definition layout.h:137
QCString title(SrcLangExt lang) const
Definition layout.cpp:1798
Definition layout.h:102
QCString title(SrcLangExt lang) const
Definition layout.cpp:1779
This file contains a number of basic enums and types.
CodeSymbolType
Definition types.h:319
MemberType
Definition types.h:390
@ Enumeration
Definition types.h:395
@ EnumValue
Definition types.h:396
@ Interface
Definition types.h:403
@ Variable
Definition types.h:393
@ Property
Definition types.h:401
@ Typedef
Definition types.h:394
@ Function
Definition types.h:392
@ Service
Definition types.h:404
Protection
Protection level of members.
Definition types.h:26
@ Package
Definition types.h:26
@ Public
Definition types.h:26
@ Private
Definition types.h:26
@ Protected
Definition types.h:26
SrcLangExt
Language as given by extension.
Definition types.h:42
@ CSharp
Definition types.h:46
@ Fortran
Definition types.h:53
@ Python
Definition types.h:52
@ Slice
Definition types.h:59
Specifier
Virtualness of a member.
Definition types.h:29
@ Virtual
Definition types.h:29
@ Normal
Definition types.h:29
@ Pure
Definition types.h:29
QCString removeRedundantWhiteSpace(const QCString &s)
Definition util.cpp:578
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5645
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition util.cpp:4186
bool protectionLevelVisible(Protection prot)
Definition util.cpp:6366
const int maxInheritanceDepth
Definition util.cpp:156
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4403
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
Definition util.cpp:5851
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1219
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
Definition util.cpp:5242
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:5329
bool found
Definition util.cpp:984
QCString demangleCSharpGenericName(const QCString &name, const QCString &templArgs)
Definition util.cpp:7347
QCString removeAnonymousScopes(const QCString &str)
Definition util.cpp:172
void createSubDirs(const Dir &d)
Definition util.cpp:4080
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:1931
QCString stripScope(const QCString &name)
Definition util.cpp:4219
QCString stripExtension(const QCString &fName)
Definition util.cpp:5361
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:309
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3944
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4352
EntryType guessSection(const QCString &name)
Definition util.cpp:349
void convertProtectionLevel(MemberListType inListType, Protection inProt, MemberListType *outListType1, MemberListType *outListType2)
Computes for a given list type inListType, which are the the corresponding list type(s) in the base c...
Definition util.cpp:6653
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:6326
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:1103
void linkifyText(const TextGeneratorIntf &out, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
Definition util.cpp:904
QCString convertToId(const QCString &s)
Definition util.cpp:4312
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:1127
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5339
A bunch of utility functions.