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 addRequirementReferences() override;
316 void addTypeConstraints() override;
317 void computeAnchors() override;
318 void mergeMembers() override;
319 void sortMemberLists() override;
321 void writeDocumentation(OutputList &ol) const override;
322 void writeDocumentationForInnerClasses(OutputList &ol) const override;
323 void writeMemberPages(OutputList &ol) const override;
324 void writeMemberList(OutputList &ol) const override;
325 void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,int indentLevel,
326 const ClassDef *inheritedFrom,const QCString &inheritId) const override;
327 void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const override;
328 void writePageNavigation(OutputList &ol) const override;
329 void writeSummaryLinks(OutputList &ol) const override;
330 void reclassifyMember(MemberDefMutable *md,MemberType t) override;
331 void writeInlineDocumentation(OutputList &ol) const override;
332 void writeDeclarationLink(OutputList &ol,bool &found,
333 const QCString &header,bool localNames) const override;
334 void removeMemberFromLists(MemberDef *md) override;
335 void setAnonymousEnumType() override;
336 void countMembers() override;
337 void sortAllMembersList() override;
338
340 const ClassDef *inheritedFrom,const QCString &inheritId) const override;
341 void writeTagFile(TextStream &) const override;
342
343 int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const override;
344 int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom,
345 MemberListType lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const override;
346 void writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
347 MemberListType lt,const QCString &title,
348 const QCString &subTitle=QCString(),
349 bool showInline=FALSE,const ClassDef *inheritedFrom=nullptr,
350 MemberListType lt2=MemberListType::Invalid(),bool invert=FALSE,bool showAlways=FALSE) const override;
351 void setRequiresClause(const QCString &req) override;
352 void setPrimaryConstructorParams(const ArgumentList &list) override;
353
354 // inheritance graph related members
355 CLASS_GRAPH_t hasInheritanceGraph() const override;
356 void overrideInheritanceGraph(CLASS_GRAPH_t e) override;
357
358 // collaboration graph related members
359 bool hasCollaborationGraph() const override;
360 void overrideCollaborationGraph(bool e) override;
361 private:
362 int countInheritedByNodes() const;
363 int countInheritsNodes() const;
364 int countInheritanceNodes() const;
366 void showUsedFiles(OutputList &ol) const;
367
368 void writeDocumentationContents(OutputList &ol,const QCString &pageTitle) const;
369 void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList);
370 void addMemberToList(MemberListType lt,MemberDef *md,bool isBrief);
373 const ClassDef *inheritedFrom,bool invert,
374 bool showAlways) const;
375 void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline=FALSE) const;
378 int indentLevel,const ClassDef *inheritedFrom,const QCString &inheritId) const;
379 void writeBriefDescription(OutputList &ol,bool exampleFlag) const;
380 void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag,
381 const QCString &title,const QCString &anchor=QCString()) const;
382 void writeIncludeFiles(OutputList &ol) const;
384 void writeInheritanceGraph(OutputList &ol) const;
385 void writeCollaborationGraph(OutputList &ol) const;
386 void writeMemberGroups(OutputList &ol,bool showInline=FALSE) const;
387 void writeNestedClasses(OutputList &ol,const QCString &title) const;
388 void writeInlineClasses(OutputList &ol) const;
389 void startMemberDeclarations(OutputList &ol) const;
390 void endMemberDeclarations(OutputList &ol) const;
391 void startMemberDocumentation(OutputList &ol) const;
392 void endMemberDocumentation(OutputList &ol) const;
393 void writeAuthorSection(OutputList &ol) const;
394 void writeMoreLink(OutputList &ol,const QCString &anchor) const;
396
399 void addClassAttributes(OutputList &ol) const;
401 const ClassDef *inheritedFrom,bool invert,bool showAlways,
402 ClassDefSet &visitedClasses) const;
404 QCString &title,QCString &subtitle) const;
405 void addTypeConstraint(const QCString &typeConstraint,const QCString &type);
406 void writeTemplateSpec(OutputList &ol,const Definition *d,
407 const QCString &type,SrcLangExt lang) const;
408 void mergeMembersFromBaseClasses(bool mergeVirtualBaseClass);
410 private:
411 /*! file name that forms the base for the output file containing the
412 * class documentation. For compatibility with Qt (e.g. links via tag
413 * files) this name cannot be derived from the class name directly.
414 */
416
417 /*! file name used for the list of all members */
419
420 /*! file name used for the collaboration diagram */
422
423 /*! file name used for the inheritance graph */
425
426 /*! Include information about the header file should be included
427 * in the documentation. 0 by default, set by setIncludeFile().
428 */
429 std::unique_ptr<IncludeInfo> m_incInfo;
430
431 /*! List of base class (or super-classes) from which this class derives
432 * directly.
433 */
435
436 /*! List of sub-classes that directly derive from this class
437 */
439
440 /*! Namespace this class is part of
441 * (this is the inner most namespace in case of nested namespaces)
442 */
443 //NamespaceDef *m_nspace = nullptr;
444
445 /*! File this class is defined in */
446 FileDef *m_fileDef = nullptr;
447
448 /*! Module this class is defined in */
450
451 /*! List of all members (including inherited members) */
453
454 /*! Template arguments of this class */
456
457 /*! Type constraints for template parameters */
459
460 /*! Files that were used for generating the class documentation. */
462
463 /*! Examples that use this class */
465
466 /*! Holds the kind of "class" this is. */
468
469 /*! The protection level in which this class was found.
470 * Typically Public, but for nested classes this can also be Protected
471 * or Private.
472 */
474
475 /*! The inner classes contained in this class. Will be 0 if there are
476 * no inner classes.
477 */
479
480 /* classes for the collaboration diagram */
483
485
486 /*! Template instances that exists of this class, the key in the
487 * dictionary is the template argument list.
488 */
490
492
493 /*! The class this class is an instance of. */
494 const ClassDef *m_templateMaster = nullptr;
495
496 /*! local class name which could be a typedef'ed alias name. */
498
499 /*! If this class is a Objective-C category, then this points to the
500 * class which is extended.
501 */
503
505
506 /* user defined member groups */
508
509 /*! Is this an abstract class? */
510 bool m_isAbstract = false;
511
512 /*! Is the class part of an unnamed namespace? */
513 bool m_isStatic = false;
514
515 /*! TRUE if classes members are merged with those of the base classes. */
516 bool m_membersMerged = false;
517
518 /*! TRUE if the class is defined in a source file rather than a header file. */
519 bool m_isLocal = false;
520
521 bool m_isTemplArg = false;
522
523 /*! Does this class group its user-grouped members
524 * as a sub-section of the normal (public/protected/..)
525 * groups?
526 */
527 bool m_subGrouping = false;
528
529 /** Reason of existence is a "use" relation */
530 bool m_usedOnly = false;
531
532 /** List of titles to use for the summary */
534
535 /** Is this a simple (non-nested) C structure? */
536 bool m_isSimple = false;
537
538 /** Does this class overloaded the -> operator? */
539 const MemberDef *m_arrowOperator = nullptr;
540
541 const ClassDef *m_tagLessRef = nullptr;
542
543 /** Does this class represent a Java style enum? */
544 bool m_isJavaEnum = false;
545
547
549
550 /** C++20 requires clause */
552
554
556 CLASS_GRAPH_t m_typeInheritanceGraph = CLASS_GRAPH_t::NO;
557
559
561};
562
563std::unique_ptr<ClassDef> createClassDef(
564 const QCString &fileName,int startLine,int startColumn,
565 const QCString &name,ClassDef::CompoundType ct,
566 const QCString &ref,const QCString &fName,
567 bool isSymbol,bool isJavaEnum)
568{
569 return std::make_unique<ClassDefImpl>(fileName,startLine,startColumn,name,ct,ref,fName,isSymbol,isJavaEnum);
570}
571//-----------------------------------------------------------------------------
572
574{
575 public:
576 ClassDefAliasImpl(const Definition *newScope,const ClassDef *cd)
577 : DefinitionAliasMixin(newScope,cd) { init(); }
578 ~ClassDefAliasImpl() override { deinit(); }
580
581 DefType definitionType() const override { return TypeClass; }
582
583 const ClassDef *getCdAlias() const { return toClassDef(getAlias()); }
584 std::unique_ptr<ClassDef> deepCopy(const QCString &name) const override {
586 }
587 void moveTo(Definition *) override {}
588
590 { return getCdAlias()->codeSymbolType(); }
592 { return getCdAlias()->getOutputFileBase(); }
596 { return getCdAlias()->getSourceFileBase(); }
597 QCString getReference() const override
598 { return getCdAlias()->getReference(); }
599 bool isReference() const override
600 { return getCdAlias()->isReference(); }
601 bool isLocal() const override
602 { return getCdAlias()->isLocal(); }
604 { return getCdAlias()->getClasses(); }
605 bool hasDocumentation() const override
606 { return getCdAlias()->hasDocumentation(); }
607 bool hasDetailedDescription() const override
608 { return getCdAlias()->hasDetailedDescription(); }
613 QCString displayName(bool includeScope=TRUE) const override
614 { return makeDisplayName(this,includeScope); }
615 CompoundType compoundType() const override
616 { return getCdAlias()->compoundType(); }
618 { return getCdAlias()->compoundTypeString(); }
619 const BaseClassList &baseClasses() const override
620 { return getCdAlias()->baseClasses(); }
621 const BaseClassList &subClasses() const override
622 { return getCdAlias()->subClasses(); }
625 Protection protection() const override
626 { return getCdAlias()->protection(); }
627 bool isLinkableInProject() const override
628 { return getCdAlias()->isLinkableInProject(); }
629 bool isLinkable() const override
630 { return getCdAlias()->isLinkable(); }
631 bool isVisibleInHierarchy() const override
632 { return getCdAlias()->isVisibleInHierarchy(); }
633 bool visibleInParentsDeclList() const override
634 { return getCdAlias()->visibleInParentsDeclList(); }
635 const ArgumentList &templateArguments() const override
636 { return getCdAlias()->templateArguments(); }
637 FileDef *getFileDef() const override
638 { return getCdAlias()->getFileDef(); }
639 ModuleDef *getModuleDef() const override
640 { return getCdAlias()->getModuleDef(); }
641 const MemberDef *getMemberByName(const QCString &s) const override
642 { return getCdAlias()->getMemberByName(s); }
643 int isBaseClass(const ClassDef *bcd,bool followInstances,const QCString &templSpec) const override
644 { return getCdAlias()->isBaseClass(bcd,followInstances,templSpec); }
645 bool isSubClass(ClassDef *bcd,int level=0) const override
646 { return getCdAlias()->isSubClass(bcd,level); }
647 bool isAccessibleMember(const MemberDef *md) const override
648 { return getCdAlias()->isAccessibleMember(md); }
650 { return getCdAlias()->getTemplateInstances(); }
651 const ClassDef *templateMaster() const override
652 { return getCdAlias()->templateMaster(); }
653 bool isTemplate() const override
654 { return getCdAlias()->isTemplate(); }
655 const IncludeInfo *includeInfo() const override
656 { return getCdAlias()->includeInfo(); }
663 bool isTemplateArgument() const override
664 { return getCdAlias()->isTemplateArgument(); }
665 const Definition *findInnerCompound(const QCString &name) const override
666 { return getCdAlias()->findInnerCompound(name); }
670 const ArgumentLists *actualParams=nullptr,uint32_t *actualParamIndex=nullptr) const override
671 { return makeQualifiedNameWithTemplateParameters(this,actualParams,actualParamIndex); }
672 bool isAbstract() const override
673 { return getCdAlias()->isAbstract(); }
674 bool isObjectiveC() const override
675 { return getCdAlias()->isObjectiveC(); }
676 bool isFortran() const override
677 { return getCdAlias()->isFortran(); }
678 bool isCSharp() const override
679 { return getCdAlias()->isCSharp(); }
680 bool isFinal() const override
681 { return getCdAlias()->isFinal(); }
682 bool isSealed() const override
683 { return getCdAlias()->isSealed(); }
684 bool isPublished() const override
685 { return getCdAlias()->isPublished(); }
686 bool isExtension() const override
687 { return getCdAlias()->isExtension(); }
688 bool isForwardDeclared() const override
689 { return getCdAlias()->isForwardDeclared(); }
690 bool isInterface() const override
691 { return getCdAlias()->isInterface(); }
692 ClassDef *categoryOf() const override
693 { return getCdAlias()->categoryOf(); }
694 QCString className() const override
695 { return getCdAlias()->className(); }
697 { return getCdAlias()->getMemberList(lt); }
698 const MemberLists &getMemberLists() const override
699 { return getCdAlias()->getMemberLists(); }
700 const MemberGroupList &getMemberGroups() const override
701 { return getCdAlias()->getMemberGroups(); }
704 bool isUsedOnly() const override
705 { return getCdAlias()->isUsedOnly(); }
706 QCString anchor() const override
707 { return getCdAlias()->anchor(); }
708 bool isEmbeddedInOuterScope() const override
709 { return getCdAlias()->isEmbeddedInOuterScope(); }
710 bool isSimple() const override
711 { return getCdAlias()->isSimple(); }
712 const ClassDef *tagLessReference() const override
713 { return getCdAlias()->tagLessReference(); }
714 const MemberDef *isSmartPointer() const override
715 { return getCdAlias()->isSmartPointer(); }
716 bool isJavaEnum() const override
717 { return getCdAlias()->isJavaEnum(); }
718 QCString title() const override
719 { return getCdAlias()->title(); }
721 { return getCdAlias()->generatedFromFiles(); }
722 const FileList &usedFiles() const override
723 { return getCdAlias()->usedFiles(); }
724 const ArgumentList &typeConstraints() const override
725 { return getCdAlias()->typeConstraints(); }
726 const ExampleList &getExamples() const override
727 { return getCdAlias()->getExamples(); }
728 bool hasExamples() const override
729 { return getCdAlias()->hasExamples(); }
731 { return getCdAlias()->getMemberListFileName(); }
732 bool subGrouping() const override
733 { return getCdAlias()->subGrouping(); }
734 bool isSliceLocal() const override
735 { return getCdAlias()->isSliceLocal(); }
736 bool hasNonReferenceSuperClass() const override
738 QCString requiresClause() const override
739 { return getCdAlias()->requiresClause(); }
741 { return getCdAlias()->getQualifiers(); }
742 bool containsOverload(const MemberDef *md) const override
743 { return getCdAlias()->containsOverload(md); }
744
745 int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const override
746 { return getCdAlias()->countMembersIncludingGrouped(lt,inheritedFrom,additional); }
748 MemberListType lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const override
749 { return getCdAlias()->countMemberDeclarations(lt,inheritedFrom,lt2,invert,showAlways,visitedClasses); }
750
751 void writeDeclarationLink(OutputList &ol,bool &found,
752 const QCString &header,bool localNames) const override
753 { getCdAlias()->writeDeclarationLink(ol,found,header,localNames); }
754 bool isImplicitTemplateInstance() const override
756
757 void writeDocumentation(OutputList &ol) const override
761 void writeMemberPages(OutputList &ol) const override
762 { getCdAlias()->writeMemberPages(ol); }
763 void writeMemberList(OutputList &ol) const override
764 { getCdAlias()->writeMemberList(ol); }
765 void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,
766 int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId) const override
767 { getCdAlias()->writeDeclaration(ol,md,inGroup,indentLevel,inheritedFrom,inheritId); }
768 void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const override
769 { getCdAlias()->writeQuickMemberLinks(ol,md); }
770 void writeSummaryLinks(OutputList &ol) const override
771 { getCdAlias()->writeSummaryLinks(ol); }
772 void writePageNavigation(OutputList &ol) const override
776 void writeTagFile(TextStream &ol) const override
777 { getCdAlias()->writeTagFile(ol); }
779 MemberListType lt,const QCString &title,
780 const QCString &subTitle=QCString(),
781 bool showInline=FALSE,const ClassDef *inheritedFrom=nullptr,
782 MemberListType lt2=MemberListType::Invalid(),bool invert=FALSE,bool showAlways=FALSE) const override
783 { getCdAlias()->writeMemberDeclarations(ol,visitedClasses,lt,title,subTitle,showInline,inheritedFrom,lt2,invert,showAlways); }
785 const ClassDef *inheritedFrom,const QCString &inheritId) const override
786 { getCdAlias()->addGroupedInheritedMembers(ol,lt,inheritedFrom,inheritId); }
787
788 void updateBaseClasses(const BaseClassList &) override {}
789 void updateSubClasses(const BaseClassList &) override {}
790};
791
792std::unique_ptr<ClassDef> createClassDefAlias(const Definition *newScope,const ClassDef *cd)
793{
794 auto acd = std::make_unique<ClassDefAliasImpl>(newScope,cd);
795 //printf("cd name=%s localName=%s qualifiedName=%s qualifiedNameWith=%s displayName()=%s\n",
796 // qPrint(acd->name()),qPrint(acd->localName()),qPrint(acd->qualifiedName()),
797 // qPrint(acd->qualifiedNameWithTemplateParameters()),qPrint(acd->displayName()));
798 return acd;
799}
800
801//-----------------------------------------------------------------------------
802
803// constructs a new class definition
805 const QCString &defFileName,int defLine,int defColumn,
806 const QCString &nm,CompoundType ct,
807 const QCString &lref,const QCString &fName,
808 bool isSymbol,bool isJavaEnum)
809 : DefinitionMixin(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),nullptr,nullptr,isSymbol)
810{
811 AUTO_TRACE("name={}",name());
812 setReference(lref);
813 m_compType = ct;
816 if (!fName.isEmpty())
817 {
819 }
820 else
821 {
822 m_fileName=compTypeString+name();
823 }
824 m_prot=Protection::Public;
825 //nspace=nullptr;
826 m_fileDef=nullptr;
827 m_moduleDef=nullptr;
828 m_subGrouping=Config_getBool(SUBGROUPING);
829 m_templateMaster =nullptr;
834 m_categoryOf = nullptr;
836 m_isSimple = Config_getBool(INLINE_SIMPLE_STRUCTS);
837 m_arrowOperator = nullptr;
838 m_tagLessRef = nullptr;
840 //QCString ns;
841 //extractNamespaceName(name,className,ns);
842 //printf("m_name=%s m_className=%s ns=%s\n",qPrint(m_name),qPrint(m_className),qPrint(ns));
843
844 // we cannot use getLanguage at this point, as setLanguage has not been called.
845 SrcLangExt lang = getLanguageFromFileName(defFileName);
846 if ((lang==SrcLangExt::Cpp || lang==SrcLangExt::ObjC) && guessSection(defFileName).isSource())
847 {
849 }
850 else
851 {
853 }
854 m_hasCollaborationGraph = Config_getBool(COLLABORATION_GRAPH);
856 m_memberListFileName = convertNameToFile(compTypeString+name()+"-members");
859 if (lref.isEmpty())
860 {
862 }
863 AUTO_TRACE_EXIT("m_fileName='{}'",m_fileName);
864}
865
866std::unique_ptr<ClassDef> ClassDefImpl::deepCopy(const QCString &name) const
867{
868 AUTO_TRACE("name='{}'",name);
869 auto result = std::make_unique<ClassDefImpl>(
871 std::string(),std::string(),true,m_isJavaEnum);
872 result->setBriefDescription(briefDescription(),briefFile(),briefLine());
873 result->setDocumentation(documentation(),docFile(),docLine());
874 result->setInbodyDocumentation(inbodyDocumentation(),inbodyFile(),inbodyLine());
875 result->setBodySegment(getStartDefLine(),getStartBodyLine(),getEndBodyLine());
876 result->setBodyDef(getBodyDef());
877 result->setLanguage(getLanguage());
878
879 // copy other members
880 result->m_memberListFileName = m_memberListFileName;
881 result->m_collabFileName = m_collabFileName;
882 result->m_inheritFileName = m_inheritFileName;
883 if (m_incInfo)
884 {
885 result->m_incInfo = std::make_unique<IncludeInfo>();
886 *(result->m_incInfo) = *m_incInfo;
887 }
888 result->m_inherits = m_inherits;
889 result->m_inheritedBy = m_inheritedBy;
890 result->m_fileDef = m_fileDef;
891 result->m_moduleDef = m_moduleDef;
892 result->m_tempArgs = m_tempArgs;
893 result->m_typeConstraints = m_typeConstraints;
894 result->m_files = m_files;
895 result->m_examples = m_examples;
896 result->m_compType = m_compType;
897 result->m_prot = m_prot;
898 result->m_usesImplClassList = m_usesImplClassList;
899 result->m_usedByImplClassList = m_usedByImplClassList;
900 result->m_constraintClassList = m_constraintClassList;
901 result->m_templateInstances = m_templateInstances;
902 result->m_templBaseClassNames = m_templBaseClassNames;
903 result->m_templateMaster = m_templateMaster;
904 result->m_className = m_className;
905 result->m_categoryOf = m_categoryOf;
906 result->m_isAbstract = m_isAbstract;
907 result->m_isStatic = m_isStatic;
908 result->m_membersMerged = m_membersMerged;
909 result->m_isLocal = m_isLocal;
910 result->m_isTemplArg = m_isTemplArg;
911 result->m_subGrouping = m_subGrouping;
912 result->m_usedOnly = m_usedOnly;
913 result->m_vhdlSummaryTitles = m_vhdlSummaryTitles;
914 result->m_isSimple = m_isSimple;
915 result->m_arrowOperator = m_arrowOperator;
916 result->m_tagLessRef = m_tagLessRef;
917 result->m_isJavaEnum = m_isJavaEnum;
918 result->m_spec = m_spec;
919 result->m_metaData = m_metaData;
920 result->m_requiresClause = m_requiresClause;
921 result->m_qualifiers = m_qualifiers;
922 result->m_hasCollaborationGraph = m_hasCollaborationGraph;
923 result->m_typeInheritanceGraph = m_typeInheritanceGraph;
924
925 // set new file name
927 result->m_fileName = compTypeString+name;
928 result->m_memberListFileName = convertNameToFile(compTypeString+name+"-members");
929 result->m_collabFileName = convertNameToFile(result->m_fileName+"_coll_graph");
930 result->m_inheritFileName = convertNameToFile(result->m_fileName+"_inherit_graph");
931 result->m_fileName = convertNameToFile(result->m_fileName);
932
933 // deep copy nested classes
934 for (const auto &innerCd : m_innerClasses)
935 {
936 QCString innerName = name+"::"+innerCd->localName();
937 if (Doxygen::classLinkedMap->find(innerName)==nullptr)
938 {
939 auto cd = Doxygen::classLinkedMap->add(innerName,innerCd->deepCopy(innerName));
940 result->addInnerCompound(cd);
942 if (cdm)
943 {
944 cdm->setOuterScope(result.get());
945 }
946 }
947 }
948
949 // copy all member list (and make deep copies of members)
950 for (auto &mni : m_allMemberNameInfoLinkedMap)
951 {
952 for (auto &mi : *mni)
953 {
954 const MemberDef *md=mi->memberDef();
955 auto newMd = md->deepCopy();
956 if (newMd)
957 {
958 auto mmd = toMemberDefMutable(newMd.get());
959 AUTO_TRACE_ADD("Copying member {}",mmd->name());
960 mmd->moveTo(result.get());
961
962 result->internalInsertMember(newMd.get(),newMd->protection(),true);
963
964 // also add to the global list (which will own newMd)
965 MemberName *mn = Doxygen::memberNameLinkedMap->add(newMd->name());
966 mn->push_back(std::move(newMd));
967 }
968 }
969 }
970
971 return result;
972}
973
975{
976 //printf("%s::moveTo(%s)\n",qPrint(name()),qPrint(scope->name()));
977 setOuterScope(scope);
979 {
980 m_fileDef = toFileDef(scope);
981 }
982 else if (scope->definitionType()==Definition::TypeModule)
983 {
984 m_moduleDef = toModuleDef(scope);
985 }
986}
987
992
993QCString ClassDefImpl::displayName(bool includeScope) const
994{
995 return makeDisplayName(this,includeScope);
996}
997
998// inserts a base/super class in the inheritance list
1000 Specifier s,const QCString &t)
1001{
1002 //printf("*** insert base class %s into %s\n",qPrint(cd->name()),qPrint(name()));
1003 m_inherits.emplace_back(cd,n,p,s,t);
1004 m_isSimple = FALSE;
1005}
1006
1007// inserts a derived/sub class in the inherited-by list
1009 Specifier s,const QCString &t)
1010{
1011 //printf("*** insert sub class %s into %s\n",qPrint(cd->name()),qPrint(name()));
1012 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
1013 if (!extractPrivate && cd->protection()==Protection::Private) return;
1014 m_inheritedBy.emplace_back(cd,QCString(),p,s,t);
1015 m_isSimple = FALSE;
1016}
1017
1019{
1020 for (auto &ml : m_memberLists)
1021 {
1022 if (!ml->listType().isDetailed())
1023 {
1025 }
1026 }
1027
1028 // add members inside sections to their groups
1029 for (const auto &mg : m_memberGroups)
1030 {
1031 if (mg->allMembersInSameSection() && m_subGrouping)
1032 {
1033 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
1034 mg->addToDeclarationSection();
1035 }
1036 }
1037}
1038
1039// adds new member definition to the class
1041 Protection prot,
1042 bool addToAllList
1043 )
1044{
1045 AUTO_TRACE("{} name={} isHidden={}",name(),md->name(),md->isHidden());
1046 if (md->isHidden()) return;
1047
1048 if (getLanguage()==SrcLangExt::VHDL)
1049 {
1051 m_vhdlSummaryTitles.insert(title.str());
1052 }
1053
1054 if (1 /*!isReference()*/) // changed to 1 for showing members of external
1055 // classes when HAVE_DOT and UML_LOOK are enabled.
1056 {
1057 bool isSimple=FALSE;
1058
1059 /********************************************/
1060 /* insert member in the declaration section */
1061 /********************************************/
1062 if (md->isRelated() && protectionLevelVisible(prot))
1063 {
1064 addMemberToList(MemberListType::Related(),md,TRUE);
1065 }
1066 else if (md->isFriend())
1067 {
1068 addMemberToList(MemberListType::Friends(),md,TRUE);
1069 }
1070 else
1071 {
1072 switch (md->memberType())
1073 {
1074 case MemberType::Service: // UNO IDL
1075 addMemberToList(MemberListType::Services(),md,TRUE);
1076 break;
1077 case MemberType::Interface: // UNO IDL
1078 addMemberToList(MemberListType::Interfaces(),md,TRUE);
1079 break;
1080 case MemberType::Signal: // Qt specific
1081 addMemberToList(MemberListType::Signals(),md,TRUE);
1082 break;
1083 case MemberType::DCOP: // KDE2 specific
1084 addMemberToList(MemberListType::DcopMethods(),md,TRUE);
1085 break;
1087 addMemberToList(MemberListType::Properties(),md,TRUE);
1088 break;
1089 case MemberType::Event:
1090 addMemberToList(MemberListType::Events(),md,TRUE);
1091 break;
1092 case MemberType::Slot: // Qt specific
1093 switch (prot)
1094 {
1095 case Protection::Protected:
1096 case Protection::Package: // slots in packages are not possible!
1097 addMemberToList(MemberListType::ProSlots(),md,TRUE);
1098 break;
1099 case Protection::Public:
1100 addMemberToList(MemberListType::PubSlots(),md,TRUE);
1101 break;
1102 case Protection::Private:
1103 addMemberToList(MemberListType::PriSlots(),md,TRUE);
1104 break;
1105 }
1106 break;
1107 default: // any of the other members
1108 if (md->isStatic())
1109 {
1110 if (md->isVariable())
1111 {
1112 switch (prot)
1113 {
1114 case Protection::Protected:
1115 addMemberToList(MemberListType::ProStaticAttribs(),md,TRUE);
1116 break;
1117 case Protection::Package:
1118 addMemberToList(MemberListType::PacStaticAttribs(),md,TRUE);
1119 break;
1120 case Protection::Public:
1121 addMemberToList(MemberListType::PubStaticAttribs(),md,TRUE);
1122 break;
1123 case Protection::Private:
1124 addMemberToList(MemberListType::PriStaticAttribs(),md,TRUE);
1125 break;
1126 }
1127 }
1128 else // function
1129 {
1130 switch (prot)
1131 {
1132 case Protection::Protected:
1133 addMemberToList(MemberListType::ProStaticMethods(),md,TRUE);
1134 break;
1135 case Protection::Package:
1136 addMemberToList(MemberListType::PacStaticMethods(),md,TRUE);
1137 break;
1138 case Protection::Public:
1139 addMemberToList(MemberListType::PubStaticMethods(),md,TRUE);
1140 break;
1141 case Protection::Private:
1142 addMemberToList(MemberListType::PriStaticMethods(),md,TRUE);
1143 break;
1144 }
1145 }
1146 }
1147 else // not static
1148 {
1149 if (md->isVariable())
1150 {
1151 switch (prot)
1152 {
1153 case Protection::Protected:
1154 addMemberToList(MemberListType::ProAttribs(),md,TRUE);
1155 break;
1156 case Protection::Package:
1157 addMemberToList(MemberListType::PacAttribs(),md,TRUE);
1158 break;
1159 case Protection::Public:
1160 {
1161 addMemberToList(MemberListType::PubAttribs(),md,TRUE);
1162 const int MAX_CELL_SIZE=60;
1163 isSimple=md->typeString().length()+md->name().length()+md->argsString().length()<=MAX_CELL_SIZE;
1164 }
1165 break;
1166 case Protection::Private:
1167 addMemberToList(MemberListType::PriAttribs(),md,TRUE);
1168 break;
1169 }
1170 }
1171 else if (md->isTypedef() || md->isEnumerate() || md->isEnumValue())
1172 {
1173 switch (prot)
1174 {
1175 case Protection::Protected:
1176 addMemberToList(MemberListType::ProTypes(),md,TRUE);
1177 break;
1178 case Protection::Package:
1179 addMemberToList(MemberListType::PacTypes(),md,TRUE);
1180 break;
1181 case Protection::Public:
1182 addMemberToList(MemberListType::PubTypes(),md,TRUE);
1183 isSimple=!md->isEnumerate() &&
1184 !md->isEnumValue() &&
1185 md->typeString().find(")(")==-1; // func ptr typedef
1186 break;
1187 case Protection::Private:
1188 addMemberToList(MemberListType::PriTypes(),md,TRUE);
1189 break;
1190 }
1191 }
1192 else // member function
1193 {
1194 switch (prot)
1195 {
1196 case Protection::Protected:
1197 addMemberToList(MemberListType::ProMethods(),md,TRUE);
1198 break;
1199 case Protection::Package:
1200 addMemberToList(MemberListType::PacMethods(),md,TRUE);
1201 break;
1202 case Protection::Public:
1203 addMemberToList(MemberListType::PubMethods(),md,TRUE);
1204 break;
1205 case Protection::Private:
1206 addMemberToList(MemberListType::PriMethods(),md,TRUE);
1207 break;
1208 }
1209 }
1210 }
1211 break;
1212 }
1213 }
1214 if (!isSimple) // not a simple field -> not a simple struct
1215 {
1216 m_isSimple = FALSE;
1217 }
1218 //printf("adding %s simple=%d total_simple=%d\n",qPrint(name()),isSimple,m_isSimple);
1219
1220 /*******************************************************/
1221 /* insert member in the detailed documentation section */
1222 /*******************************************************/
1223 if ((md->isRelated() && protectionLevelVisible(prot)) || md->isFriend())
1224 {
1225 addMemberToList(MemberListType::RelatedMembers(),md,FALSE);
1226 }
1227 else if (md->isFunction() &&
1228 md->protection()==Protection::Private &&
1229 (md->virtualness()!=Specifier::Normal || md->isOverride() || md->isFinal()) &&
1230 Config_getBool(EXTRACT_PRIV_VIRTUAL))
1231 {
1232 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1233 }
1234 else
1235 {
1236 switch (md->memberType())
1237 {
1238 case MemberType::Service: // UNO IDL
1239 addMemberToList(MemberListType::ServiceMembers(),md,FALSE);
1240 break;
1241 case MemberType::Interface: // UNO IDL
1242 addMemberToList(MemberListType::InterfaceMembers(),md,FALSE);
1243 break;
1245 addMemberToList(MemberListType::PropertyMembers(),md,FALSE);
1246 break;
1247 case MemberType::Event:
1248 addMemberToList(MemberListType::EventMembers(),md,FALSE);
1249 break;
1250 case MemberType::Signal: // fall through
1251 case MemberType::DCOP:
1252 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1253 break;
1254 case MemberType::Slot:
1255 if (protectionLevelVisible(prot))
1256 {
1257 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1258 }
1259 break;
1260 default: // any of the other members
1261 if (protectionLevelVisible(prot))
1262 {
1263 switch (md->memberType())
1264 {
1266 addMemberToList(MemberListType::TypedefMembers(),md,FALSE);
1267 break;
1269 addMemberToList(MemberListType::EnumMembers(),md,FALSE);
1270 break;
1272 addMemberToList(MemberListType::EnumValMembers(),md,FALSE);
1273 break;
1275 if (md->isConstructor() || md->isDestructor())
1276 {
1277 m_memberLists.get(MemberListType::Constructors(),MemberListContainer::Class)->push_back(md);
1278 }
1279 else
1280 {
1281 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1282 }
1283 break;
1285 addMemberToList(MemberListType::VariableMembers(),md,FALSE);
1286 break;
1287 case MemberType::Define:
1288 warn(md->getDefFileName(),md->getDefLine()-1,"A define ({}) cannot be made a member of {}",
1289 md->name(), this->name());
1290 break;
1291 default:
1292 err("Unexpected member type '{}' found!\n",md->memberTypeName());
1293 }
1294 }
1295 break;
1296 }
1297 }
1298
1299 /*************************************************/
1300 /* insert member in the appropriate member group */
1301 /*************************************************/
1302 // Note: this must be done AFTER inserting the member in the
1303 // regular groups
1304 //addMemberToGroup(md,groupId);
1305
1306 }
1307
1308 if (md->virtualness()==Specifier::Pure)
1309 {
1310 m_isAbstract=true;
1311 }
1312
1313 if (md->name()=="operator->")
1314 {
1315 m_arrowOperator=md;
1316 }
1317
1318 if (addToAllList &&
1319 !(Config_getBool(HIDE_FRIEND_COMPOUNDS) &&
1320 md->isFriend() &&
1321 (md->typeString()=="friend class" ||
1322 md->typeString()=="friend struct" ||
1323 md->typeString()=="friend union")))
1324 {
1325 //printf("=======> adding member %s to class %s\n",qPrint(md->name()),qPrint(name()));
1326
1328 mni->push_back(std::make_unique<MemberInfo>(md,prot,md->virtualness(),false,false));
1329 }
1330
1331 // if we already created template instances before inserting this member (i.e. due to a typedef or using statement)
1332 // then we also need to insert the member in the template instance.
1333 for (const auto &ti : getTemplateInstances())
1334 {
1335 AUTO_TRACE_ADD("member {} of class {} with template instance {}\n",md->name(),name(),ti.templSpec);
1336 ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
1337 if (cdm)
1338 {
1339 cdm->addMemberToTemplateInstance(md,templateArguments(),ti.templSpec);
1340 }
1341 }
1342
1343}
1344
1349
1350// compute the anchors for all members
1352{
1353 for (auto &ml : m_memberLists)
1354 {
1355 if (!ml->listType().isDetailed())
1356 {
1357 ml->setAnchors();
1358 }
1359 }
1360
1361 for (const auto &mg : m_memberGroups)
1362 {
1363 mg->setAnchors();
1364 }
1365}
1366
1368{
1369 for (const auto &mg : m_memberGroups)
1370 {
1371 mg->distributeMemberGroupDocumentation();
1372 }
1373}
1374
1376{
1380 for (const auto &mg : m_memberGroups)
1381 {
1382 mg->findSectionsInDocumentation(this);
1383 }
1384 for (auto &ml : m_memberLists)
1385 {
1386 if (!ml->listType().isDetailed())
1387 {
1388 ml->findSectionsInDocumentation(this);
1389 }
1390 }
1391}
1392
1393
1394// add a file name to the used files set
1396{
1397 if (fd == nullptr) return;
1398
1399 if (std::find(m_files.begin(), m_files.end(), fd) == m_files.end()) m_files.push_back(fd);
1400
1401 for (const auto &ti : m_templateInstances)
1402 {
1403 if (ClassDefMutable *cdm = toClassDefMutable(ti.classDef)) cdm->insertUsedFile(fd);
1404 }
1405}
1406
1408{
1409 if (bcd.prot!=Protection::Public || bcd.virt!=Specifier::Normal)
1410 {
1411 ol.startTypewriter();
1412 ol.docify(" [");
1413 StringVector sl;
1414 if (bcd.prot==Protection::Protected) sl.emplace_back("protected");
1415 else if (bcd.prot==Protection::Private) sl.emplace_back("private");
1416 if (bcd.virt==Specifier::Virtual) sl.emplace_back("virtual");
1417 bool first=true;
1418 for (const auto &s : sl)
1419 {
1420 if (!first) ol.docify(", ");
1421 ol.docify(s);
1422 first=false;
1423 }
1424 ol.docify("]");
1425 ol.endTypewriter();
1426 }
1427}
1428
1430 const QCString &includeName,bool local, bool force)
1431{
1432 //printf("ClassDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,includeName,local,force);
1433 if (!m_incInfo) m_incInfo = std::make_unique<IncludeInfo>();
1434 if ((!includeName.isEmpty() && m_incInfo->includeName.isEmpty()) ||
1435 (fd!=nullptr && m_incInfo->fileDef==nullptr)
1436 )
1437 {
1438 //printf("Setting file info\n");
1439 m_incInfo->fileDef = fd;
1440 m_incInfo->includeName = includeName;
1442 }
1443 if (force && !includeName.isEmpty())
1444 {
1445 m_incInfo->includeName = includeName;
1447 }
1448}
1449
1450// TODO: fix this: a nested template class can have multiple outer templates
1451//ArgumentList *ClassDefImpl::outerTemplateArguments() const
1452//{
1453// int ti;
1454// ClassDef *pcd=nullptr;
1455// int pi=0;
1456// if (m_tempArgs) return m_tempArgs;
1457// // find the outer most class scope
1458// while ((ti=name().find("::",pi))!=-1 &&
1459// (pcd=getClass(name().left(ti)))==0
1460// ) pi=ti+2;
1461// if (pcd)
1462// {
1463// return pcd->templateArguments();
1464// }
1465// return nullptr;
1466//}
1467
1468static void searchTemplateSpecs(/*in*/ const Definition *d,
1469 /*out*/ ArgumentLists &result,
1470 /*out*/ QCString &name,
1471 /*in*/ SrcLangExt lang)
1472{
1474 {
1475 if (d->getOuterScope())
1476 {
1477 searchTemplateSpecs(d->getOuterScope(),result,name,lang);
1478 }
1479 const ClassDef *cd=toClassDef(d);
1480 if (!name.isEmpty()) name+="::";
1481 QCString clName = d->localName();
1482 if (clName.endsWith("-p"))
1483 {
1484 clName = clName.left(clName.length()-2);
1485 }
1486 name+=clName;
1487 bool isSpecialization = d->localName().find('<')!=-1;
1488 if (!cd->templateArguments().empty())
1489 {
1490 result.push_back(cd->templateArguments());
1491 if (!isSpecialization)
1492 {
1493 name+=tempArgListToString(cd->templateArguments(),lang);
1494 }
1495 }
1496 }
1497 else
1498 {
1499 name+=d->qualifiedName();
1500 }
1501}
1502
1504 const QCString &type,SrcLangExt lang) const
1505{
1506 ArgumentLists specs;
1507 QCString name;
1508 searchTemplateSpecs(d,specs,name,lang);
1509 if (!specs.empty()) // class has template scope specifiers
1510 {
1512 for (const ArgumentList &al : specs)
1513 {
1514 ol.docify("template<");
1515 auto it = al.begin();
1516 while (it!=al.end())
1517 {
1518 Argument a = *it;
1520 d, // scope
1521 getFileDef(), // fileScope
1522 this, // self
1523 a.type, // text
1524 FALSE // autoBreak
1525 );
1526 if (!a.name.isEmpty())
1527 {
1528 ol.docify(" ");
1529 ol.docify(a.name);
1530 }
1531 if (a.defval.length()!=0)
1532 {
1533 ol.docify(" = ");
1534 ol.docify(a.defval);
1535 }
1536 ++it;
1537 if (it!=al.end()) ol.docify(", ");
1538 }
1539 ol.docify(">");
1540 ol.lineBreak();
1541 }
1542 if (!m_requiresClause.isEmpty())
1543 {
1544 ol.docify("requires ");
1546 d, // scope
1547 getFileDef(), // fileScope
1548 this, // self
1549 m_requiresClause, // text
1550 FALSE // autoBreak
1551 );
1552 ol.lineBreak();
1553 }
1554 ol.docify(type.lower()+" "+name);
1556 }
1557}
1558
1559void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) const
1560{
1561 if (hasBriefDescription())
1562 {
1563 ol.startParagraph();
1564 ol.pushGeneratorState();
1566 ol.writeString(" - ");
1567 ol.popGeneratorState();
1569 briefLine(),
1570 this,
1571 nullptr,
1573 DocOptions()
1574 .setIndexWords(true)
1575 .setSingleLine(true));
1576 ol.pushGeneratorState();
1578 ol.writeString(" \n");
1580 ol.popGeneratorState();
1581
1582 if (hasDetailedDescription() || exampleFlag)
1583 {
1584 writeMoreLink(ol,anchor());
1585 }
1586
1587 ol.endParagraph();
1588 }
1589 ol.writeSynopsis();
1590}
1591
1593{
1594 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1595
1596 ol.startTextBlock();
1597
1598 if (getLanguage()==SrcLangExt::Cpp)
1599 {
1601 }
1602
1603 // repeat brief description
1604 if (!briefDescription().isEmpty() && repeatBrief)
1605 {
1607 briefLine(),
1608 this,
1609 nullptr,
1611 DocOptions());
1612 }
1613 if (!briefDescription().isEmpty() && repeatBrief &&
1614 !documentation().isEmpty())
1615 {
1616 ol.pushGeneratorState();
1618 ol.writeString("\n\n");
1619 ol.popGeneratorState();
1620 }
1621 // write documentation
1622 if (!documentation().isEmpty())
1623 {
1624 ol.generateDoc(docFile(),
1625 docLine(),
1626 this,
1627 nullptr,
1628 documentation(),
1629 DocOptions()
1630 .setIndexWords(true));
1631 }
1632 // write type constraints
1634
1635 ol.generateDoc(
1636 docFile(),docLine(),
1637 this,
1638 nullptr, // memberDef
1640 DocOptions()
1641 .setIndexWords(true));
1642
1643 // write examples
1644 if (hasExamples())
1645 {
1646 ol.startExamples();
1647 ol.startDescForItem();
1649 ol.endDescForItem();
1650 ol.endExamples();
1651 }
1652 writeSourceDef(ol);
1654 ol.endTextBlock();
1655}
1656
1658{
1659 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1660 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1661 return ((!briefDescription().isEmpty() && repeatBrief) ||
1662 (!documentation().isEmpty() || m_tempArgs.hasTemplateDocumentation()) ||
1663 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()) ||
1665}
1666
1667// write the detailed description for this class
1668void ClassDefImpl::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag,
1669 const QCString &title,const QCString &anchor) const
1670{
1671 if (hasDetailedDescription() || exampleFlag)
1672 {
1673 ol.pushGeneratorState();
1675 ol.writeRuler();
1676 ol.popGeneratorState();
1677
1678 ol.pushGeneratorState();
1680 ol.writeAnchor(QCString(),anchor.isEmpty() ? QCString("details") : anchor);
1681 ol.popGeneratorState();
1682
1683 if (!anchor.isEmpty())
1684 {
1685 ol.pushGeneratorState();
1689 ol.popGeneratorState();
1690 }
1691
1692 ol.startGroupHeader("details");
1693 ol.parseText(title);
1694 ol.endGroupHeader();
1695
1697 }
1698 else
1699 {
1700 //writeTemplateSpec(ol,this,pageType);
1701 }
1702}
1703
1705{
1706 QCString result;
1707 SrcLangExt lang = getLanguage();
1708 size_t numFiles = m_files.size();
1709 if (lang==SrcLangExt::Fortran)
1710 {
1711 result = theTranslator->trGeneratedFromFilesFortran(
1712 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1713 numFiles==1);
1714 }
1715 else if (isJavaEnum())
1716 {
1717 result = theTranslator->trEnumGeneratedFromFiles(numFiles==1);
1718 }
1719 else if (m_compType==Service)
1720 {
1721 result = theTranslator->trServiceGeneratedFromFiles(numFiles==1);
1722 }
1723 else if (m_compType==Singleton)
1724 {
1725 result = theTranslator->trSingletonGeneratedFromFiles(numFiles==1);
1726 }
1727 else
1728 {
1729 result = theTranslator->trGeneratedFromFiles(
1730 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1731 numFiles==1);
1732 }
1733 return result;
1734}
1735
1737{
1738 ol.pushGeneratorState();
1740
1741
1742 ol.writeRuler();
1743 ol.pushGeneratorState();
1745 ol.startParagraph();
1747 ol.endParagraph();
1748 ol.popGeneratorState();
1752
1753 bool first=TRUE;
1754 for (const auto &fd : m_files)
1755 {
1756 if (first)
1757 {
1758 first=FALSE;
1759 ol.startItemList();
1760 }
1761
1762 ol.startItemListItem();
1763 QCString path=fd->getPath();
1764 if (Config_getBool(FULL_PATH_NAMES))
1765 {
1766 ol.docify(stripFromPath(path));
1767 }
1768
1769 QCString fname = fd->name();
1770 if (!fd->getVersion().isEmpty()) // append version if available
1771 {
1772 fname += " (" + fd->getVersion() + ")";
1773 }
1774
1775 // for HTML
1776 ol.pushGeneratorState();
1778 if (fd->generateSourceFile())
1779 {
1780 ol.writeObjectLink(QCString(),fd->getSourceFileBase(),QCString(),fname);
1781 }
1782 else if (fd->isLinkable())
1783 {
1784 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
1785 }
1786 else
1787 {
1788 ol.startBold();
1789 ol.docify(fname);
1790 ol.endBold();
1791 }
1792 ol.popGeneratorState();
1793
1794 // for other output formats
1795 ol.pushGeneratorState();
1797 if (fd->isLinkable())
1798 {
1799 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
1800 }
1801 else
1802 {
1803 ol.docify(fname);
1804 }
1805 ol.popGeneratorState();
1806
1807 ol.endItemListItem();
1808 }
1809 if (!first) ol.endItemList();
1810
1811 ol.popGeneratorState();
1812}
1813
1815{
1816 int count=0;
1817 for (const auto &ibcd : m_inheritedBy)
1818 {
1819 const ClassDef *icd=ibcd.classDef;
1820 if ( icd->isVisibleInHierarchy()) count++;
1821 }
1822 return count;
1823}
1824
1826{
1827 int count=0;
1828 for (const auto &ibcd : m_inherits)
1829 {
1830 const ClassDef *icd=ibcd.classDef;
1831 if ( icd->isVisibleInHierarchy()) count++;
1832 }
1833 return count;
1834}
1835
1840
1842{
1843 bool haveDot = Config_getBool(HAVE_DOT);
1844 auto classGraph = m_typeInheritanceGraph;
1845
1846 if (classGraph == CLASS_GRAPH_t::NO) return;
1847 // count direct inheritance relations
1848 int count=countInheritanceNodes();
1849
1850 bool renderDiagram = FALSE;
1851 if (haveDot && (classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH))
1852 // write class diagram using dot
1853 {
1854 DotClassGraph inheritanceGraph(this,GraphType::Inheritance);
1855 if (inheritanceGraph.isTooBig())
1856 {
1857 warn_uncond("Inheritance graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
1858 name(), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
1859 }
1860 else if (!inheritanceGraph.isTrivial())
1861 {
1862 ol.pushGeneratorState();
1864 ol.startDotGraph();
1865 ol.parseText(theTranslator->trClassDiagram(displayName()));
1866 ol.endDotGraph(inheritanceGraph);
1867 ol.popGeneratorState();
1868 renderDiagram = TRUE;
1869 }
1870 }
1871 else if ((classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH || classGraph==CLASS_GRAPH_t::BUILTIN) && count>0)
1872 // write class diagram using built-in generator
1873 {
1874 ClassDiagram diagram(this); // create a diagram of this class.
1875 ol.startClassDiagram();
1877 ol.parseText(theTranslator->trClassDiagram(displayName()));
1880 renderDiagram = TRUE;
1881 }
1882
1883 if (renderDiagram) // if we already show the inheritance relations graphically,
1884 // then hide the text version
1885 {
1887 }
1888
1889 count = countInheritsNodes();
1890 if (count>0)
1891 {
1892 auto replaceFunc = [this,&ol](size_t entryIndex)
1893 {
1894 for (size_t index=0; index<m_inherits.size() ; index++)
1895 {
1896 const BaseClassDef &bcd=m_inherits[index];
1897 const ClassDef *cd=bcd.classDef;
1898
1899 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1900 {
1901 if (index==entryIndex) // found the requested index
1902 {
1903 // use the class name but with the template arguments as given
1904 // in the inheritance relation
1906 cd->displayName(),bcd.templSpecifiers);
1907
1908 if (cd->isLinkable())
1909 {
1911 cd->getOutputFileBase(),
1912 cd->anchor(),
1913 displayName);
1914 }
1915 else
1916 {
1917 ol.docify(displayName);
1918 }
1919 return;
1920 }
1921 }
1922 }
1923 };
1924
1925 ol.startParagraph();
1926 writeMarkerList(ol,
1927 theTranslator->trInheritsList(count).str(),
1928 static_cast<size_t>(count),
1929 replaceFunc);
1930 ol.endParagraph();
1931 }
1932
1933 // write subclasses
1934 count = countInheritedByNodes();
1935 if (count>0)
1936 {
1937 auto replaceFunc = [this,&ol](size_t entryIndex)
1938 {
1939 for (size_t index=0; index<m_inheritedBy.size() ; index++)
1940 {
1941 const BaseClassDef &bcd=m_inheritedBy[index];
1942 const ClassDef *cd=bcd.classDef;
1943 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1944 {
1945 if (index==entryIndex) // found the requested index
1946 {
1947 if (cd->isLinkable())
1948 {
1951 }
1952 else
1953 {
1954 ol.docify(cd->displayName());
1955 }
1956 return;
1957 }
1958 }
1959 }
1960 };
1961
1962 ol.startParagraph();
1963 writeMarkerList(ol,
1964 theTranslator->trInheritedByList(count).str(),
1965 static_cast<size_t>(count),
1966 replaceFunc);
1967 ol.endParagraph();
1968 }
1969
1970 if (renderDiagram)
1971 {
1972 ol.enableAll();
1973 }
1974}
1975
1977{
1978 if (Config_getBool(HAVE_DOT) && m_hasCollaborationGraph /*&& Config_getBool(COLLABORATION_GRAPH)*/)
1979 {
1980 DotClassGraph usageImplGraph(this,GraphType::Collaboration);
1981 if (usageImplGraph.isTooBig())
1982 {
1983 warn_uncond("Collaboration graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
1984 name(), usageImplGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
1985 }
1986 else if (!usageImplGraph.isTrivial())
1987 {
1988 ol.pushGeneratorState();
1990 ol.startDotGraph();
1991 ol.parseText(theTranslator->trCollaborationDiagram(displayName()));
1992 ol.endDotGraph(usageImplGraph);
1993 ol.popGeneratorState();
1994 }
1995 }
1996}
1997
1998
2000{
2001 if (m_incInfo)
2002 {
2003 QCString nm;
2004 const StringVector &paths = Config_getList(STRIP_FROM_PATH);
2005 if (!paths.empty() && m_incInfo->fileDef)
2006 {
2007 QCString abs = m_incInfo->fileDef->absFilePath();
2008 QCString potential;
2009 size_t length = 0;
2010 for (const auto &s : paths)
2011 {
2012 FileInfo info(s);
2013 if (info.exists())
2014 {
2015 QCString prefix = info.absFilePath();
2016 if (prefix.at(prefix.length() - 1) != '/')
2017 {
2018 prefix += '/';
2019 }
2020
2021 if (prefix.length() > length &&
2022 qstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare
2023 {
2024 length = prefix.length();
2025 potential = abs.right(abs.length() - prefix.length());
2026 }
2027 }
2028 }
2029
2030 if (length > 0)
2031 {
2032 nm = potential;
2033 }
2034 }
2035
2036 if (nm.isEmpty())
2037 {
2038 nm = m_incInfo->includeName;
2039 }
2040
2041 ol.startParagraph();
2042 ol.docify(theTranslator->trDefinedIn()+" ");
2043 ol.startTypewriter();
2044 ol.docify("<");
2045 if (m_incInfo->fileDef)
2046 {
2047 ol.writeObjectLink(QCString(),m_incInfo->fileDef->includeName(),QCString(),nm);
2048 }
2049 else
2050 {
2051 ol.docify(nm);
2052 }
2053 ol.docify(">");
2054 ol.endTypewriter();
2055 ol.endParagraph();
2056 }
2057
2058 // Write a summary of the Slice definition including metadata.
2059 ol.startParagraph();
2060 ol.startTypewriter();
2061 if (!m_metaData.isEmpty())
2062 {
2063 ol.docify(m_metaData);
2064 ol.lineBreak();
2065 }
2066 if (m_spec.isLocal())
2067 {
2068 ol.docify("local ");
2069 }
2070 if (m_spec.isInterface())
2071 {
2072 ol.docify("interface ");
2073 }
2074 else if (m_spec.isStruct())
2075 {
2076 ol.docify("struct ");
2077 }
2078 else if (m_spec.isException())
2079 {
2080 ol.docify("exception ");
2081 }
2082 else
2083 {
2084 ol.docify("class ");
2085 }
2086 ol.docify(stripScope(name()));
2087 if (!m_inherits.empty())
2088 {
2089 if (m_spec.isInterface() || m_spec.isException())
2090 {
2091 ol.docify(" extends ");
2092 bool first=true;
2093 for (const auto &ibcd : m_inherits)
2094 {
2095 if (!first) ol.docify(", ");
2096 ClassDef *icd = ibcd.classDef;
2097 ol.docify(icd->name());
2098 first=false;
2099 }
2100 }
2101 else
2102 {
2103 // Must be a class.
2104 bool implements = false;
2105 for (const auto &ibcd : m_inherits)
2106 {
2107 ClassDef *icd = ibcd.classDef;
2108 if (icd->isInterface())
2109 {
2110 implements = true;
2111 }
2112 else
2113 {
2114 ol.docify(" extends ");
2115 ol.docify(icd->name());
2116 }
2117 }
2118 if (implements)
2119 {
2120 ol.docify(" implements ");
2121 bool first = true;
2122 for (const auto &ibcd : m_inherits)
2123 {
2124 ClassDef *icd = ibcd.classDef;
2125 if (icd->isInterface())
2126 {
2127 if (!first) ol.docify(", ");
2128 first = false;
2129 ol.docify(icd->name());
2130 }
2131 }
2132 }
2133 }
2134 }
2135 ol.docify(" { ... }");
2136 ol.endTypewriter();
2137 ol.endParagraph();
2138}
2139
2141{
2142 if (m_incInfo /*&& Config_getBool(SHOW_HEADERFILE)*/)
2143 {
2144 SrcLangExt lang = getLanguage();
2145 QCString nm=m_incInfo->includeName.isEmpty() ?
2146 (m_incInfo->fileDef ?
2147 m_incInfo->fileDef->docName() : QCString()
2148 ) :
2149 m_incInfo->includeName;
2150 if (!nm.isEmpty())
2151 {
2152 ol.startParagraph();
2153 ol.startTypewriter();
2154 ol.docify(::includeStatement(lang,m_incInfo->kind));
2155 ol.docify(::includeOpen(lang,m_incInfo->kind));
2156 ol.pushGeneratorState();
2158 ol.docify(nm);
2161 if (m_incInfo->fileDef)
2162 {
2163 ol.writeObjectLink(QCString(),m_incInfo->fileDef->includeName(),QCString(),nm);
2164 }
2165 else
2166 {
2167 ol.docify(nm);
2168 }
2169 ol.popGeneratorState();
2170 ol.docify(::includeClose(lang,m_incInfo->kind));
2171 ol.endTypewriter();
2172 ol.endParagraph();
2173 }
2174 }
2175}
2176
2177void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) const
2178{
2179 // write user defined member groups
2180 for (const auto &mg : m_memberGroups)
2181 {
2182 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
2183 {
2184 mg->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,showInline);
2185 }
2186 else // add this group to the corresponding member section
2187 {
2188 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
2189 //mg->addToDeclarationSection();
2190 }
2191 }
2192}
2193
2195{
2196 // nested classes
2197 m_innerClasses.writeDeclaration(ol,nullptr,title,TRUE);
2198}
2199
2201{
2202 m_innerClasses.writeDocumentation(ol,this);
2203}
2204
2206{
2207 //printf("%s: ClassDefImpl::startMemberDocumentation()\n",qPrint(name()));
2208 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2209 {
2212 }
2213}
2214
2216{
2217 //printf("%s: ClassDefImpl::endMemberDocumentation()\n",qPrint(name()));
2218 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2219 {
2222 }
2223}
2224
2226{
2227 //printf("%s: ClassDefImpl::startMemberDeclarations()\n",qPrint(name()));
2229}
2230
2232{
2233 //printf("%s: ClassDefImpl::endMemberDeclarations()\n",qPrint(name()));
2234 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
2235 if (!inlineInheritedMembers && countAdditionalInheritedMembers()>0)
2236 {
2237 ol.startMemberHeader("inherited");
2238 ol.parseText(theTranslator->trAdditionalInheritedMembers());
2239 ol.endMemberHeader();
2241 }
2242 ol.endMemberSections();
2243}
2244
2246{
2247 ol.pushGeneratorState();
2249 ol.writeString("\n");
2250 ol.startGroupHeader();
2251 ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
2252 ol.endGroupHeader();
2253 ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString(PROJECT_NAME)));
2254 ol.popGeneratorState();
2255}
2256
2257
2259{
2260 static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2261 ol.pushGeneratorState();
2263 bool first=TRUE;
2264 SrcLangExt lang = getLanguage();
2265
2266 if (lang!=SrcLangExt::VHDL)
2267 {
2268 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2269 {
2270 if (lde->kind()==LayoutDocEntry::ClassNestedClasses &&
2271 m_innerClasses.declVisible()
2272 )
2273 {
2274 for (const auto &innerCd : m_innerClasses)
2275 {
2276 if (!innerCd->isAnonymous() &&
2277 !innerCd->isExtension() &&
2278 (innerCd->protection()!=Protection::Private || extractPrivate) &&
2279 innerCd->visibleInParentsDeclList()
2280 )
2281 {
2282 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection *>(lde.get());
2283 ol.writeSummaryLink(QCString(),"nested-classes",ls->title(lang),first);
2284 first=FALSE;
2285 break;
2286 }
2287 }
2288 }
2289 else if (lde->kind()==LayoutDocEntry::ClassAllMembersLink &&
2291 !Config_getBool(OPTIMIZE_OUTPUT_FOR_C)
2292 )
2293 {
2294 ol.writeSummaryLink(getMemberListFileName(),"all-members-list",theTranslator->trListOfAllMembers(),first);
2295 first=FALSE;
2296 }
2297 else if (lde->kind()==LayoutDocEntry::MemberDecl)
2298 {
2299 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2300 if (lmd)
2301 {
2302 MemberList * ml = getMemberList(lmd->type);
2303 if (ml && ml->declVisible())
2304 {
2305 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
2306 first=FALSE;
2307 }
2308 }
2309 }
2310 }
2311 }
2312 else // VDHL only
2313 {
2314 for (const auto &s : m_vhdlSummaryTitles)
2315 {
2316 ol.writeSummaryLink(QCString(),convertToId(s),s,first);
2317 first=FALSE;
2318 }
2319 }
2320 if (!first)
2321 {
2322 ol.writeString(" </div>\n");
2323 }
2324 ol.popGeneratorState();
2325}
2326
2331
2333{
2334 if (!isLinkableInProject() || isArtificial()) return;
2335 tagFile << " <compound kind=\"";
2336 if (isFortran() && (compoundTypeString() == "type"))
2337 tagFile << "struct";
2338 else
2339 tagFile << compoundTypeString();
2340 tagFile << "\"";
2341 if (isObjectiveC()) { tagFile << " objc=\"yes\""; }
2342 tagFile << ">\n";
2343 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
2346 tagFile << " <filename>" << convertToXML(fn) << "</filename>\n";
2347 if (!anchor().isEmpty())
2348 {
2349 tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
2350 }
2351 QCString idStr = id();
2352 if (!idStr.isEmpty())
2353 {
2354 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
2355 }
2356 for (const Argument &a : m_tempArgs)
2357 {
2358 tagFile << " <templarg>" << convertToXML(a.type);
2359 if (!a.name.isEmpty())
2360 {
2361 tagFile << " " << convertToXML(a.name);
2362 }
2363 tagFile << "</templarg>\n";
2364 }
2365 for (const auto &ibcd : m_inherits)
2366 {
2367 ClassDef *cd=ibcd.classDef;
2368 if (cd && cd->isLinkable())
2369 {
2370 tagFile << " <base";
2371 if (ibcd.prot==Protection::Protected)
2372 {
2373 tagFile << " protection=\"protected\"";
2374 }
2375 else if (ibcd.prot==Protection::Private)
2376 {
2377 tagFile << " protection=\"private\"";
2378 }
2379 if (ibcd.virt==Specifier::Virtual)
2380 {
2381 tagFile << " virtualness=\"virtual\"";
2382 }
2384 cd->displayName(),ibcd.templSpecifiers);
2385 tagFile << ">" << convertToXML(displayName) << "</base>\n";
2386 }
2387 }
2388 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2389 {
2390 switch (lde->kind())
2391 {
2392 case LayoutDocEntry::ClassNestedClasses:
2393 {
2394 for (const auto &innerCd : m_innerClasses)
2395 {
2396 if (innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
2397 protectionLevelVisible(innerCd->protection()) &&
2398 !innerCd->isEmbeddedInOuterScope()
2399 )
2400 {
2401 tagFile << " <class kind=\"" << innerCd->compoundTypeString() <<
2402 "\">" << convertToXML(innerCd->name()) << "</class>\n";
2403 }
2404 }
2405 }
2406 break;
2407 case LayoutDocEntry::MemberDecl:
2408 {
2409 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2410 if (lmd)
2411 {
2412 MemberList * ml = getMemberList(lmd->type);
2413 if (ml)
2414 {
2415 ml->writeTagFile(tagFile);
2416 }
2417 }
2418 }
2419 break;
2420 case LayoutDocEntry::MemberGroups:
2421 {
2422 for (const auto &mg : m_memberGroups)
2423 {
2424 mg->writeTagFile(tagFile);
2425 }
2426 }
2427 break;
2428 default:
2429 break;
2430 }
2431 }
2432 writeDocAnchorsToTagFile(tagFile);
2433 tagFile << " </compound>\n";
2434}
2435
2436/** Write class documentation inside another container (i.e. a group) */
2438{
2439 bool isSimple = m_isSimple;
2440
2441 ol.addIndexItem(name(),QCString());
2442 //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",qPrint(name()));
2443
2444 // part 1: anchor and title
2445 QCString s = compoundTypeString()+" "+name();
2446
2447 // part 1a
2448 ol.pushGeneratorState();
2450 { // only HTML only
2451 ol.writeAnchor(QCString(),anchor());
2454 ol.parseText(s);
2455 ol.endMemberDocName();
2456 ol.endMemberDoc(FALSE);
2457 ol.writeString("</div>");
2458 ol.startIndent();
2459 }
2460 ol.popGeneratorState();
2461
2462 // part 1b
2463 ol.pushGeneratorState();
2466 { // for LaTeX/RTF only
2468 }
2469 ol.popGeneratorState();
2470
2471 // part 1c
2472 ol.pushGeneratorState();
2474 {
2475 // for LaTeX/RTF/Man
2476 ol.startGroupHeader("",1);
2477 ol.parseText(s);
2478 ol.endGroupHeader(1);
2479 }
2480 ol.popGeneratorState();
2481
2482 SrcLangExt lang=getLanguage();
2483
2484 // part 2: the header and detailed description
2485 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2486 {
2487 switch (lde->kind())
2488 {
2489 case LayoutDocEntry::BriefDesc:
2490 {
2491 // since we already shown the brief description in the
2492 // declaration part of the container, so we use this to
2493 // show the details on top.
2495 }
2496 break;
2497 case LayoutDocEntry::ClassInheritanceGraph:
2499 break;
2500 case LayoutDocEntry::ClassCollaborationGraph:
2502 break;
2503 case LayoutDocEntry::MemberDeclStart:
2505 break;
2506 case LayoutDocEntry::MemberDecl:
2507 {
2508 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2509 if (lmd)
2510 {
2511 ClassDefSet visitedClasses;
2512 if (!isSimple) writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang),TRUE);
2513 }
2514 }
2515 break;
2516 case LayoutDocEntry::MemberGroups:
2518 break;
2519 case LayoutDocEntry::MemberDeclEnd:
2521 break;
2522 case LayoutDocEntry::MemberDefStart:
2524 break;
2525 case LayoutDocEntry::MemberDef:
2526 {
2527 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2528 if (lmd)
2529 {
2530 if (isSimple)
2531 {
2533 }
2534 else
2535 {
2536 writeMemberDocumentation(ol,lmd->type,lmd->title(lang),TRUE);
2537 }
2538 }
2539 }
2540 break;
2541 case LayoutDocEntry::MemberDefEnd:
2543 break;
2544 default:
2545 break;
2546 }
2547 }
2548
2549 // part 3: close the block
2550 ol.pushGeneratorState();
2552 { // HTML only
2553 ol.endIndent();
2554 }
2555 ol.popGeneratorState();
2556}
2557
2559{
2560 // TODO: clean up this mess by moving it to
2561 // the output generators...
2562 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
2563 bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
2564 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
2565
2566 // HTML only
2567 ol.pushGeneratorState();
2569 ol.docify(" ");
2571 anchor.isEmpty() ? QCString("details") : anchor);
2572 ol.parseText(theTranslator->trMore());
2573 ol.endTextLink();
2574 ol.popGeneratorState();
2575
2576 if (!anchor.isEmpty())
2577 {
2578 ol.pushGeneratorState();
2579 // LaTeX + RTF
2583 if (!(usePDFLatex && pdfHyperlinks))
2584 {
2586 }
2587 if (!rtfHyperlinks)
2588 {
2590 }
2591 ol.docify(" ");
2593 ol.parseText(theTranslator->trMore());
2594 ol.endTextLink();
2595 // RTF only
2597 ol.writeString("\\par");
2598 ol.popGeneratorState();
2599 }
2600}
2601
2603{
2604 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2605 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
2606 bool extractLocalClasses = Config_getBool(EXTRACT_LOCAL_CLASSES);
2607 bool linkable = isLinkable();
2608 return (!isAnonymous() && !isExtension() &&
2609 (protection()!=Protection::Private || extractPrivate) &&
2610 (linkable || (!hideUndocClasses && (!isLocal() || extractLocalClasses)))
2611 );
2612}
2613
2614void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const
2615{
2616 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2617 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2618 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2619 SrcLangExt lang = getLanguage();
2621 {
2622 if (!found) // first class
2623 {
2624 if (sliceOpt)
2625 {
2626 if (compoundType()==Interface)
2627 {
2628 ol.startMemberHeader("interfaces");
2629 }
2630 else if (compoundType()==Struct)
2631 {
2632 ol.startMemberHeader("structs");
2633 }
2634 else if (compoundType()==Exception)
2635 {
2636 ol.startMemberHeader("exceptions");
2637 }
2638 else // compoundType==Class
2639 {
2640 ol.startMemberHeader("nested-classes");
2641 }
2642 }
2643 else // non-Slice optimization: single header for class/struct/..
2644 {
2645 ol.startMemberHeader("nested-classes");
2646 }
2647 if (!header.isEmpty())
2648 {
2649 ol.parseText(header);
2650 }
2651 else if (lang==SrcLangExt::VHDL)
2652 {
2654 }
2655 else
2656 {
2657 ol.parseText(lang==SrcLangExt::Fortran ?
2658 theTranslator->trDataTypes() :
2659 theTranslator->trCompounds());
2660 }
2661 ol.endMemberHeader();
2662 ol.startMemberList();
2663 found=TRUE;
2664 }
2666 QCString ctype = compoundTypeString();
2667 QCString cname = displayName(!localNames);
2668 QCString anc = anchor();
2669 if (anc.isEmpty()) anc = cname; else anc.prepend(cname+"_");
2671
2672 if (lang!=SrcLangExt::VHDL) // for VHDL we swap the name and the type
2673 {
2674 if (isSliceLocal())
2675 {
2676 ol.writeString("local ");
2677 }
2678 ol.writeString(ctype);
2679 ol.writeString(" ");
2680 ol.insertMemberAlign();
2681 }
2682 if (isLinkable())
2683 {
2686 anchor(),
2687 cname
2688 );
2689 }
2690 else
2691 {
2692 ol.startBold();
2693 ol.docify(cname);
2694 ol.endBold();
2695 }
2696 if (lang==SrcLangExt::VHDL) // now write the type
2697 {
2698 ol.writeString(" ");
2699 ol.insertMemberAlign();
2701 }
2703
2704 // add the brief description if available
2705 if (!briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
2706 {
2707 auto parser { createDocParser() };
2708 auto ast { validatingParseDoc(*parser.get(),
2709 briefFile(),
2710 briefLine(),
2711 this,
2712 nullptr,
2714 DocOptions()
2715 .setSingleLine(true))
2716 };
2717 if (!ast->isEmpty())
2718 {
2720 ol.writeDoc(ast.get(),this,nullptr);
2721 if (isLinkableInProject())
2722 {
2723 writeMoreLink(ol,anchor());
2724 }
2726 }
2727 }
2729 }
2730}
2731
2733{
2734 StringVector sl;
2735 if (isFinal()) sl.emplace_back("final");
2736 if (isSealed()) sl.emplace_back("sealed");
2737 if (isAbstract()) sl.emplace_back("abstract");
2738 if (isExported()) sl.emplace_back("export");
2739 if (getLanguage()==SrcLangExt::IDL && isPublished()) sl.emplace_back("published");
2740
2741 for (const auto &sx : m_qualifiers)
2742 {
2743 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2744 if (!alreadyAdded)
2745 {
2746 sl.push_back(sx);
2747 }
2748 }
2749
2750 ol.pushGeneratorState();
2752 if (!sl.empty())
2753 {
2754 ol.startLabels();
2755 size_t i=0;
2756 for (const auto &s : sl)
2757 {
2758 i++;
2759 ol.writeLabel(s,i==sl.size());
2760 }
2761 ol.endLabels();
2762 }
2763 ol.popGeneratorState();
2764}
2765
2767{
2768 ol.startContents();
2769
2770 QCString pageType = " ";
2771 pageType += compoundTypeString();
2772
2773 bool exampleFlag=hasExamples();
2774
2775 //---------------------------------------- start flexible part -------------------------------
2776
2777 SrcLangExt lang = getLanguage();
2778
2779 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2780 {
2781 switch (lde->kind())
2782 {
2783 case LayoutDocEntry::BriefDesc:
2784 writeBriefDescription(ol,exampleFlag);
2785 break;
2786 case LayoutDocEntry::ClassIncludes:
2787 if (lang==SrcLangExt::Slice)
2788 {
2790 }
2791 else
2792 {
2794 }
2795 break;
2796 case LayoutDocEntry::ClassInheritanceGraph:
2798 break;
2799 case LayoutDocEntry::ClassCollaborationGraph:
2801 break;
2802 case LayoutDocEntry::ClassAllMembersLink:
2803 //writeAllMembersLink(ol); // this is now part of the summary links
2804 break;
2805 case LayoutDocEntry::MemberDeclStart:
2807 break;
2808 case LayoutDocEntry::MemberGroups:
2810 break;
2811 case LayoutDocEntry::MemberDecl:
2812 {
2813 ClassDefSet visitedClasses;
2814 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2815 if (lmd)
2816 {
2817 writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang));
2818 }
2819 }
2820 break;
2821 case LayoutDocEntry::ClassNestedClasses:
2822 {
2823 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2824 if (ls)
2825 {
2826 writeNestedClasses(ol,ls->title(lang));
2827 }
2828 }
2829 break;
2830 case LayoutDocEntry::MemberDeclEnd:
2832 break;
2833 case LayoutDocEntry::DetailedDesc:
2834 {
2835 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2836 if (ls)
2837 {
2838 writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang));
2839 }
2840 }
2841 break;
2842 case LayoutDocEntry::MemberDefStart:
2844 break;
2845 case LayoutDocEntry::ClassInlineClasses:
2847 break;
2848 case LayoutDocEntry::MemberDef:
2849 {
2850 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2851 if (lmd)
2852 {
2853 writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
2854 }
2855 }
2856 break;
2857 case LayoutDocEntry::MemberDefEnd:
2859 break;
2860 case LayoutDocEntry::ClassUsedFiles:
2861 showUsedFiles(ol);
2862 break;
2863 case LayoutDocEntry::AuthorSection:
2865 break;
2866 case LayoutDocEntry::NamespaceNestedNamespaces:
2867 case LayoutDocEntry::NamespaceNestedConstantGroups:
2868 case LayoutDocEntry::NamespaceClasses:
2869 case LayoutDocEntry::NamespaceConcepts:
2870 case LayoutDocEntry::NamespaceInterfaces:
2871 case LayoutDocEntry::NamespaceStructs:
2872 case LayoutDocEntry::NamespaceExceptions:
2873 case LayoutDocEntry::NamespaceInlineClasses:
2874 case LayoutDocEntry::ConceptDefinition:
2875 case LayoutDocEntry::FileClasses:
2876 case LayoutDocEntry::FileConcepts:
2877 case LayoutDocEntry::FileInterfaces:
2878 case LayoutDocEntry::FileStructs:
2879 case LayoutDocEntry::FileExceptions:
2880 case LayoutDocEntry::FileNamespaces:
2881 case LayoutDocEntry::FileConstantGroups:
2882 case LayoutDocEntry::FileIncludes:
2883 case LayoutDocEntry::FileIncludeGraph:
2884 case LayoutDocEntry::FileIncludedByGraph:
2885 case LayoutDocEntry::FileSourceLink:
2886 case LayoutDocEntry::FileInlineClasses:
2887 case LayoutDocEntry::GroupClasses:
2888 case LayoutDocEntry::GroupConcepts:
2889 case LayoutDocEntry::GroupModules:
2890 case LayoutDocEntry::GroupInlineClasses:
2891 case LayoutDocEntry::GroupNamespaces:
2892 case LayoutDocEntry::GroupDirs:
2893 case LayoutDocEntry::GroupNestedGroups:
2894 case LayoutDocEntry::GroupFiles:
2895 case LayoutDocEntry::GroupGraph:
2896 case LayoutDocEntry::GroupPageDocs:
2897 case LayoutDocEntry::ModuleExports:
2898 case LayoutDocEntry::ModuleClasses:
2899 case LayoutDocEntry::ModuleConcepts:
2900 case LayoutDocEntry::ModuleUsedFiles:
2901 case LayoutDocEntry::DirSubDirs:
2902 case LayoutDocEntry::DirFiles:
2903 case LayoutDocEntry::DirGraph:
2904 err("Internal inconsistency: member '{}' should not be part of LayoutDocManager::Class entry list\n",lde->entryToString());
2905 break;
2906 }
2907 }
2908
2909 ol.endContents();
2910}
2911
2913{
2914 QCString pageTitle;
2915 SrcLangExt lang = getLanguage();
2916
2917 auto getReferenceTitle = [this](std::function<QCString()> translateFunc) -> QCString
2918 {
2919 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
2920 };
2921
2922 if (lang==SrcLangExt::Fortran)
2923 {
2924 pageTitle = getReferenceTitle([this](){
2925 return theTranslator->trCompoundReferenceFortran(displayName(), m_compType, !m_tempArgs.empty());
2926 });
2927 }
2928 else if (lang==SrcLangExt::Slice)
2929 {
2930 pageTitle = getReferenceTitle([this](){
2931 return theTranslator->trCompoundReferenceSlice(displayName(), m_compType, isSliceLocal());
2932 });
2933 }
2934 else if (lang==SrcLangExt::VHDL)
2935 {
2936 pageTitle = getReferenceTitle([this](){
2937 return theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this));
2938 });
2939 }
2940 else if (lang==SrcLangExt::CSharp && !m_primaryConstructorParams.empty())
2941 {
2942 pageTitle = getReferenceTitle([this](){
2944 m_compType,
2945 !m_tempArgs.empty());
2946 });
2947 }
2948 else if (isJavaEnum())
2949 {
2950 pageTitle = getReferenceTitle([this](){
2951 return theTranslator->trEnumReference(displayName());
2952 });
2953 }
2954 else if (m_compType==Service)
2955 {
2956 pageTitle = getReferenceTitle([this](){
2957 return theTranslator->trServiceReference(displayName());
2958 });
2959 }
2960 else if (m_compType==Singleton)
2961 {
2962 pageTitle = getReferenceTitle([this](){
2963 return theTranslator->trSingletonReference(displayName());
2964 });
2965 }
2966 else
2967 {
2968 pageTitle = getReferenceTitle([this](){
2969 return theTranslator->trCompoundReference(displayName(),
2970 m_compType == Interface && getLanguage()==SrcLangExt::ObjC ? Class : m_compType,
2971 !m_tempArgs.empty());
2972 });
2973 }
2974 return pageTitle;
2975}
2976
2977// write all documentation for this class
2979{
2980 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
2981 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2982 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2983 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2984 QCString pageTitle = title();
2985
2987 if (sliceOpt)
2988 {
2989 if (compoundType()==Interface)
2990 {
2992 }
2993 else if (compoundType()==Struct)
2994 {
2996 }
2997 else if (compoundType()==Exception)
2998 {
3000 }
3001 else
3002 {
3004 }
3005 }
3006 else
3007 {
3009 }
3010
3011 AUTO_TRACE("name='{}' getOutputFileBase='{}'",name(),getOutputFileBase());
3012 bool hasAllMembersLink=false;
3013 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3014 {
3015 if (lde->kind()==LayoutDocEntry::ClassAllMembersLink)
3016 {
3017 hasAllMembersLink = true;
3018 break;
3019 }
3020 }
3021 QCString memListFile;
3022 if (hasAllMembersLink && !m_allMemberNameInfoLinkedMap.empty() && !Config_getBool(OPTIMIZE_OUTPUT_FOR_C))
3023 {
3024 memListFile = getMemberListFileName();
3025 }
3026 startFile(ol,getOutputFileBase(),false,name(),pageTitle,hli,!generateTreeView,QCString(),0,memListFile);
3027 if (!generateTreeView)
3028 {
3030 {
3032 }
3033 ol.endQuickIndices();
3034 }
3035
3036 startTitle(ol,getOutputFileBase(),this);
3037 ol.parseText(pageTitle);
3039 addGroupListToTitle(ol,this);
3041 writeDocumentationContents(ol,pageTitle);
3042
3043 endFileWithNavPath(ol,this);
3044
3045 if (Config_getBool(SEPARATE_MEMBER_PAGES))
3046 {
3047 writeMemberPages(ol);
3048 }
3049}
3050
3052{
3053 ///////////////////////////////////////////////////////////////////////////
3054 //// Member definitions on separate pages
3055 ///////////////////////////////////////////////////////////////////////////
3056
3057 ol.pushGeneratorState();
3059
3060 for (const auto &ml : m_memberLists)
3061 {
3062 if (ml->numDocMembers()>ml->numDocEnumValues() && ml->listType().isDetailed())
3063 {
3064 ml->writeDocumentationPage(ol,displayName(),this);
3065 }
3066 }
3067
3068 ol.popGeneratorState();
3069}
3070
3072{
3073 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
3074
3075 ol.writeString(" <div class=\"navtab\">\n");
3076 ol.writeString(" <table>\n");
3077
3078 for (auto &mni : m_allMemberNameInfoLinkedMap)
3079 {
3080 for (auto &mi : *mni)
3081 {
3082 const MemberDef *md=mi->memberDef();
3083 if (md->getClassDef()==this && md->isLinkable() && !md->isEnumValue())
3084 {
3085 if (md->isLinkableInProject())
3086 {
3087 if (md==currentMd) // selected item => highlight
3088 {
3089 ol.writeString(" <tr><td class=\"navtabHL\">");
3090 }
3091 else
3092 {
3093 ol.writeString(" <tr><td class=\"navtab\">");
3094 }
3095 ol.writeString("<span class=\"label\"><a ");
3096 ol.writeString("href=\"");
3097 if (createSubDirs) ol.writeString("../../");
3098 QCString url = md->getOutputFileBase();
3100 ol.writeString(url+"#"+md->anchor());
3101 ol.writeString("\">");
3102 ol.writeString(convertToHtml(md->name()));
3103 ol.writeString("</a></span>");
3104 ol.writeString("</td></tr>\n");
3105 }
3106 }
3107 }
3108 }
3109
3110 ol.writeString(" </table>\n");
3111 ol.writeString(" </div>\n");
3112}
3113
3114
3115
3117{
3118 // write inner classes after the parent, so the tag files contain
3119 // the definition in proper order!
3120 for (const auto &innerCd : m_innerClasses)
3121 {
3122 if (
3123 innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
3124 protectionLevelVisible(innerCd->protection()) &&
3125 !innerCd->isEmbeddedInOuterScope()
3126 )
3127 {
3128 msg("Generating docs for nested compound {}...\n",innerCd->displayName());
3129 innerCd->writeDocumentation(ol);
3130 innerCd->writeMemberList(ol);
3131 }
3132 innerCd->writeDocumentationForInnerClasses(ol);
3133 }
3134}
3135
3136// write the list of all (inherited) members for this class
3138{
3139 bool cOpt = Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
3140 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3141 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3142 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3143 if (m_allMemberNameInfoLinkedMap.empty() || cOpt) return;
3144 // only for HTML
3145 ol.pushGeneratorState();
3147
3149 if (sliceOpt)
3150 {
3151 if (compoundType()==Interface)
3152 {
3154 }
3155 else if (compoundType()==Struct)
3156 {
3158 }
3159 else if (compoundType()==Exception)
3160 {
3162 }
3163 else
3164 {
3166 }
3167 }
3168 else
3169 {
3171 }
3172
3173 QCString memListFile = getMemberListFileName();
3174 startFile(ol,memListFile,false,memListFile,theTranslator->trMemberList(),hli,!generateTreeView,getOutputFileBase());
3175 if (!generateTreeView)
3176 {
3178 {
3180 }
3181 ol.endQuickIndices();
3182 }
3183 startTitle(ol,QCString());
3184 ol.parseText(displayName()+" "+theTranslator->trMemberList());
3185 endTitle(ol,QCString(),QCString());
3186 ol.startContents();
3187 ol.startParagraph();
3188 ol.parseText(theTranslator->trThisIsTheListOfAllMembers());
3189 ol.docify(" ");
3191 ol.parseText(theTranslator->trIncludingInheritedMembers());
3192 ol.endParagraph();
3193
3194 //ol.startItemList();
3195
3196 bool first = true; // to prevent empty table
3197 int idx=0;
3198 for (auto &mni : m_allMemberNameInfoLinkedMap)
3199 {
3200 for (auto &mi : *mni)
3201 {
3202 const MemberDef *md=mi->memberDef();
3203 const ClassDef *cd=md->getClassDef();
3204 Protection prot = mi->prot();
3205 Specifier virt=md->virtualness();
3206
3207 //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n",
3208 // qPrint(name()),qPrint(md->name()),qPrint(cd->name()),md->protection(),mi->prot,prot,mi->inherited);
3209
3210 if (cd && !md->name().isEmpty() && !md->isAnonymous())
3211 {
3212 bool memberWritten=FALSE;
3213 if (cd->isLinkable() && md->isLinkable())
3214 // create a link to the documentation
3215 {
3216 QCString name=mi->ambiguityResolutionScope()+md->name();
3217 //ol.writeListItem();
3218 if (first)
3219 {
3220 ol.writeString("<table class=\"directory\">\n");
3221 first = false;
3222 }
3223 ol.writeString(" <tr");
3224 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3225 idx++;
3226 ol.writeString("><td class=\"entry\">");
3227 if (cd->isObjectiveC())
3228 {
3229 if (md->isObjCMethod())
3230 {
3231 if (md->isStatic())
3232 ol.writeString("+&#160;</td><td>");
3233 else
3234 ol.writeString("-&#160;</td><td>");
3235 }
3236 else
3237 ol.writeString("</td><td class=\"entry\">");
3238 }
3239 if (md->isObjCMethod())
3240 {
3242 md->getOutputFileBase(),
3243 md->anchor(),md->name());
3244 }
3245 else
3246 {
3247 //Definition *bd = md->getGroupDef();
3248 //if (bd==nullptr) bd=cd;
3250 md->getOutputFileBase(),
3251 md->anchor(),name);
3252
3253 if ( md->isFunction() || md->isSignal() || md->isSlot() ||
3254 (md->isFriend() && !md->argsString().isEmpty()))
3255 ol.docify(md->argsString());
3256 else if (md->isEnumerate())
3257 ol.parseText(" "+theTranslator->trEnumName());
3258 else if (md->isEnumValue())
3259 ol.parseText(" "+theTranslator->trEnumValue());
3260 else if (md->isTypedef())
3261 ol.docify(" typedef");
3262 else if (md->isFriend() && md->typeString()=="friend class")
3263 ol.docify(" class");
3264 //ol.writeString("\n");
3265 }
3266 ol.writeString("</td>");
3267 memberWritten=TRUE;
3268 }
3269 else if (!cd->isArtificial() &&
3270 !Config_getBool(HIDE_UNDOC_MEMBERS) &&
3272 ) // no documentation,
3273 // generate link to the class instead.
3274 {
3275 //ol.writeListItem();
3276 if (first)
3277 {
3278 ol.writeString("<table class=\"directory\">\n");
3279 first = false;
3280 }
3281 ol.writeString(" <tr bgcolor=\"#f0f0f0\"");
3282 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3283 idx++;
3284 ol.writeString("><td class=\"entry\">");
3285 if (cd->isObjectiveC())
3286 {
3287 if (md->isObjCMethod())
3288 {
3289 if (md->isStatic())
3290 ol.writeString("+&#160;</td><td class=\"entry\">");
3291 else
3292 ol.writeString("-&#160;</td><td class=\"entry\">");
3293 }
3294 else
3295 ol.writeString("</td><td class=\"entry\">");
3296 }
3297 ol.startBold();
3298 ol.docify(md->name());
3299 ol.endBold();
3300 if (!md->isObjCMethod())
3301 {
3302 if ( md->isFunction() || md->isSignal() || md->isSlot() )
3303 ol.docify(md->argsString());
3304 else if (md->isEnumerate())
3305 ol.parseText(" "+theTranslator->trEnumName());
3306 else if (md->isEnumValue())
3307 ol.parseText(" "+theTranslator->trEnumValue());
3308 else if (md->isTypedef())
3309 ol.docify(" typedef");
3310 }
3311 ol.writeString(" (");
3312 ol.parseText(theTranslator->trDefinedIn()+" ");
3313 if (cd->isLinkable())
3314 {
3315 ol.writeObjectLink(
3316 cd->getReference(),
3317 cd->getOutputFileBase(),
3318 cd->anchor(),
3319 cd->displayName());
3320 }
3321 else
3322 {
3323 ol.startBold();
3324 ol.docify(cd->displayName());
3325 ol.endBold();
3326 }
3327 ol.writeString(")");
3328 ol.writeString("</td>");
3329 memberWritten=TRUE;
3330 }
3331 if (memberWritten)
3332 {
3333 ol.writeString("<td class=\"entry\">");
3335 cd->getOutputFileBase(),
3336 cd->anchor(),
3337 md->category() ?
3338 md->category()->displayName() :
3339 cd->displayName());
3340 ol.writeString("</td>");
3341 ol.writeString("<td class=\"entry\">");
3342 }
3343 SrcLangExt lang = md->getLanguage();
3344 if (
3345 (prot!=Protection::Public || (virt!=Specifier::Normal && getLanguage()!=SrcLangExt::ObjC) ||
3346 md->isFriend() || md->isRelated() || md->isExplicit() ||
3347 md->isMutable() || (md->isInline() && Config_getBool(INLINE_INFO)) ||
3348 md->isSignal() || md->isSlot() || md->isThreadLocal() ||
3349 (getLanguage()==SrcLangExt::IDL &&
3350 (md->isOptional() || md->isAttribute() || md->isUNOProperty())) ||
3351 md->isStatic() || lang==SrcLangExt::VHDL
3352 )
3353 && memberWritten)
3354 {
3355 StringVector sl;
3356 if (lang==SrcLangExt::VHDL)
3357 {
3358 sl.push_back(theTranslator->trVhdlType(md->getVhdlSpecifiers(),TRUE).str()); //append vhdl type
3359 }
3360 else if (md->isFriend()) sl.emplace_back("friend");
3361 else if (md->isRelated()) sl.emplace_back("related");
3362 else
3363 {
3364 if (Config_getBool(INLINE_INFO) && md->isInline())
3365 sl.emplace_back("inline");
3366 if (md->isExplicit()) sl.emplace_back("explicit");
3367 if (md->isMutable()) sl.emplace_back("mutable");
3368 if (md->isThreadLocal()) sl.emplace_back("thread_local");
3369 if (prot==Protection::Protected) sl.emplace_back("protected");
3370 else if (prot==Protection::Private) sl.emplace_back("private");
3371 else if (prot==Protection::Package) sl.emplace_back("package");
3372 if (virt==Specifier::Virtual && getLanguage()!=SrcLangExt::ObjC)
3373 sl.emplace_back("virtual");
3374 else if (virt==Specifier::Pure) sl.emplace_back("pure virtual");
3375 if (md->isStatic()) sl.emplace_back("static");
3376 if (md->isSignal()) sl.emplace_back("signal");
3377 if (md->isSlot()) sl.emplace_back("slot");
3378// this is the extra member page
3379 if (md->isOptional()) sl.emplace_back("optional");
3380 if (md->isAttribute()) sl.emplace_back("attribute");
3381 if (md->isUNOProperty()) sl.emplace_back("property");
3382 if (md->isReadonly()) sl.emplace_back("readonly");
3383 if (md->isBound()) sl.emplace_back("bound");
3384 if (md->isRemovable()) sl.emplace_back("removable");
3385 if (md->isConstrained()) sl.emplace_back("constrained");
3386 if (md->isTransient()) sl.emplace_back("transient");
3387 if (md->isMaybeVoid()) sl.emplace_back("maybevoid");
3388 if (md->isMaybeDefault()) sl.emplace_back("maybedefault");
3389 if (md->isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
3390 }
3391 bool firstSpan=true;
3392 for (const auto &s : sl)
3393 {
3394 if (!firstSpan)
3395 {
3396 ol.writeString("</span><span class=\"mlabel\">");
3397 }
3398 else
3399 {
3400 ol.writeString("<span class=\"mlabel\">");
3401 firstSpan=false;
3402 }
3403 ol.docify(s);
3404 }
3405 if (!firstSpan) ol.writeString("</span>");
3406 }
3407 if (memberWritten)
3408 {
3409 ol.writeString("</td>");
3410 ol.writeString("</tr>\n");
3411 }
3412 }
3413 }
3414 }
3415 //ol.endItemList();
3416
3417 if (!first) ol.writeString("</table>");
3418
3419 endFile(ol);
3420 ol.popGeneratorState();
3421}
3422
3423// add a reference to an example
3424bool ClassDefImpl::addExample(const QCString &anchor,const QCString &nameStr, const QCString &file)
3425{
3426 return m_examples.inSort(Example(anchor,nameStr,file));
3427}
3428
3429// returns TRUE if this class is used in an example
3431{
3432 return !m_examples.empty();
3433}
3434
3435void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCString &type)
3436{
3437 //printf("addTypeConstraint(%s,%s)\n",qPrint(type),qPrint(typeConstraint));
3438 bool hideUndocRelation = Config_getBool(HIDE_UNDOC_RELATIONS);
3439 if (typeConstraint.isEmpty() || type.isEmpty()) return;
3440 SymbolResolver resolver(getFileDef());
3441 ClassDefMutable *cd = resolver.resolveClassMutable(this,typeConstraint);
3442 if (cd==nullptr && !hideUndocRelation)
3443 {
3444 cd = toClassDefMutable(
3445 Doxygen::hiddenClassLinkedMap->add(typeConstraint,
3446 std::unique_ptr<ClassDef>(
3447 new ClassDefImpl(
3449 getDefColumn(),
3450 typeConstraint,
3451 ClassDef::Class))));
3452 if (cd)
3453 {
3454 cd->setUsedOnly(TRUE);
3455 cd->setLanguage(getLanguage());
3456 //printf("Adding undocumented constraint '%s' to class %s on type %s\n",
3457 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3458 }
3459 }
3460 if (cd)
3461 {
3462 auto it = std::find_if(m_constraintClassList.begin(),
3464 [&cd](const auto &ccd) { return ccd.classDef==cd; });
3465
3466 if (it==m_constraintClassList.end())
3467 {
3468 m_constraintClassList.emplace_back(cd);
3469 it = m_constraintClassList.end()-1;
3470 }
3471 (*it).addAccessor(type);
3472 //printf("Adding constraint '%s' to class %s on type %s\n",
3473 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3474 }
3475}
3476
3477// Java Type Constrains: A<T extends C & I>
3479{
3480 for (const Argument &a : m_tempArgs)
3481 {
3482 if (!a.typeConstraint.isEmpty())
3483 {
3484 QCString typeConstraint;
3485 int i=0,p=0;
3486 while ((i=a.typeConstraint.find('&',p))!=-1) // typeConstraint="A &I" for C<T extends A & I>
3487 {
3488 typeConstraint = a.typeConstraint.mid(p,i-p).stripWhiteSpace();
3489 addTypeConstraint(typeConstraint,a.type);
3490 p=i+1;
3491 }
3492 typeConstraint = a.typeConstraint.right(a.typeConstraint.length()-p).stripWhiteSpace();
3493 addTypeConstraint(typeConstraint,a.type);
3494 }
3495 }
3496}
3497
3498// C# Type Constraints: D<T> where T : C, I
3503
3505{
3506 m_tempArgs = al;
3507}
3508
3509static bool hasNonReferenceSuperClassRec(const ClassDef *cd,int level)
3510{
3511 bool found=!cd->isReference() && cd->isLinkableInProject() && !cd->isHidden();
3512 if (found)
3513 {
3514 return TRUE; // we're done if this class is not a reference
3515 }
3516 for (const auto &ibcd : cd->subClasses())
3517 {
3518 const ClassDef *bcd=ibcd.classDef;
3519 if (level>256)
3520 {
3521 err("Possible recursive class relation while inside {} and looking for base class {}\n",cd->name(),bcd->name());
3522 return FALSE;
3523 }
3524 // recurse into the super class branch
3525 found = found || hasNonReferenceSuperClassRec(bcd,level+1);
3526 if (!found)
3527 {
3528 // look for template instances that might have non-reference super classes
3529 for (const auto &cil : bcd->getTemplateInstances())
3530 {
3531 // recurse into the template instance branch
3532 found = hasNonReferenceSuperClassRec(cil.classDef,level+1);
3533 if (found) break;
3534 }
3535 }
3536 else
3537 {
3538 break;
3539 }
3540 }
3541 return found;
3542}
3543
3544/*! Returns \c TRUE iff this class or a class inheriting from this class
3545 * is \e not defined in an external tag file.
3546 */
3548{
3549 return hasNonReferenceSuperClassRec(this,0);
3550}
3551
3556
3558{
3559 m_requiresClause = req;
3560}
3561
3566
3567/*! called from MemberDef::writeDeclaration() to (recursively) write the
3568 * definition of an anonymous struct, union or class.
3569 */
3570void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,int indentLevel,
3571 const ClassDef *inheritedFrom,const QCString &inheritId) const
3572{
3573 //printf("ClassName='%s' inGroup=%d\n",qPrint(name()),inGroup);
3574
3577 if (!cn.isEmpty())
3578 {
3579 ol.docify(" ");
3580 if (md && isLinkable())
3581 {
3582 ol.writeObjectLink(QCString(),QCString(),md->anchor(),cn);
3583 }
3584 else
3585 {
3586 ol.startBold();
3587 ol.docify(cn);
3588 ol.endBold();
3589 }
3590 }
3591 ol.docify(" {");
3593 ol.endMemberDeclaration(md ? md->anchor() : QCString(),inheritId);
3594
3595 // write user defined member groups
3596 for (const auto &mg : m_memberGroups)
3597 {
3598 mg->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
3599 }
3600
3601 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3602 {
3603 if (lde->kind()==LayoutDocEntry::MemberDecl)
3604 {
3605 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
3606 if (lmd)
3607 {
3608 writePlainMemberDeclaration(ol,lmd->type,inGroup,indentLevel,inheritedFrom,inheritId);
3609 }
3610 }
3611 }
3612}
3613
3614/*! a link to this class is possible within this project */
3616{
3617 bool extractLocal = Config_getBool(EXTRACT_LOCAL_CLASSES);
3618 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3619 bool hideUndoc = Config_getBool(HIDE_UNDOC_CLASSES);
3621 {
3622 return m_templateMaster->isLinkableInProject();
3623 }
3624 else
3625 {
3626 //printf("%s::isLinkableInProject() conditions: artificial=%d hidden=%d anonymous=%d protection=%d local=%d docs=%d static=%d ref=%d\n",
3627 // qPrint(name()),
3628 // !isArtificial(),
3629 // !isHidden(),
3630 // !isAnonymous(),
3631 // m_prot,
3632 // !m_isLocal || extractLocal,
3633 // hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc,
3634 // !m_isStatic || extractStatic,
3635 // !isReference());
3636 return
3637 !isArtificial() && !isHidden() && /* not hidden */
3638 !isAnonymous() && /* not anonymous */
3639 protectionLevelVisible(m_prot) && /* private/internal */
3640 (!m_isLocal || extractLocal) && /* local */
3641 (hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc) && /* documented */
3642 (!m_isStatic || extractStatic) && /* static */
3643 !isReference(); /* not an external reference */
3644 }
3645}
3646
3648{
3650 {
3651 return m_templateMaster->isLinkable();
3652 }
3653 else
3654 {
3655 return isReference() || isLinkableInProject();
3656 }
3657}
3658
3659
3660/*! the class is visible in a class diagram, or class hierarchy */
3662{
3663 bool allExternals = Config_getBool(ALLEXTERNALS);
3664 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
3665 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3666
3667 return // show all classes or a subclass is visible
3668 ((allExternals && !isArtificial()) || hasNonReferenceSuperClass()) &&
3669 // and not an anonymous compound
3670 !isAnonymous() &&
3671 // and not privately inherited
3673 // documented or shown anyway or documentation is external
3674 (hasDocumentation() ||
3675 !hideUndocClasses ||
3676 (m_templateMaster && m_templateMaster->hasDocumentation()) ||
3677 isReference()
3678 ) &&
3679 // if this is an implicit template instance then it most be part of the inheritance hierarchy
3680 (!m_implicitTemplateInstance || !m_inherits.empty() || !m_inheritedBy.empty()) &&
3681 // is not part of an unnamed namespace or shown anyway
3682 (!m_isStatic || extractStatic);
3683}
3684
3689
3690//----------------------------------------------------------------------
3691// recursive function:
3692// returns the distance to the base class definition 'bcd' represents an (in)direct base
3693// class of class definition 'cd' or nullptr if it does not.
3694
3695int ClassDefImpl::isBaseClass(const ClassDef *bcd, bool followInstances,const QCString &templSpec) const
3696{
3697 int distance=0;
3698 //printf("isBaseClass(cd=%s) looking for %s templSpec=%s\n",qPrint(name()),qPrint(bcd->name()),qPrint(templSpec));
3699 for (const auto &bclass : baseClasses())
3700 {
3701 const ClassDef *ccd = bclass.classDef;
3702 if (!followInstances && ccd->templateMaster())
3703 {
3704 ccd=ccd->templateMaster();
3705 }
3706 if (ccd==bcd && (templSpec.isEmpty() || templSpec==bclass.templSpecifiers))
3707 {
3708 distance=1;
3709 break; // no shorter path possible
3710 }
3711 else
3712 {
3713 int d = ccd->isBaseClass(bcd,followInstances,templSpec);
3714 if (d>256)
3715 {
3716 err("Possible recursive class relation while inside {} and looking for base class {}\n",name(),bcd->name());
3717 return 0;
3718 }
3719 else if (d>0) // path found
3720 {
3721 if (distance==0 || d+1<distance) // update if no path found yet or shorter path found
3722 {
3723 distance=d+1;
3724 }
3725 }
3726 }
3727 }
3728 return distance;
3729}
3730
3731//----------------------------------------------------------------------
3732
3733bool ClassDefImpl::isSubClass(ClassDef *cd,int level) const
3734{
3735 bool found=FALSE;
3736 if (level>256)
3737 {
3738 err("Possible recursive class relation while inside {} and looking for derived class {}\n",name(),cd->name());
3739 return FALSE;
3740 }
3741 for (const auto &iscd : subClasses())
3742 {
3743 ClassDef *ccd=iscd.classDef;
3744 found = (ccd==cd) || ccd->isSubClass(cd,level+1);
3745 if (found) break;
3746 }
3747 return found;
3748}
3749
3750//----------------------------------------------------------------------------
3751
3752static bool isStandardFunc(const MemberDef *md)
3753{
3754 return md->name()=="operator=" || // assignment operator
3755 md->isConstructor() || // constructor
3756 md->isDestructor(); // destructor
3757}
3758
3759void ClassDefImpl::mergeMembersFromBaseClasses(bool mergeVirtualBaseClass)
3760{
3761 SrcLangExt lang = getLanguage();
3763 size_t sepLen = sep.length();
3764 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
3765 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
3766
3767 //printf(" mergeMembers for %s mergeVirtualBaseClass=%d\n",qPrint(name()),mergeVirtualBaseClass);
3768 // the merge the base members with this class' members
3769 for (const auto &bcd : baseClasses())
3770 {
3771 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
3772 if (bClass)
3773 {
3774 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
3776
3777 for (auto &srcMni : srcMnd)
3778 {
3779 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
3780 if (dstMni)
3781 // a member with that name is already in the class.
3782 // the member may hide or reimplement the one in the sub class
3783 // or there may be another path to the base class that is already
3784 // visited via another branch in the class hierarchy.
3785 {
3786 //printf(" %s hides member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
3787 for (auto &srcMi : *srcMni)
3788 {
3789 MemberDef *srcMd = srcMi->memberDef();
3790 bool found=FALSE;
3791 bool ambiguous=FALSE;
3792 bool hidden=FALSE;
3793 const ClassDef *srcCd = srcMd->getClassDef();
3794 for (auto &dstMi : *dstMni)
3795 {
3796 const MemberDef *dstMd = dstMi->memberDef();
3797 if (srcMd!=dstMd) // different members
3798 {
3799 const ClassDef *dstCd = dstMd->getClassDef();
3800 //printf(" Is %s a base class of %s?\n",qPrint(srcCd->name()),qPrint(dstCd->name()));
3801 if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE))
3802 // member is in the same or a base class
3803 {
3804 const ArgumentList &srcAl = srcMd->argumentList();
3805 const ArgumentList &dstAl = dstMd->argumentList();
3806 found=matchArguments2(
3807 srcMd->getOuterScope(),srcMd->getFileDef(),srcMd->typeString(),&srcAl,
3808 dstMd->getOuterScope(),dstMd->getFileDef(),dstMd->typeString(),&dstAl,
3809 TRUE,lang
3810 );
3811 //printf(" Yes, matching (%s<->%s): %d\n",
3812 // qPrint(argListToString(srcMd->argumentList())),
3813 // qPrint(argListToString(dstMd->argumentList())),
3814 // found);
3815 hidden = hidden || !found;
3816 }
3817 else // member is in a non base class => multiple inheritance
3818 // using the same base class.
3819 {
3820 //printf(" $$ Existing member %s %s add scope %s\n",
3821 // qPrint(dstMi->ambiguityResolutionScope()),
3822 // qPrint(dstMd->name()),
3823 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3824
3825 QCString scope=dstMi->scopePath().left(dstMi->scopePath().find(sep)+sepLen);
3826 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3827 {
3828 dstMi->setAmbiguityResolutionScope(scope+dstMi->ambiguityResolutionScope());
3829 }
3830 ambiguous=TRUE;
3831 }
3832 }
3833 else // same members
3834 {
3835 // do not add if base class is virtual or
3836 // if scope paths are equal or
3837 // if base class is an interface (and thus implicitly virtual).
3838 //printf(" same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt(),dstMi->virt());
3839 if ((srcMi->virt()!=Specifier::Normal && dstMi->virt()!=Specifier::Normal) ||
3840 bClass->name()+sep+srcMi->scopePath() == dstMi->scopePath() ||
3842 )
3843 {
3844 found=TRUE;
3845 }
3846 else // member can be reached via multiple paths in the
3847 // inheritance tree
3848 {
3849 //printf(" $$ Existing member %s %s add scope %s\n",
3850 // qPrint(dstMi->ambiguityResolutionScope()),
3851 // qPrint(dstMd->name()),
3852 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3853
3854 QCString scope=dstMi->scopePath().left(dstMi->scopePath().find(sep)+sepLen);
3855 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3856 {
3857 dstMi->setAmbiguityResolutionScope(dstMi->ambiguityResolutionScope()+scope);
3858 }
3859 ambiguous=TRUE;
3860 }
3861 }
3862 if (found) break;
3863 }
3864 //printf(" member %s::%s hidden %d ambiguous %d srcMi->ambigClass=%p found=%d\n",
3865 // qPrint(srcCd->name()),qPrint(srcMd->name()),hidden,ambiguous,
3866 // (void*)srcMi->ambigClass(),found);
3867
3868 // TODO: fix the case where a member is hidden by inheritance
3869 // of a member with the same name but with another prototype,
3870 // while there is more than one path to the member in the
3871 // base class due to multiple inheritance. In this case
3872 // it seems that the member is not reachable by prefixing a
3873 // scope name either (according to my compiler). Currently,
3874 // this case is shown anyway.
3875 if (!found && srcMd->protection()!=Protection::Private && !srcMd->isFriend() &&
3876 srcMi->virtualBaseClass()==mergeVirtualBaseClass && lang!=SrcLangExt::Python)
3877 {
3878 Protection prot = srcMd->protection();
3879 if (bcd.prot==Protection::Protected && prot==Protection::Public)
3880 {
3881 prot = bcd.prot;
3882 }
3883 else if (bcd.prot==Protection::Private)
3884 {
3885 prot = bcd.prot;
3886 }
3887
3888 if (inlineInheritedMembers)
3889 {
3890 if (!isStandardFunc(srcMd))
3891 {
3892 //printf(" %s::insertMember(%s)\n",qPrint(name()),qPrint(srcMd->name()));
3893 internalInsertMember(srcMd,prot,FALSE);
3894 }
3895 }
3896
3897 Specifier virt=srcMi->virt();
3898 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
3899 bool virtualBaseClass = bcd.virt!=Specifier::Normal;
3900
3901 auto newMi = std::make_unique<MemberInfo>(srcMd,prot,virt,TRUE,virtualBaseClass);
3902 newMi->setScopePath(bClass->name()+sep+srcMi->scopePath());
3903 if (ambiguous)
3904 {
3905 //printf("$$ New member %s %s add scope %s::\n",
3906 // qPrint(srcMi->ambiguityResolutionScope),
3907 // qPrint(srcMd->name()),
3908 // qPrint(bClass->name()));
3909
3910 QCString scope=bClass->name()+sep;
3911 if (scope!=srcMi->ambiguityResolutionScope().left(scope.length()))
3912 {
3913 newMi->setAmbiguityResolutionScope(scope+srcMi->ambiguityResolutionScope());
3914 }
3915 }
3916 if (hidden)
3917 {
3918 if (srcMi->ambigClass()==nullptr)
3919 {
3920 newMi->setAmbigClass(bClass);
3921 newMi->setAmbiguityResolutionScope(bClass->name()+sep);
3922 }
3923 else
3924 {
3925 newMi->setAmbigClass(srcMi->ambigClass());
3926 newMi->setAmbiguityResolutionScope(srcMi->ambigClass()->name()+sep);
3927 }
3928 }
3929 dstMni->push_back(std::move(newMi));
3930 }
3931 }
3932 }
3933 else // base class has a member that is not in the sub class => copy
3934 {
3935 //printf(" %s adds member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
3936 // create a deep copy of the list (only the MemberInfo's will be
3937 // copied, not the actual MemberDef's)
3938 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
3939
3940 // copy the member(s) from the base to the sub class
3941 for (auto &mi : *srcMni)
3942 {
3943 if (mi->virtualBaseClass()==mergeVirtualBaseClass && !mi->memberDef()->isFriend()) // don't inherit friends
3944 {
3945 Protection prot = mi->prot();
3946 if (bcd.prot==Protection::Protected)
3947 {
3948 if (prot==Protection::Public) prot=Protection::Protected;
3949 }
3950 else if (bcd.prot==Protection::Private)
3951 {
3952 prot=Protection::Private;
3953 }
3954 Specifier virt=mi->virt();
3955 bool virtualBaseClass = bcd.virt!=Specifier::Normal || mi->virtualBaseClass();
3956 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
3957 //printf(" %s::%s: [mi.prot=%d, bcd.prot=%d => prot=%d], [mi.virt=%d, bcd.virt=%d => virt=%d] virtualBase=%d\n",
3958 // qPrint(name()),qPrint(mi->memberDef()->name()),
3959 // mi->prot(),bcd.prot,prot,
3960 // mi->virt(),bcd.virt,virt,
3961 // virtualBaseClass
3962 // );
3963
3964 if (prot!=Protection::Private || extractPrivate)
3965 {
3966
3967 if (inlineInheritedMembers)
3968 {
3969 if (!isStandardFunc(mi->memberDef()))
3970 {
3971 //printf(" %s::insertMember '%s'\n",qPrint(name()),qPrint(mi->memberDef()->name()));
3972 internalInsertMember(mi->memberDef(),prot,FALSE);
3973 }
3974 }
3975 //printf("Adding!\n");
3976 std::unique_ptr<MemberInfo> newMi = std::make_unique<MemberInfo>(mi->memberDef(),prot,virt,TRUE,virtualBaseClass);
3977 newMi->setScopePath(bClass->name()+sep+mi->scopePath());
3978 newMi->setAmbigClass(mi->ambigClass());
3979 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
3980 newMni->push_back(std::move(newMi));
3981 }
3982 }
3983 }
3984 }
3985 }
3986 }
3987 }
3988}
3989
3990// See issue11260, referring to a variable in a base class will make doxygen
3991// add it as a member to the derived class, but this is not correct for non-private variables
3992// so we correct this here, now we know the inheritance hierarchy
3994{
3995 //printf("hideDerivedVariableInPython()\n");
3996 if (bClass)
3997 {
3998 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
4000
4001 // recurse up the inheritance hierarchy
4002 for (const auto &bcd : bClass->baseClasses())
4003 {
4005 }
4006
4007 for (auto &srcMni : srcMnd) // for each member in a base class
4008 {
4009 //printf(" candidate(%s)\n",qPrint(srcMni->memberName()));
4010 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4011 if (dstMni) // that is also in this class
4012 {
4014 //printf("%s member in %s and %s\n",qPrint(name()),qPrint(bClass->name()),qPrint(name()));
4015 for (it=dstMni->begin();it!=dstMni->end();)
4016 {
4017 MemberDefMutable *dstMd = toMemberDefMutable((*it)->memberDef());
4018 if (dstMd && dstMd->isVariable() && !dstMd->name().startsWith("__"))
4019 {
4020 //printf(" hiding member %s\n",qPrint(dstMd->name()));
4021 // hide a member variable if it is already defined in a base class, unless
4022 // it is a __private variable
4023 removeMemberFromLists(dstMd);
4024 it = dstMni->erase(it);
4025 }
4026 else
4027 {
4028 ++it;
4029 }
4030 }
4031 if (dstMni->empty()) // if the list has become empty, remove the entry from the dictionary
4032 {
4033 dstMnd.del(srcMni->memberName());
4034 }
4035 }
4036 }
4037 }
4038}
4039
4040/*!
4041 * recursively merges the 'all members' lists of a class base
4042 * with that of this class. Must only be called for classes without
4043 * subclasses!
4044 */
4046{
4047 if (m_membersMerged) return;
4048 if (getLanguage()==SrcLangExt::Python)
4049 {
4050 for (const auto &bcd : baseClasses())
4051 {
4052 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4054 }
4055 }
4056
4057 //printf("> %s::mergeMembers()\n",qPrint(name()));
4058
4060
4061 // first merge the members of the base class recursively
4062 for (const auto &bcd : baseClasses())
4063 {
4064 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4065 if (bClass)
4066 {
4067 // merge the members in the base class of this inheritance branch first
4068 bClass->mergeMembers();
4069 }
4070 }
4071
4072 // first merge the member that are not inherited via a virtual base class
4073 // (as this can end up reimplemented via multiple paths, see #10717 for examples)
4075 // then process the member that are inherited via a virtual base class to add the
4076 // ones that are not reimplemented via any path
4078
4079 //printf("< %s::mergeMembers()\n",qPrint(name()));
4080}
4081
4082//----------------------------------------------------------------------------
4083
4084/*! Merges the members of a Objective-C category into this class.
4085 */
4087{
4088 AUTO_TRACE();
4089 ClassDefMutable *category = toClassDefMutable(cat);
4090 if (category)
4091 {
4092 bool extractLocalMethods = Config_getBool(EXTRACT_LOCAL_METHODS);
4093 bool makePrivate = category->isLocal();
4094 // in case extract local methods is not enabled we don't add the methods
4095 // of the category in case it is defined in the .m file.
4096 if (makePrivate && !extractLocalMethods) return;
4097 bool isExtension = category->isExtension();
4098
4099 category->setCategoryOf(this);
4100 if (isExtension)
4101 {
4102 category->setArtificial(TRUE);
4103
4104 // copy base classes/protocols from extension
4105 for (const auto &bcd : category->baseClasses())
4106 {
4107 insertBaseClass(bcd.classDef,bcd.usedName,bcd.prot,bcd.virt,bcd.templSpecifiers);
4108 // correct bcd.classDef so that they do no longer derive from
4109 // category, but from this class!
4110 BaseClassList scl = bcd.classDef->subClasses();
4111 for (auto &scd : scl)
4112 {
4113 if (scd.classDef==category)
4114 {
4115 scd.classDef=this;
4116 }
4117 }
4118 bcd.classDef->updateSubClasses(scl);
4119 }
4120 }
4121 // make methods private for categories defined in the .m file
4122 //printf("%s::mergeCategory makePrivate=%d\n",qPrint(name()),makePrivate);
4123
4124 const MemberNameInfoLinkedMap &srcMnd = category->memberNameInfoLinkedMap();
4126
4127 for (auto &srcMni : srcMnd)
4128 {
4129 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4130 if (dstMni) // method is already defined in the class
4131 {
4132 AUTO_TRACE_ADD("Existing member {}",srcMni->memberName());
4133 const auto &dstMi = dstMni->front();
4134 const auto &srcMi = srcMni->front();
4135 if (srcMi && dstMi)
4136 {
4137 MemberDefMutable *smdm = toMemberDefMutable(srcMi->memberDef());
4138 MemberDefMutable *dmdm = toMemberDefMutable(dstMi->memberDef());
4139 if (smdm && dmdm)
4140 {
4142 dmdm->setCategory(category);
4143 dmdm->setCategoryRelation(smdm);
4144 smdm->setCategoryRelation(dmdm);
4145 }
4146 }
4147 }
4148 else // new method name
4149 {
4150 AUTO_TRACE_ADD("New member {}",srcMni->memberName());
4151 // create a deep copy of the list
4152 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
4153
4154 // copy the member(s) from the category to this class
4155 for (auto &mi : *srcMni)
4156 {
4157 //printf("Adding '%s'\n",qPrint(mi->memberDef->name()));
4158 Protection prot = mi->prot();
4159 //if (makePrivate) prot = Private;
4160 auto newMd = mi->memberDef()->deepCopy();
4161 if (newMd)
4162 {
4163 auto mmd = toMemberDefMutable(newMd.get());
4164 AUTO_TRACE_ADD("Copying member {}",mmd->name());
4165 mmd->moveTo(this);
4166
4167 auto newMi=std::make_unique<MemberInfo>(newMd.get(),prot,mi->virt(),mi->inherited(),mi->virtualBaseClass());
4168 newMi->setScopePath(mi->scopePath());
4169 newMi->setAmbigClass(mi->ambigClass());
4170 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
4171 newMni->push_back(std::move(newMi));
4172
4173 // also add the newly created member to the global members list
4174
4175 QCString name = newMd->name();
4177
4178 mmd->setCategory(category);
4179 mmd->setCategoryRelation(mi->memberDef());
4180 auto miMmd = toMemberDefMutable(mi->memberDef());
4181 if (miMmd) miMmd->setCategoryRelation(newMd.get());
4182
4183 if (makePrivate || isExtension)
4184 {
4185 mmd->makeImplementationDetail();
4186 }
4187 internalInsertMember(newMd.get(),prot,FALSE);
4188 mn->push_back(std::move(newMd));
4189 }
4190 }
4191 }
4192 }
4193 }
4194}
4195
4196//----------------------------------------------------------------------------
4197
4199 Protection prot)
4200{
4201 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4202 bool umlLook = Config_getBool(UML_LOOK);
4203 if (prot==Protection::Private && !extractPrivate) return;
4204 //printf("%s::addUsedClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4205
4206 auto it = std::find_if(m_usesImplClassList.begin(),
4207 m_usesImplClassList.end(),
4208 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4209 if (it==m_usesImplClassList.end())
4210 {
4211 m_usesImplClassList.emplace_back(cd);
4212 //printf("Adding used class %s to class %s via accessor %s\n",
4213 // qPrint(cd->name()),qPrint(name()),accessName);
4214 it = m_usesImplClassList.end()-1;
4215 }
4216 QCString acc = accessName;
4217 if (umlLook)
4218 {
4219 switch(prot)
4220 {
4221 case Protection::Public: acc.prepend("+"); break;
4222 case Protection::Private: acc.prepend("-"); break;
4223 case Protection::Protected: acc.prepend("#"); break;
4224 case Protection::Package: acc.prepend("~"); break;
4225 }
4226 }
4227 (*it).addAccessor(acc);
4228}
4229
4231 Protection prot)
4232{
4233 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4234 bool umlLook = Config_getBool(UML_LOOK);
4235 if (prot==Protection::Private && !extractPrivate) return;
4236 //printf("%s::addUsedByClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4237 //
4238 auto it = std::find_if(m_usedByImplClassList.begin(),
4240 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4241 if (it==m_usedByImplClassList.end())
4242 {
4243 m_usedByImplClassList.emplace_back(cd);
4244 //printf("Adding used by class %s to class %s\n",
4245 // qPrint(cd->name()),qPrint(name()));
4246 it = m_usedByImplClassList.end()-1;
4247 }
4248 QCString acc = accessName;
4249 if (umlLook)
4250 {
4251 switch(prot)
4252 {
4253 case Protection::Public: acc.prepend("+"); break;
4254 case Protection::Private: acc.prepend("-"); break;
4255 case Protection::Protected: acc.prepend("#"); break;
4256 case Protection::Package: acc.prepend("~"); break;
4257 }
4258 }
4259 (*it).addAccessor(acc);
4260}
4261
4262
4267
4269{
4270 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
4271 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
4273 {
4274 Definition *scope=nullptr;
4275 if (inlineGroupedClasses && !partOfGroups().empty())
4276 {
4277 // point to the group that embeds this class
4278 return partOfGroups().front()->getOutputFileBase();
4279 }
4280 else if (inlineSimpleClasses && m_isSimple && !partOfGroups().empty())
4281 {
4282 // point to simple struct inside a group
4283 return partOfGroups().front()->getOutputFileBase();
4284 }
4285 else if (inlineSimpleClasses && m_isSimple && (scope=getOuterScope()))
4286 {
4287 if (scope==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) // simple struct embedded in file
4288 {
4289 return getFileDef()->getOutputFileBase();
4290 }
4291 else if (scope->isLinkableInProject()) // simple struct embedded in other container (namespace/group/class)
4292 {
4293 return getOuterScope()->getOutputFileBase();
4294 }
4295 }
4296 }
4297 AUTO_TRACE("name='{}' m_templateMaster={} m_implicitTemplateInstance={}",name(),(void*)m_templateMaster,m_implicitTemplateInstance);
4299 {
4300 // point to the template of which this class is an instance
4301 return m_templateMaster->getOutputFileBase();
4302 }
4303 return m_fileName;
4304}
4305
4310
4312{
4314 {
4315 return m_templateMaster->getSourceFileBase();
4316 }
4317 else
4318 {
4320 }
4321}
4322
4323void ClassDefImpl::setGroupDefForAllMembers(GroupDef *gd,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs)
4324{
4325 gd->addClass(this);
4326 //printf("ClassDefImpl::setGroupDefForAllMembers(%s)\n",qPrint(gd->name()));
4327 for (auto &mni : m_allMemberNameInfoLinkedMap)
4328 {
4329 for (auto &mi : *mni)
4330 {
4331 MemberDefMutable *md = toMemberDefMutable(mi->memberDef());
4332 if (md)
4333 {
4334 md->setGroupDef(gd,pri,fileName,startLine,hasDocs);
4335 gd->insertMember(md,TRUE);
4337 if (innerClass) innerClass->setGroupDefForAllMembers(gd,pri,fileName,startLine,hasDocs);
4338 }
4339 }
4340 }
4341}
4342
4344{
4345 //printf("**** %s::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
4346 if (d->definitionType()==Definition::TypeClass) // only classes can be
4347 // nested in classes.
4348 {
4349 m_innerClasses.add(d->localName(),toClassDef(d));
4350 }
4351}
4352
4354{
4355 return m_innerClasses.find(name);
4356}
4357
4359 int startLine, int startColumn, const QCString &templSpec,bool &freshInstance)
4360{
4361 freshInstance = FALSE;
4362 auto it = std::find_if(m_templateInstances.begin(),
4363 m_templateInstances.end(),
4364 [&templSpec](const auto &ti) { return templSpec==ti.templSpec; });
4365 ClassDefMutable *templateClass=nullptr;
4366 if (it!=m_templateInstances.end())
4367 {
4368 templateClass = toClassDefMutable((*it).classDef);
4369 }
4370 if (templateClass==nullptr)
4371 {
4372 QCString tcname = removeRedundantWhiteSpace(name()+templSpec);
4373 AUTO_TRACE("New template instance class name='{}' templSpec='{}' inside '{}' hidden={}",
4374 name(),templSpec,name(),isHidden());
4375
4376 ClassDef *foundCd = Doxygen::classLinkedMap->find(tcname);
4377 if (foundCd)
4378 {
4379 return foundCd;
4380 }
4381 templateClass =
4383 Doxygen::classLinkedMap->add(tcname,
4384 std::unique_ptr<ClassDef>(
4385 new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
4386 if (templateClass)
4387 {
4388 templateClass->setTemplateMaster(this);
4389 ArgumentList tal = *stringToArgumentList(getLanguage(),templSpec);
4390 templateClass->setTemplateArguments(tal);
4391 templateClass->setOuterScope(getOuterScope());
4392 templateClass->setHidden(isHidden());
4393 templateClass->setArtificial(isArtificial());
4394 templateClass->setImplicitTemplateInstance(true);
4395 m_templateInstances.emplace_back(templSpec,templateClass);
4396
4397 // also add nested classes
4398 for (const auto &innerCd : m_innerClasses)
4399 {
4400 QCString innerName = tcname+"::"+innerCd->localName();
4401 ClassDefMutable *innerClass =
4403 Doxygen::classLinkedMap->add(innerName,
4404 std::unique_ptr<ClassDef>(
4405 new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
4406 if (innerClass)
4407 {
4408 templateClass->addInnerCompound(innerClass);
4409 innerClass->setOuterScope(templateClass);
4410 innerClass->setHidden(isHidden());
4411 innerClass->setArtificial(TRUE);
4412 innerClass->setImplicitTemplateInstance(true);
4413 }
4414 }
4415 freshInstance=TRUE;
4416 }
4417 }
4418 return templateClass;
4419}
4420
4422{
4423 AUTO_TRACE("this={} cd={} templSpec={}",name(),templateClass->name(),templSpec);
4424 m_templateInstances.emplace_back(templSpec,templateClass);
4425}
4426
4428{
4429 m_templBaseClassNames = templateNames;
4430}
4431
4436
4439 const QCString &templSpec)
4440{
4441 AUTO_TRACE("this={} md={}",name(),md->name());
4442 auto actualArguments_p = stringToArgumentList(getLanguage(),templSpec);
4443 auto imd = md->createTemplateInstanceMember(templateArguments,actualArguments_p);
4444 auto mmd = toMemberDefMutable(imd.get());
4445 mmd->setMemberClass(this);
4446 mmd->setTemplateMaster(md);
4447 mmd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
4448 mmd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
4449 mmd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
4450 mmd->setMemberSpecifiers(md->getMemberSpecifiers());
4451 mmd->setMemberGroupId(md->getMemberGroupId());
4452 mmd->setArtificial(true);
4453 insertMember(imd.get());
4454 //printf("Adding member=%s %s%s to class %s templSpec %s\n",
4455 // imd->typeString(),qPrint(imd->name()),imd->argsString(),
4456 // qPrint(imd->getClassDef()->name()),templSpec);
4457 // insert imd in the list of all members
4458 //printf("Adding member=%s class=%s\n",qPrint(imd->name()),qPrint(name()));
4459 MemberName *mn = Doxygen::memberNameLinkedMap->add(imd->name());
4460 mn->push_back(std::move(imd));
4461}
4462
4464{
4465 AUTO_TRACE("this={} cd={} templSpec={}",name(),cd->name(),templSpec);
4466 //printf("%s::addMembersToTemplateInstance(%s,%s)\n",qPrint(name()),qPrint(cd->name()),templSpec);
4467 for (const auto &mni : cd->memberNameInfoLinkedMap())
4468 {
4469 for (const auto &mi : *mni)
4470 {
4471 const MemberDef *md = mi->memberDef();
4472 if (m_allMemberNameInfoLinkedMap.find(md->name())==nullptr) // only insert the member if not hidden by one with the same name (#11541)
4473 {
4475 }
4476 }
4477 }
4478 // also instantatie members for nested classes
4479 for (const auto &innerCd : cd->getClasses())
4480 {
4481 ClassDefMutable *ncd = toClassDefMutable(m_innerClasses.find(innerCd->localName()));
4482 if (ncd)
4483 {
4484 ncd->addMembersToTemplateInstance(innerCd,cd->templateArguments(),templSpec);
4485 }
4486 }
4487}
4488
4490{
4492 {
4493 return m_templateMaster->getReference();
4494 }
4495 else
4496 {
4498 }
4499}
4500
4502{
4504 {
4505 return m_templateMaster->isReference();
4506 }
4507 else
4508 {
4510 }
4511}
4512
4514{
4515 ArgumentLists result;
4517 while (d && d->definitionType()==Definition::TypeClass)
4518 {
4519 result.insert(result.begin(),toClassDef(d)->templateArguments());
4520 d = d->getOuterScope();
4521 }
4522 if (!templateArguments().empty())
4523 {
4524 result.push_back(templateArguments());
4525 }
4526 return result;
4527}
4528
4530 const ArgumentLists *actualParams,uint32_t *actualParamIndex) const
4531{
4532 return makeQualifiedNameWithTemplateParameters(this,actualParams,actualParamIndex);
4533}
4534
4536{
4537 QCString name = m_className.isEmpty() ? localName() : m_className;
4538 auto lang = getLanguage();
4539 if (lang==SrcLangExt::CSharp)
4540 {
4542 }
4543 return name;
4544}
4545
4550
4552{
4553 if (!isLinkableInProject()) return;
4554 SrcLangExt lang = getLanguage();
4556 qualifiedName(),
4557 theTranslator->trCompoundType(compoundType(), lang),
4559 displayName(),
4560 QCString(),
4561 this
4562 );
4563 for (const auto &mg : m_memberGroups)
4564 {
4565 mg->addListReferences(this);
4566 }
4567 for (auto &ml : m_memberLists)
4568 {
4569 if (ml->listType().isDetailed())
4570 {
4571 ml->addListReferences(this);
4572 }
4573 }
4574}
4575
4577{
4578 if (!isLinkableInProject()) return;
4580 for (const auto &mg : m_memberGroups)
4581 {
4582 mg->addRequirementReferences(this);
4583 }
4584 for (auto &ml : m_memberLists)
4585 {
4586 if (ml->listType().isDetailed())
4587 {
4588 ml->addRequirementReferences(this);
4589 }
4590 }
4591}
4592
4594{
4595 const MemberDef *xmd = nullptr;
4597 if (mni)
4598 {
4599 const int maxInheritanceDepth = 100000;
4600 int mdist=maxInheritanceDepth;
4601 for (auto &mi : *mni)
4602 {
4603 const ClassDef *mcd=mi->memberDef()->getClassDef();
4604 int m=minClassDistance(this,mcd);
4605 //printf("found member in %s linkable=%d m=%d\n",
4606 // qPrint(mcd->name()),mcd->isLinkable(),m);
4607 if (m<mdist)
4608 {
4609 mdist=m;
4610 xmd=mi->memberDef();
4611 }
4612 }
4613 }
4614 //printf("getMemberByName(%s)=%p\n",qPrint(name),xmd);
4615 return xmd;
4616}
4617
4619{
4620 return md->getClassDef() && isBaseClass(md->getClassDef(),TRUE,QCString());
4621}
4622
4624{
4625 for (auto &ml : m_memberLists)
4626 {
4627 if (ml->listType()==lt)
4628 {
4629 return ml.get();
4630 }
4631 }
4632 return nullptr;
4633}
4634
4636{
4637 AUTO_TRACE("{} md={} lt={} isBrief={}",name(),md->name(),lt,isBrief);
4638 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
4639 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
4640 const auto &ml = m_memberLists.get(lt,MemberListContainer::Class);
4641 ml->setNeedsSorting((isBrief && sortBriefDocs) || (!isBrief && sortMemberDocs));
4642 ml->push_back(md);
4643
4644 // for members in the declaration lists we set the section, needed for member grouping
4645 if (!ml->listType().isDetailed())
4646 {
4648 if (mdm)
4649 {
4650 mdm->setSectionList(this,ml.get());
4651 }
4652 }
4653}
4654
4656{
4657 for (auto &ml : m_memberLists)
4658 {
4659 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
4660 }
4661 if (Config_getBool(SORT_BRIEF_DOCS))
4662 {
4663 std::stable_sort(m_innerClasses.begin(),
4664 m_innerClasses.end(),
4665 [](const auto &c1,const auto &c2)
4666 {
4667 return Config_getBool(SORT_BY_SCOPE_NAME) ?
4668 qstricmp_sort(c1->name(), c2->name() )<0 :
4669 qstricmp_sort(c1->className(), c2->className())<0 ;
4670 });
4671 }
4672}
4673
4675 MemberListType lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const
4676{
4677 //printf("%s: countMemberDeclarations for %s and %s\n",qPrint(name()),lt.to_string(),lt2.to_string());
4678 int count=0;
4679 MemberList * ml = getMemberList(lt);
4680 MemberList * ml2 = getMemberList(lt2);
4681 if (getLanguage()!=SrcLangExt::VHDL) // use specific declarations function
4682 {
4683 if (ml)
4684 {
4685 count+=ml->numDecMembers(inheritedFrom);
4686 //printf("-> ml=%d\n",ml->numDecMembers());
4687 }
4688 if (ml2)
4689 {
4690 count+=ml2->numDecMembers(inheritedFrom);
4691 //printf("-> ml2=%d\n",ml2->numDecMembers());
4692 }
4693 // also include grouped members that have their own section in the class (see bug 722759)
4694 if (inheritedFrom)
4695 {
4696 for (const auto &mg : m_memberGroups)
4697 {
4698 count+=mg->countGroupedInheritedMembers(lt);
4699 if (!lt2.isInvalid()) count+=mg->countGroupedInheritedMembers(lt2);
4700 }
4701 }
4702 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4703 if (!inlineInheritedMembers) // show inherited members as separate lists
4704 {
4705 count+=countInheritedDecMembers(lt,inheritedFrom,invert,showAlways,visitedClasses);
4706 }
4707 }
4708 //printf("-> %d\n",count);
4709 return count;
4710}
4711
4713{
4714 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4715 {
4716 if (lde->kind()==LayoutDocEntry::MemberDecl)
4717 {
4718 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4719 if (lmd)
4720 {
4721 MemberList * ml = getMemberList(lmd->type);
4722 if (ml)
4723 {
4725 }
4726 }
4727 }
4728 else if (lde->kind()==LayoutDocEntry::MemberGroups)
4729 {
4730 for (const auto &mg : m_memberGroups)
4731 {
4732 mg->setAnonymousEnumType();
4733 }
4734 }
4735 }
4736}
4737
4739{
4740 for (auto &ml : m_memberLists)
4741 {
4742 ml->countDecMembers();
4743 ml->countDocMembers();
4744 }
4745 for (const auto &mg : m_memberGroups)
4746 {
4747 mg->countDecMembers();
4748 mg->countDocMembers();
4749 }
4750}
4751
4753 const ClassDef *inheritedFrom,bool invert,bool showAlways,
4754 ClassDefSet &visitedClasses) const
4755{
4756 int inhCount = 0;
4757 int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
4758 bool process = count>0;
4759 //printf("%s: countInheritedDecMembers: lt=%s process=%d count=%d invert=%d\n",
4760 // qPrint(name()),lt.to_string(),process,count,invert);
4761 if ((process^invert) || showAlways)
4762 {
4763 for (const auto &ibcd : m_inherits)
4764 {
4765 ClassDefMutable *icd = toClassDefMutable(ibcd.classDef);
4768 if (icd && icd->isLinkable())
4769 {
4770 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt2);
4771 //printf("%s: convert %s->(%s,%s) prot=%d\n",
4772 // qPrint(icd->name()),lt.to_string(),lt1.to_string(),lt2.to_string(),ibcd.prot);
4773 if (visitedClasses.find(icd)==visitedClasses.end())
4774 {
4775 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4776 if (!lt1.isInvalid())
4777 {
4778 inhCount+=icd->countMemberDeclarations(lt1,inheritedFrom,lt2,FALSE,TRUE,visitedClasses);
4779 }
4780 }
4781 }
4782 }
4783 }
4784 //printf("%s: count=%d\n",qPrint(name()),inhCount);
4785 return inhCount;
4786}
4787
4789 QCString &title,QCString &subtitle) const
4790{
4791 SrcLangExt lang = getLanguage();
4792 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4793 {
4794 if (lde->kind()==LayoutDocEntry::MemberDecl)
4795 {
4796 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4797 if (lmd && lmd->type==type)
4798 {
4799 title = lmd->title(lang);
4800 subtitle = lmd->subtitle(lang);
4801 return;
4802 }
4803 }
4804 }
4805 title="";
4806 subtitle="";
4807}
4808
4810{
4811 int totalCount=0;
4812 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4813 {
4814 if (lde->kind()==LayoutDocEntry::MemberDecl)
4815 {
4816 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4817 if (lmd && lmd->type!=MemberListType::Friends()) // friendship is not inherited
4818 {
4819 ClassDefSet visited;
4820 totalCount+=countInheritedDecMembers(lmd->type,this,TRUE,FALSE,visited);
4821 }
4822 }
4823 }
4824 //printf("countAdditionalInheritedMembers()=%d\n",totalCount);
4825 return totalCount;
4826}
4827
4829{
4830 //printf("**** writeAdditionalInheritedMembers()\n");
4831 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4832 {
4833 if (lde->kind()==LayoutDocEntry::MemberDecl)
4834 {
4835 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4836 if (lmd && lmd->type!=MemberListType::Friends())
4837 {
4838 ClassDefSet visited;
4840 }
4841 }
4842 }
4843}
4844
4846 const ClassDef *inheritedFrom,bool additional) const
4847{
4848 int count=0;
4849 MemberList *ml = getMemberList(lt);
4850 if (ml)
4851 {
4852 count=ml->countInheritableMembers(inheritedFrom);
4853 }
4854 //printf("%s:countMembersIncludingGrouped: count=%d\n",qPrint(name()),count);
4855 for (const auto &mg : m_memberGroups)
4856 {
4857 bool hasOwnSection = !mg->allMembersInSameSection() ||
4858 !m_subGrouping; // group is in its own section
4859 if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
4860 {
4861 count+=mg->countGroupedInheritedMembers(lt);
4862 }
4863 }
4864 //printf("%s:countMembersIncludingGrouped(lt=%s,%s)=%d\n",
4865 // qPrint(name()),qPrint(lt.to_string()),ml?qPrint(ml->listType().to_string()):"<none>",count);
4866 return count;
4867}
4868
4869
4872 const ClassDef *inheritedFrom,bool invert,bool showAlways) const
4873{
4874 int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
4875 bool process = count>0;
4876 //printf("%s: writeInheritedMemberDec: lt=%s process=%d invert=%d always=%d\n",
4877 // qPrint(name()),qPrint(lt.to_string()),process,invert,showAlways);
4878 if ((process^invert) || showAlways)
4879 {
4880 for (const auto &ibcd : m_inherits)
4881 {
4882 ClassDefMutable *icd=toClassDefMutable(ibcd.classDef);
4883 if (icd && icd->isLinkable())
4884 {
4887 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt3);
4888 if (lt2.isInvalid() && !lt3.isInvalid())
4889 {
4890 lt2=lt3;
4891 }
4892 //printf("%s:convert %s->(%s,%s) prot=%d\n",qPrint(icd->name()),qPrint(lt.to_string()),
4893 // qPrint(lt1.to_string()),qPrint(lt2.to_string()),ibcd.prot);
4894 if (visitedClasses.find(icd)==visitedClasses.end())
4895 {
4896 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4897 if (!lt1.isInvalid())
4898 {
4899 //printf("--> writeMemberDeclarations for type %s\n",qPrint(lt1.to_string()));
4900 icd->writeMemberDeclarations(ol,visitedClasses,lt1,
4901 title,QCString(),FALSE,inheritedFrom,lt2,FALSE,TRUE);
4902 }
4903 }
4904 else
4905 {
4906 //printf("%s: class already visited!\n",qPrint(icd->name()));
4907 }
4908 }
4909 }
4910 }
4911}
4912
4914 MemberListType lt,const QCString &title,
4915 const QCString &subTitle,bool showInline,const ClassDef *inheritedFrom,MemberListType lt2,
4916 bool invert,bool showAlways) const
4917{
4918 //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%s lt2=%s\n",qPrint(name()),qPrint(lt.to_string()),qPrint(lt2.to_string()));
4919 MemberList * ml = getMemberList(lt);
4920 MemberList * ml2 = getMemberList(lt2);
4921 if (getLanguage()==SrcLangExt::VHDL) // use specific declarations function
4922 {
4923 static const ClassDef *cdef;
4924 if (cdef!=this)
4925 { // only one inline link
4927 cdef=this;
4928 }
4929 if (ml)
4930 {
4931 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,this,nullptr,nullptr,nullptr);
4932 }
4933 }
4934 else
4935 {
4936 //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",qPrint(name()),qPrint(title),(void*)ml,(void*)ml2);
4937 QCString tt = title, st = subTitle;
4938 if (ml)
4939 {
4940 //printf(" writeDeclarations ml type=%s count=%d\n",qPrint(lt.to_string()),ml->numDecMembers(inheritedFrom));
4941 ml->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,true);
4942 tt.clear();
4943 st.clear();
4944 }
4945 if (ml2)
4946 {
4947 //printf(" writeDeclarations ml2 type=%s count=%d\n",qPrint(lt2.to_string()),ml2->numDecMembers(inheritedFrom));
4948 ml2->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,ml==nullptr);
4949 }
4950 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4951 if (!inlineInheritedMembers) // show inherited members as separate lists
4952 {
4953 writeInheritedMemberDeclarations(ol,visitedClasses,lt,lt2,title,
4954 inheritedFrom ? inheritedFrom : this,
4955 invert,showAlways);
4956 }
4957 }
4958}
4959
4961 const ClassDef *inheritedFrom,const QCString &inheritId) const
4962{
4963 //printf("** %s::addGroupedInheritedMembers() inheritId=%s\n",qPrint(name()),qPrint(inheritId));
4964 for (const auto &mg : m_memberGroups)
4965 {
4966 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
4967 {
4968 mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId);
4969 }
4970 }
4971}
4972
4974{
4975 //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",qPrint(name()));
4976 MemberList * ml = getMemberList(lt);
4977 if (ml) ml->writeDocumentation(ol,displayName(),this,title,ml->listType().toLabel(),FALSE,showInline);
4978}
4979
4981{
4982 //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",qPrint(name()));
4983 MemberList * ml = getMemberList(lt);
4984 if (ml) ml->writeSimpleDocumentation(ol,this);
4985}
4986
4988 MemberListType lt,bool inGroup,
4989 int indentLevel,const ClassDef *inheritedFrom,const QCString &inheritId) const
4990{
4991 //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",qPrint(name()));
4992 MemberList * ml = getMemberList(lt);
4993 if (ml)
4994 {
4995 ml->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
4996 }
4997}
4998
5000{
5001 return m_isLocal;
5002}
5003
5008
5013
5015{
5016 return m_inherits;
5017}
5018
5020{
5021 m_inherits = bcd;
5022}
5023
5025{
5026 return m_inheritedBy;
5027}
5028
5030{
5031 m_inheritedBy = bcd;
5032}
5033
5038
5040{
5041 std::stable_sort(m_allMemberNameInfoLinkedMap.begin(),
5043 [](const auto &m1,const auto &m2)
5044 {
5045 return qstricmp_sort(m1->memberName(),m2->memberName())<0;
5046 });
5047}
5048
5050{
5051 return m_prot;
5052}
5053
5055{
5056 return m_tempArgs;
5057}
5058
5060{
5061 return m_fileDef;
5062}
5063
5065{
5066 return m_moduleDef;
5067}
5068
5073
5075{
5076 return m_templateMaster;
5077}
5078
5083
5088
5090{
5091 return !m_tempArgs.empty();
5092}
5093
5095{
5096 return m_incInfo.get();
5097}
5098
5103
5108
5113
5115{
5116 return m_isTemplArg;
5117}
5118
5120{
5121 return m_isAbstract || m_spec.isAbstract();
5122}
5123
5125{
5126 return m_spec.isFinal();
5127}
5128
5130{
5131 return m_spec.isSealed();
5132}
5133
5135{
5136 return m_spec.isPublished();
5137}
5138
5140{
5141 return m_spec.isForwardDecl();
5142}
5143
5145{
5146 return m_spec.isInterface();
5147}
5148
5150{
5151 return getLanguage()==SrcLangExt::ObjC;
5152}
5153
5155{
5156 return getLanguage()==SrcLangExt::Fortran;
5157}
5158
5160{
5161 return getLanguage()==SrcLangExt::CSharp;
5162}
5163
5165{
5166 return m_categoryOf;
5167}
5168
5170{
5171 return m_memberLists;
5172}
5173
5175{
5176 return m_memberGroups;
5177}
5178
5180{
5181 m_fileDef = fd;
5182}
5183
5185{
5186 m_moduleDef = mod;
5187}
5188
5190{
5191 m_subGrouping = enabled;
5192}
5193
5195{
5196 m_prot=p;
5197 if (getLanguage()==SrcLangExt::VHDL && VhdlDocGen::convert(p)==VhdlDocGen::ARCHITECTURECLASS)
5198 {
5199 m_className = name();
5200 }
5201}
5202
5204{
5205 m_isStatic=b;
5206}
5207
5212
5214{
5215 assert(tm!=this);
5217}
5218
5220{
5221 m_isTemplArg = b;
5222}
5223
5225{
5226 m_categoryOf = cd;
5227}
5228
5230{
5231 m_usedOnly = b;
5232}
5233
5235{
5236 return m_usedOnly;
5237}
5238
5240{
5241 return m_isSimple;
5242}
5243
5245{
5246 return m_arrowOperator;
5247}
5248
5250{
5251 md->setMemberType(t);
5252 for (auto &ml : m_memberLists)
5253 {
5254 ml->remove(md);
5255 }
5256 insertMember(md);
5257}
5258
5260{
5261 QCString anc;
5263 {
5265 {
5266 // point to the template of which this class is an instance
5267 anc = m_templateMaster->getOutputFileBase();
5268 }
5269 else
5270 {
5271 anc = m_fileName;
5272 }
5273 }
5274 return anc;
5275}
5276
5278{
5279 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
5280 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
5281
5282 Definition *container = getOuterScope();
5283
5284 bool containerLinkable =
5285 container &&
5286 (
5287 (container==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) || // global class in documented file
5288 container->isLinkableInProject() // class in documented scope
5289 );
5290
5291 // inline because of INLINE_GROUPED_CLASSES=YES ?
5292 bool b1 = (inlineGroupedClasses && !partOfGroups().empty()); // a grouped class
5293 // inline because of INLINE_SIMPLE_STRUCTS=YES ?
5294 bool b2 = (inlineSimpleClasses && m_isSimple && // a simple class
5295 (containerLinkable || // in a documented container
5296 !partOfGroups().empty() // or part of a group
5297 )
5298 );
5299 //printf("%s::isEmbeddedInOuterScope(): inlineGroupedClasses=%d "
5300 // "inlineSimpleClasses=%d partOfGroups()=%p m_isSimple=%d "
5301 // "getOuterScope()=%s b1=%d b2=%d\n",
5302 // qPrint(name()),inlineGroupedClasses,inlineSimpleClasses,
5303 // partOfGroups().pointer(),m_isSimple,getOuterScope()?qPrint(getOuterScope()->name()):"<none>",b1,b2);
5304 return b1 || b2; // either reason will do
5305}
5306
5308{
5309 return m_tagLessRef;
5310}
5311
5313{
5314 m_tagLessRef = cd;
5315}
5316
5318{
5319 for (auto &ml : m_memberLists)
5320 {
5321 ml->remove(md);
5322 }
5323}
5324
5326{
5327 return m_isJavaEnum;
5328}
5329
5331{
5332 m_spec = spec;
5333}
5334
5336{
5337 for (const auto &sx : qualifiers)
5338 {
5339 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5340 if (!alreadyAdded)
5341 {
5342 m_qualifiers.push_back(sx);
5343 }
5344 }
5345}
5346
5351
5353{
5354 AUTO_TRACE("name={}",md->name());
5355 const auto &mni = m_allMemberNameInfoLinkedMap.find(md->name());
5356 if (mni)
5357 {
5358 for (const auto &mi : *mni)
5359 {
5360 const MemberDef *classMd = mi->memberDef();
5361 const ArgumentList &classAl = classMd->argumentList();
5362 const ArgumentList &al = md->argumentList();
5363 bool found = matchArguments2(
5364 classMd->getOuterScope(),classMd->getFileDef(),classMd->typeString(),&classAl,
5365 md->getOuterScope(),md->getFileDef(),md->typeString(),&al,
5366 true,getLanguage()
5367 );
5368 if (found)
5369 {
5370 AUTO_TRACE_EXIT("true");
5371 return true;
5372 }
5373 }
5374 }
5375 AUTO_TRACE_EXIT("false");
5376 return false;
5377}
5378
5380{
5381 QCString n = name();
5382 int si = n.find('(');
5383 int ei = n.find(')');
5384 bool b = ei>si && n.mid(si+1,ei-si-1).stripWhiteSpace().isEmpty();
5385 return b;
5386}
5387
5389{
5390 return m_files;
5391}
5392
5394{
5395 return m_typeConstraints;
5396}
5397
5399{
5400 return m_examples;
5401}
5402
5404{
5405 return m_subGrouping;
5406}
5407
5409{
5410 return m_spec.isLocal();
5411}
5412
5414{
5415 m_metaData = md;
5416}
5417
5422
5427
5429{
5431}
5432
5434{
5436}
5437
5439{
5440 switch (compoundType())
5441 {
5442 case Class: return CodeSymbolType::Class; break;
5443 case Struct: return CodeSymbolType::Struct; break;
5444 case Union: return CodeSymbolType::Union; break;
5445 case Interface: return CodeSymbolType::Interface; break;
5446 case Protocol: return CodeSymbolType::Protocol; break;
5447 case Category: return CodeSymbolType::Category; break;
5448 case Exception: return CodeSymbolType::Exception; break;
5449 case Service: return CodeSymbolType::Service; break;
5450 case Singleton: return CodeSymbolType::Singleton; break;
5451 }
5452 return CodeSymbolType::Class;
5453}
5454
5459
5464
5465
5466// --- Cast functions
5467//
5469{
5470 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5471 {
5472 return static_cast<ClassDef*>(d);
5473 }
5474 else
5475 {
5476 return nullptr;
5477 }
5478}
5479
5481{
5482 Definition *d = toDefinition(md);
5483 if (d && typeid(*d)==typeid(ClassDefImpl))
5484 {
5485 return static_cast<ClassDef*>(d);
5486 }
5487 else
5488 {
5489 return nullptr;
5490 }
5491}
5492
5494{
5495 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5496 {
5497 return static_cast<const ClassDef*>(d);
5498 }
5499 else
5500 {
5501 return nullptr;
5502 }
5503}
5504
5506{
5507 if (d && typeid(*d)==typeid(ClassDefImpl))
5508 {
5509 return static_cast<ClassDefMutable*>(d);
5510 }
5511 else
5512 {
5513 return nullptr;
5514 }
5515}
5516
5517// --- Helpers
5518
5519/*! Get a class definition given its name.
5520 * Returns nullptr if the class is not found.
5521 */
5523{
5524 if (n.isEmpty()) return nullptr;
5525 return Doxygen::classLinkedMap->find(n);
5526}
5527
5529{
5530 for (const auto &bcd : bcl)
5531 {
5532 const ClassDef *cd=bcd.classDef;
5533 if (cd->isVisibleInHierarchy()) return true;
5534 if (classHasVisibleRoot(cd->baseClasses())) return true;
5535 }
5536 return false;
5537}
5538
5540{
5541 BaseClassList bcl;
5542
5543 if (cd->getLanguage()==SrcLangExt::VHDL) // reverse baseClass/subClass relation
5544 {
5545 if (cd->baseClasses().empty()) return FALSE;
5546 bcl=cd->baseClasses();
5547 }
5548 else
5549 {
5550 if (cd->subClasses().empty()) return FALSE;
5551 bcl=cd->subClasses();
5552 }
5553
5554 for (const auto &bcd : bcl)
5555 {
5556 if (bcd.classDef->isVisibleInHierarchy())
5557 {
5558 return TRUE;
5559 }
5560 }
5561 return FALSE;
5562}
5563
5565{
5566 bool allExternals = Config_getBool(ALLEXTERNALS);
5567 return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
5568}
5569
5570//----------------------------------------------------------------------
5571// recursive function that returns the number of branches in the
5572// inheritance tree that the base class 'bcd' is below the class 'cd'
5573
5574int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level)
5575{
5576 const int maxInheritanceDepth = 100000;
5577 if (bcd->categoryOf()) // use class that is being extended in case of
5578 // an Objective-C category
5579 {
5580 bcd=bcd->categoryOf();
5581 }
5582 if (cd==bcd) return level;
5583 if (level==256)
5584 {
5585 warn_uncond("class {} seem to have a recursive inheritance relation!\n",cd->name());
5586 return -1;
5587 }
5588 int m=maxInheritanceDepth;
5589 for (const auto &bcdi : cd->baseClasses())
5590 {
5591 int mc=minClassDistance(bcdi.classDef,bcd,level+1);
5592 if (mc<m) m=mc;
5593 if (m<0) break;
5594 }
5595 return m;
5596}
5597
5599{
5600 if (bcd->categoryOf()) // use class that is being extended in case of
5601 // an Objective-C category
5602 {
5603 bcd=bcd->categoryOf();
5604 }
5605 if (cd==bcd)
5606 {
5607 goto exit;
5608 }
5609 if (level==256)
5610 {
5611 err("Internal inconsistency: found class {} seem to have a recursive "
5612 "inheritance relation! Please send a bug report to doxygen@gmail.com\n",cd->name());
5613 }
5614 else if (prot!=Protection::Private)
5615 {
5616 for (const auto &bcdi : cd->baseClasses())
5617 {
5618 Protection baseProt = classInheritedProtectionLevel(bcdi.classDef,bcd,bcdi.prot,level+1);
5619 if (baseProt==Protection::Private) prot=Protection::Private;
5620 else if (baseProt==Protection::Protected) prot=Protection::Protected;
5621 }
5622 }
5623exit:
5624 //printf("classInheritedProtectionLevel(%s,%s)=%d\n",qPrint(cd->name()),qPrint(bcd->name()),prot);
5625 return prot;
5626}
5627
5628
constexpr auto prefix
Definition anchor.cpp:44
std::vector< ArgumentList > ArgumentLists
Definition arguments.h:147
This class represents an function or template argument list.
Definition arguments.h:65
bool empty() const
Definition arguments.h:99
Argument & at(size_t i)
Definition arguments.h:107
bool isSimple() const override
Definition classdef.cpp:710
bool isFortran() const override
Returns TRUE if this class is implemented in Fortran.
Definition classdef.cpp:676
QCString requiresClause() const override
Definition classdef.cpp:738
void writeTagFile(TextStream &ol) const override
Definition classdef.cpp:776
int countMemberDeclarations(MemberListType lt, const ClassDef *inheritedFrom, MemberListType lt2, bool invert, bool showAlways, ClassDefSet &visitedClasses) const override
Definition classdef.cpp:747
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:645
const UsesClassList & usedByImplementationClasses() const override
Definition classdef.cpp:659
bool hasDetailedDescription() const override
returns TRUE if this class has a non-empty detailed description
Definition classdef.cpp:607
void writePageNavigation(OutputList &ol) const override
Definition classdef.cpp:772
ModuleDef * getModuleDef() const override
Returns the C++20 module in which this compound's definition can be found.
Definition classdef.cpp:639
void writeDocumentation(OutputList &ol) const override
Definition classdef.cpp:757
const UsesClassList & usedImplementationClasses() const override
Definition classdef.cpp:657
StringVector getQualifiers() const override
Definition classdef.cpp:740
void writeSummaryLinks(OutputList &ol) const override
Definition classdef.cpp:770
bool isVisibleInHierarchy() const override
the class is visible in a class diagram, or class hierarchy
Definition classdef.cpp:631
QCString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const override
Definition classdef.cpp:669
bool isPublished() const override
Returns TRUE if this class is marked as published.
Definition classdef.cpp:684
const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const override
Returns a dictionary of all members.
Definition classdef.cpp:623
QCString anchor() const override
Definition classdef.cpp:706
QCString title() const override
Definition classdef.cpp:718
bool isImplicitTemplateInstance() const override
Definition classdef.cpp:754
const FileList & usedFiles() const override
Definition classdef.cpp:722
CodeSymbolType codeSymbolType() const override
Definition classdef.cpp:589
bool isFinal() const override
Returns TRUE if this class is marked as final.
Definition classdef.cpp:680
const ExampleList & getExamples() const override
Definition classdef.cpp:726
void moveTo(Definition *) override
Definition classdef.cpp:587
bool isReference() const override
Definition classdef.cpp:599
bool isTemplateArgument() const override
Definition classdef.cpp:663
void updateSubClasses(const BaseClassList &) override
Update the list of sub classes to the one passed.
Definition classdef.cpp:789
bool isForwardDeclared() const override
Returns TRUE if this class represents a forward declaration of a template class.
Definition classdef.cpp:688
const ArgumentList & typeConstraints() const override
Definition classdef.cpp:724
const IncludeInfo * includeInfo() const override
Definition classdef.cpp:655
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:647
QCString getSourceFileBase() const override
Definition classdef.cpp:595
void writeMemberPages(OutputList &ol) const override
Definition classdef.cpp:761
ClassDefAliasImpl(const Definition *newScope, const ClassDef *cd)
Definition classdef.cpp:576
void writeDeclaration(OutputList &ol, const MemberDef *md, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const override
Definition classdef.cpp:765
void writeQuickMemberLinks(OutputList &ol, const MemberDef *md) const override
Definition classdef.cpp:768
void updateBaseClasses(const BaseClassList &) override
Update the list of base classes to the one passed.
Definition classdef.cpp:788
bool containsOverload(const MemberDef *md) const override
Definition classdef.cpp:742
bool subGrouping() const override
Definition classdef.cpp:732
const ArgumentList & templateArguments() const override
Returns the template arguments of this class.
Definition classdef.cpp:635
Protection protection() const override
Return the protection level (Public,Protected,Private) in which this compound was found.
Definition classdef.cpp:625
bool isCSharp() const override
Returns TRUE if this class is implemented in C#.
Definition classdef.cpp:678
const MemberGroupList & getMemberGroups() const override
Returns the member groups defined for this class.
Definition classdef.cpp:700
bool isEmbeddedInOuterScope() const override
Definition classdef.cpp:708
QCString getReference() const override
Definition classdef.cpp:597
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:643
int countMembersIncludingGrouped(MemberListType lt, const ClassDef *inheritedFrom, bool additional) const override
Definition classdef.cpp:745
void addGroupedInheritedMembers(OutputList &ol, MemberListType lt, const ClassDef *inheritedFrom, const QCString &inheritId) const override
Definition classdef.cpp:784
bool isSealed() const override
Returns TRUE if this class is marked as sealed.
Definition classdef.cpp:682
bool hasDocumentation() const override
Definition classdef.cpp:605
FileDef * getFileDef() const override
Returns the namespace this compound is in, or 0 if it has a global scope.
Definition classdef.cpp:637
ArgumentLists getTemplateParameterLists() const override
Returns the template parameter lists that form the template declaration of this class.
Definition classdef.cpp:667
QCString getMemberListFileName() const override
Definition classdef.cpp:730
bool hasNonReferenceSuperClass() const override
Definition classdef.cpp:736
void writeInlineDocumentation(OutputList &ol) const override
Definition classdef.cpp:774
const BaseClassList & subClasses() const override
Returns the list of sub classes that directly derive from this class.
Definition classdef.cpp:621
bool isJavaEnum() const override
Definition classdef.cpp:716
QCString inheritanceGraphFileName() const override
returns the file name to use for the inheritance graph
Definition classdef.cpp:611
~ClassDefAliasImpl() override
Definition classdef.cpp:578
const TemplateInstanceList & getTemplateInstances() const override
Returns a sorted dictionary with all template instances found for this template class.
Definition classdef.cpp:649
QCString compoundTypeString() const override
Returns the type of compound as a string.
Definition classdef.cpp:617
bool isLinkableInProject() const override
Definition classdef.cpp:627
QCString displayName(bool includeScope=TRUE) const override
Definition classdef.cpp:613
QCString className() const override
Returns the name of the class including outer classes, but not including namespaces.
Definition classdef.cpp:694
bool isLocal() const override
Returns TRUE if this is a local class definition, see EXTRACT_LOCAL_CLASSES.
Definition classdef.cpp:601
QCString getInstanceOutputFileBase() const override
Definition classdef.cpp:593
void writeDocumentationForInnerClasses(OutputList &ol) const override
Definition classdef.cpp:759
const MemberLists & getMemberLists() const override
Returns the list containing the list of members sorted per type.
Definition classdef.cpp:698
MemberList * getMemberList(MemberListType lt) const override
Returns the members in the list identified by lt.
Definition classdef.cpp:696
ClassDef * categoryOf() const override
Returns the class of which this is a category (Objective-C only).
Definition classdef.cpp:692
const ClassDef * getCdAlias() const
Definition classdef.cpp:583
QCString collaborationGraphFileName() const override
returns the file name to use for the collaboration graph
Definition classdef.cpp:609
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:778
QCString getOutputFileBase() const override
Definition classdef.cpp:591
CompoundType compoundType() const override
Returns the type of compound this is, i.e.
Definition classdef.cpp:615
const TemplateNameMap & getTemplateBaseClassNames() const override
Definition classdef.cpp:702
void writeDeclarationLink(OutputList &ol, bool &found, const QCString &header, bool localNames) const override
Definition classdef.cpp:751
const Definition * findInnerCompound(const QCString &name) const override
Definition classdef.cpp:665
DefType definitionType() const override
Definition classdef.cpp:581
QCString generatedFromFiles() const override
Definition classdef.cpp:720
bool isLinkable() const override
Definition classdef.cpp:629
const BaseClassList & baseClasses() const override
Returns the list of base classes from which this class directly inherits.
Definition classdef.cpp:619
const ClassDef * tagLessReference() const override
Definition classdef.cpp:712
bool isExtension() const override
Returns TRUE if this class represents an Objective-C 2.0 extension (nameless category).
Definition classdef.cpp:686
ClassLinkedRefMap getClasses() const override
returns the classes nested into this class
Definition classdef.cpp:603
const ConstraintClassList & templateTypeConstraints() const override
Definition classdef.cpp:661
bool isInterface() const override
Returns TRUE if this class represents an interface.
Definition classdef.cpp:690
std::unique_ptr< ClassDef > deepCopy(const QCString &name) const override
Definition classdef.cpp:584
bool isAbstract() const override
Returns TRUE if there is at least one pure virtual member in this class.
Definition classdef.cpp:672
bool hasExamples() const override
Definition classdef.cpp:728
bool visibleInParentsDeclList() const override
show this class in the declaration section of its parent?
Definition classdef.cpp:633
const MemberDef * getMemberByName(const QCString &s) const override
Returns the member with the given name.
Definition classdef.cpp:641
const ClassDef * templateMaster() const override
Returns the template master of which this class is an instance.
Definition classdef.cpp:651
bool isTemplate() const override
Returns TRUE if this class is a template.
Definition classdef.cpp:653
bool isSliceLocal() const override
Definition classdef.cpp:734
bool isUsedOnly() const override
Definition classdef.cpp:704
const MemberDef * isSmartPointer() const override
Definition classdef.cpp:714
bool isObjectiveC() const override
Returns TRUE if this class is implemented in Objective-C.
Definition classdef.cpp:674
void writeMemberList(OutputList &ol) const override
Definition classdef.cpp:763
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 void writePageNavigation(OutputList &ol) const =0
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:489
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:421
ArgumentList m_typeConstraints
Definition classdef.cpp:458
void writePageNavigation(OutputList &ol) const override
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:533
QCString compoundTypeString() const override
Returns the type of compound as a string.
ExampleList m_examples
Definition classdef.cpp:464
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:415
const MemberDef * m_arrowOperator
Does this class overloaded the -> operator?
Definition classdef.cpp:539
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:507
TypeSpecifier m_spec
Definition classdef.cpp:546
ClassDef * m_categoryOf
Definition classdef.cpp:502
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:541
void setAnonymousEnumType() override
void setTagLessReference(const ClassDef *cd) override
Protection m_prot
Definition classdef.cpp:473
bool isLinkableInProject() const override
BaseClassList m_inheritedBy
Definition classdef.cpp:438
FileList m_files
Definition classdef.cpp:461
const TemplateInstanceList & getTemplateInstances() const override
Returns a sorted dictionary with all template instances found for this template class.
MemberLists m_memberLists
Definition classdef.cpp:504
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:974
const ExampleList & getExamples() const override
UsesClassList m_usesImplClassList
Definition classdef.cpp:481
void addListReferences() override
const ArgumentList & templateArguments() const override
Returns the template arguments of this class.
QCString m_inheritFileName
Definition classdef.cpp:424
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:804
QCString generatedFromFiles() const override
const ClassDef * m_templateMaster
Definition classdef.cpp:494
void writeTagFile(TextStream &) const override
void endMemberDeclarations(OutputList &ol) const
bool m_membersMerged
Definition classdef.cpp:516
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:551
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:491
const ConstraintClassList & templateTypeConstraints() const override
const UsesClassList & usedImplementationClasses() const override
std::unique_ptr< IncludeInfo > m_incInfo
Definition classdef.cpp:429
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:544
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:434
void writeMemberPages(OutputList &ol) const override
MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap
Definition classdef.cpp:452
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:866
bool isSimple() const override
ModuleDef * m_moduleDef
Definition classdef.cpp:449
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:536
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:556
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:510
StringVector m_qualifiers
Definition classdef.cpp:553
ArgumentList m_primaryConstructorParams
Definition classdef.cpp:560
FileDef * m_fileDef
Definition classdef.cpp:446
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:467
bool m_hasCollaborationGraph
Definition classdef.cpp:555
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:497
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:478
UsesClassList m_usedByImplClassList
Definition classdef.cpp:482
bool isSliceLocal() const override
ConstraintClassList m_constraintClassList
Definition classdef.cpp:484
void setIsStatic(bool b) override
int countInheritedByNodes() const
QCString getMemberListFileName() const override
Definition classdef.cpp:988
void setFileDef(FileDef *fd) override
void insertBaseClass(ClassDef *, const QCString &name, Protection p, Specifier s, const QCString &t=QCString()) override
Definition classdef.cpp:999
bool m_isTemplArg
Definition classdef.cpp:521
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:530
bool isCSharp() const override
Returns TRUE if this class is implemented in C#.
void computeAnchors() override
void writeIncludeFiles(OutputList &ol) const
void addRequirementReferences() override
QCString m_metaData
Definition classdef.cpp:548
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:993
bool isVisibleInHierarchy() const override
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title, bool showInline=FALSE) const
QCString m_memberListFileName
Definition classdef.cpp:418
bool isLinkable() const override
bool m_implicitTemplateInstance
Definition classdef.cpp:558
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:455
void internalInsertMember(MemberDef *md, Protection prot, bool addToAllList)
void startMemberDeclarations(OutputList &ol) const
bool m_subGrouping
Definition classdef.cpp:527
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 setPrimaryConstructorParams(const ArgumentList &list) override
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 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:77
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
bool hasRequirementRefs() 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
void writeRequirementRefs(OutputList &ol) const 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:131
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:95
static NamespaceDefMutable * globalScope
Definition doxygen.h:120
static ClassLinkedMap * hiddenClassLinkedMap
Definition doxygen.h:96
static bool generatingXmlOutput
Definition doxygen.h:135
static MemberNameLinkedMap * memberNameLinkedMap
Definition doxygen.h:110
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:1437
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 bool isThreadLocal() 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:125
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:130
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, const QCString &anchor, bool showEnumValues=FALSE, bool showInline=FALSE) const
int numDecMembers(const ClassDef *inheritedFrom) const
Definition memberlist.h:133
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:346
constexpr const char * toLabel() const noexcept
Definition types.h:402
constexpr bool isInvalid() const noexcept
Definition types.h:372
static constexpr MemberListType Invalid() noexcept
Definition types.h:371
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:315
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:383
void endTextBlock(bool paraBreak=FALSE)
Definition outputlist.h:672
void endIndent()
Definition outputlist.h:584
void writeString(const QCString &text)
Definition outputlist.h:411
void startMemberDeclaration()
Definition outputlist.h:569
void startMemberDoc(const QCString &clName, const QCString &memName, const QCString &anchor, const QCString &title, int memCount, int memTotal, bool showInline)
Definition outputlist.h:531
void startMemberDocName(bool align)
Definition outputlist.h:680
void startClassDiagram()
Definition outputlist.h:594
void startItemList()
Definition outputlist.h:429
void disable(OutputType o)
void endMemberDocName()
Definition outputlist.h:682
void endMemberDoc(bool hasArgs)
Definition outputlist.h:535
void writeRuler()
Definition outputlist.h:521
void startGroupHeader(const QCString &id=QCString(), int extraLevels=0)
Definition outputlist.h:453
void enable(OutputType o)
void endContents()
Definition outputlist.h:620
void endMemberDescription()
Definition outputlist.h:567
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:439
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition outputlist.h:565
void endCompoundTemplateParams()
Definition outputlist.h:503
void docify(const QCString &s)
Definition outputlist.h:437
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, const DocOptions &options)
void startIndent()
Definition outputlist.h:582
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:407
void endDescForItem()
Definition outputlist.h:549
void startTextBlock(bool dense=FALSE)
Definition outputlist.h:670
void endExamples()
Definition outputlist.h:580
void endParagraph()
Definition outputlist.h:409
void addIndexItem(const QCString &s1, const QCString &s2)
Definition outputlist.h:590
void startExamples()
Definition outputlist.h:578
void startMemberSections()
Definition outputlist.h:461
void startMemberList()
Definition outputlist.h:481
void endTextLink()
Definition outputlist.h:444
void startItemListItem()
Definition outputlist.h:457
void endItemListItem()
Definition outputlist.h:459
void startBold()
Definition outputlist.h:561
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:495
void writeSynopsis()
Definition outputlist.h:592
void startTypewriter()
Definition outputlist.h:449
void pushGeneratorState()
void insertMemberAlign(bool templ=FALSE)
Definition outputlist.h:517
void startDescForItem()
Definition outputlist.h:547
void disableAllBut(OutputType o)
void popGeneratorState()
void writeSummaryLink(const QCString &file, const QCString &anchor, const QCString &title, bool first)
Definition outputlist.h:614
void writeAnchor(const QCString &fileName, const QCString &name)
Definition outputlist.h:523
void endBold()
Definition outputlist.h:563
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:455
void endClassDiagram(const ClassDiagram &d, const QCString &f, const QCString &n)
Definition outputlist.h:596
void endLabels()
Definition outputlist.h:742
void endQuickIndices()
Definition outputlist.h:604
void writePageOutline()
Definition outputlist.h:616
void endDotGraph(DotClassGraph &g)
Definition outputlist.h:650
void endItemList()
Definition outputlist.h:431
void startDotGraph()
Definition outputlist.h:648
void writeLabel(const QCString &l, bool isLast)
Definition outputlist.h:740
void startLabels()
Definition outputlist.h:738
void startContents()
Definition outputlist.h:618
void startCompoundTemplateParams()
Definition outputlist.h:501
void endMemberDeclaration(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:571
void enableAll()
void endMemberHeader()
Definition outputlist.h:471
void startMemberItem(const QCString &anchor, OutputGenerator::MemberItemType type, const QCString &id=QCString())
Definition outputlist.h:493
void endTypewriter()
Definition outputlist.h:451
void lineBreak(const QCString &style=QCString())
Definition outputlist.h:559
void parseText(const QCString &textStr)
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:442
void startMemberHeader(const QCString &anchor, int typ=2)
Definition outputlist.h:469
void endMemberSections()
Definition outputlist.h:463
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:422
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
bool startsWith(const char *s) const
Definition qcstring.h:507
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
QCString lower() const
Definition qcstring.h:249
bool endsWith(const char *s) const
Definition qcstring.h:524
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
QCString right(size_t len) const
Definition qcstring.h:234
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:172
QCString left(size_t len) const
Definition qcstring.h:229
void clear()
Definition qcstring.h:182
static RequirementManager & instance()
void addRequirementRefsForSymbol(const Definition *symbol)
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:76
Text streaming class that buffers data.
Definition textstream.h:36
Wrapper class for a number of boolean properties.
Definition types.h:654
@ 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:792
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:563
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:822
Definition * toDefinition(DefinitionMutable *dm)
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:48
#define AUTO_TRACE(...)
Definition docnode.cpp:47
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:49
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55
@ Collaboration
Definition dotgraph.h:31
@ Inheritance
Definition dotgraph.h:31
static bool isSpecialization(const ArgumentLists &srcTempArgLists, const ArgumentLists &dstTempArgLists)
Definition doxygen.cpp:5982
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:1967
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:384
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const QCString &navPath)
Definition index.cpp:427
void endTitle(OutputList &ol, const QCString &fileName, const QCString &name)
Definition index.cpp:394
void startFile(OutputList &ol, const QCString &name, bool isSource, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel, const QCString &allMembersFile)
Definition index.cpp:401
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:448
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:530
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:571
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
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:42
QCString name
Definition arguments.h:44
QCString defval
Definition arguments.h:46
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:230
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:1788
MemberListType type
Definition layout.h:118
QCString subtitle(SrcLangExt lang) const
Definition layout.cpp:1793
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:1800
Definition layout.h:102
QCString title(SrcLangExt lang) const
Definition layout.cpp:1781
This file contains a number of basic enums and types.
CodeSymbolType
Definition types.h:481
MemberType
Definition types.h:552
@ Enumeration
Definition types.h:557
@ EnumValue
Definition types.h:558
@ Interface
Definition types.h:565
@ Variable
Definition types.h:555
@ Property
Definition types.h:563
@ Typedef
Definition types.h:556
@ Function
Definition types.h:554
@ Service
Definition types.h:566
Protection
Definition types.h:32
SrcLangExt
Definition types.h:207
Specifier
Definition types.h:80
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const QCString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const QCString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:1998
QCString removeRedundantWhiteSpace(const QCString &s)
Definition util.cpp:568
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5191
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition util.cpp:3727
bool protectionLevelVisible(Protection prot)
Definition util.cpp:5937
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:3944
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
Definition util.cpp:5439
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1276
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:4805
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:4892
QCString demangleCSharpGenericName(const QCString &name, const QCString &templArgs)
Definition util.cpp:6923
QCString removeAnonymousScopes(const QCString &str)
Definition util.cpp:162
void createSubDirs(const Dir &d)
Definition util.cpp:3621
QCString stripScope(const QCString &name)
Definition util.cpp:3760
QCString inlineTemplateArgListToDoc(const ArgumentList &al)
Definition util.cpp:1204
QCString stripExtension(const QCString &fName)
Definition util.cpp:4924
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:299
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3485
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:3893
EntryType guessSection(const QCString &name)
Definition util.cpp:339
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:6229
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
Definition util.cpp:1231
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:5897
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:1106
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:894
QCString convertToId(const QCString &s)
Definition util.cpp:3853
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:1157
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:4902
A bunch of utility functions.