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