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 {
1157 addMemberToList(MemberListType::PubAttribs(),md,TRUE);
1158 const int MAX_CELL_SIZE=60;
1159 isSimple=md->typeString().length()+md->name().length()+md->argsString().length()<=MAX_CELL_SIZE;
1160 }
1161 break;
1162 case Protection::Private:
1163 addMemberToList(MemberListType::PriAttribs(),md,TRUE);
1164 break;
1165 }
1166 }
1167 else if (md->isTypedef() || md->isEnumerate() || md->isEnumValue())
1168 {
1169 switch (prot)
1170 {
1171 case Protection::Protected:
1172 addMemberToList(MemberListType::ProTypes(),md,TRUE);
1173 break;
1174 case Protection::Package:
1175 addMemberToList(MemberListType::PacTypes(),md,TRUE);
1176 break;
1177 case Protection::Public:
1178 addMemberToList(MemberListType::PubTypes(),md,TRUE);
1179 isSimple=!md->isEnumerate() &&
1180 !md->isEnumValue() &&
1181 md->typeString().find(")(")==-1; // func ptr typedef
1182 break;
1183 case Protection::Private:
1184 addMemberToList(MemberListType::PriTypes(),md,TRUE);
1185 break;
1186 }
1187 }
1188 else // member function
1189 {
1190 switch (prot)
1191 {
1192 case Protection::Protected:
1193 addMemberToList(MemberListType::ProMethods(),md,TRUE);
1194 break;
1195 case Protection::Package:
1196 addMemberToList(MemberListType::PacMethods(),md,TRUE);
1197 break;
1198 case Protection::Public:
1199 addMemberToList(MemberListType::PubMethods(),md,TRUE);
1200 break;
1201 case Protection::Private:
1202 addMemberToList(MemberListType::PriMethods(),md,TRUE);
1203 break;
1204 }
1205 }
1206 }
1207 break;
1208 }
1209 }
1210 if (!isSimple) // not a simple field -> not a simple struct
1211 {
1212 m_isSimple = FALSE;
1213 }
1214 //printf("adding %s simple=%d total_simple=%d\n",qPrint(name()),isSimple,m_isSimple);
1215
1216 /*******************************************************/
1217 /* insert member in the detailed documentation section */
1218 /*******************************************************/
1219 if ((md->isRelated() && protectionLevelVisible(prot)) || md->isFriend())
1220 {
1221 addMemberToList(MemberListType::RelatedMembers(),md,FALSE);
1222 }
1223 else if (md->isFunction() &&
1224 md->protection()==Protection::Private &&
1225 (md->virtualness()!=Specifier::Normal || md->isOverride() || md->isFinal()) &&
1226 Config_getBool(EXTRACT_PRIV_VIRTUAL))
1227 {
1228 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1229 }
1230 else
1231 {
1232 switch (md->memberType())
1233 {
1234 case MemberType::Service: // UNO IDL
1235 addMemberToList(MemberListType::ServiceMembers(),md,FALSE);
1236 break;
1237 case MemberType::Interface: // UNO IDL
1238 addMemberToList(MemberListType::InterfaceMembers(),md,FALSE);
1239 break;
1241 addMemberToList(MemberListType::PropertyMembers(),md,FALSE);
1242 break;
1243 case MemberType::Event:
1244 addMemberToList(MemberListType::EventMembers(),md,FALSE);
1245 break;
1246 case MemberType::Signal: // fall through
1247 case MemberType::DCOP:
1248 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1249 break;
1250 case MemberType::Slot:
1251 if (protectionLevelVisible(prot))
1252 {
1253 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1254 }
1255 break;
1256 default: // any of the other members
1257 if (protectionLevelVisible(prot))
1258 {
1259 switch (md->memberType())
1260 {
1262 addMemberToList(MemberListType::TypedefMembers(),md,FALSE);
1263 break;
1265 addMemberToList(MemberListType::EnumMembers(),md,FALSE);
1266 break;
1268 addMemberToList(MemberListType::EnumValMembers(),md,FALSE);
1269 break;
1271 if (md->isConstructor() || md->isDestructor())
1272 {
1273 m_memberLists.get(MemberListType::Constructors(),MemberListContainer::Class)->push_back(md);
1274 }
1275 else
1276 {
1277 addMemberToList(MemberListType::FunctionMembers(),md,FALSE);
1278 }
1279 break;
1281 addMemberToList(MemberListType::VariableMembers(),md,FALSE);
1282 break;
1283 case MemberType::Define:
1284 warn(md->getDefFileName(),md->getDefLine()-1,"A define ({}) cannot be made a member of {}",
1285 md->name(), this->name());
1286 break;
1287 default:
1288 err("Unexpected member type '{}' found!\n",md->memberTypeName());
1289 }
1290 }
1291 break;
1292 }
1293 }
1294
1295 /*************************************************/
1296 /* insert member in the appropriate member group */
1297 /*************************************************/
1298 // Note: this must be done AFTER inserting the member in the
1299 // regular groups
1300 //addMemberToGroup(md,groupId);
1301
1302 }
1303
1304 if (md->virtualness()==Specifier::Pure)
1305 {
1306 m_isAbstract=true;
1307 }
1308
1309 if (md->name()=="operator->")
1310 {
1311 m_arrowOperator=md;
1312 }
1313
1314 if (addToAllList &&
1315 !(Config_getBool(HIDE_FRIEND_COMPOUNDS) &&
1316 md->isFriend() &&
1317 (md->typeString()=="friend class" ||
1318 md->typeString()=="friend struct" ||
1319 md->typeString()=="friend union")))
1320 {
1321 //printf("=======> adding member %s to class %s\n",qPrint(md->name()),qPrint(name()));
1322
1324 mni->push_back(std::make_unique<MemberInfo>(md,prot,md->virtualness(),false,false));
1325 }
1326
1327 // if we already created template instances before inserting this member (i.e. due to a typedef or using statement)
1328 // then we also need to insert the member in the template instance.
1329 for (const auto &ti : getTemplateInstances())
1330 {
1331 AUTO_TRACE_ADD("member {} of class {} with template instance {}\n",md->name(),name(),ti.templSpec);
1332 ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
1333 if (cdm)
1334 {
1335 cdm->addMemberToTemplateInstance(md,templateArguments(),ti.templSpec);
1336 }
1337 }
1338
1339}
1340
1345
1346// compute the anchors for all members
1348{
1349 for (auto &ml : m_memberLists)
1350 {
1351 if (!ml->listType().isDetailed())
1352 {
1353 ml->setAnchors();
1354 }
1355 }
1356
1357 for (const auto &mg : m_memberGroups)
1358 {
1359 mg->setAnchors();
1360 }
1361}
1362
1364{
1365 for (const auto &mg : m_memberGroups)
1366 {
1367 mg->distributeMemberGroupDocumentation();
1368 }
1369}
1370
1372{
1376 for (const auto &mg : m_memberGroups)
1377 {
1378 mg->findSectionsInDocumentation(this);
1379 }
1380 for (auto &ml : m_memberLists)
1381 {
1382 if (!ml->listType().isDetailed())
1383 {
1384 ml->findSectionsInDocumentation(this);
1385 }
1386 }
1387}
1388
1389
1390// add a file name to the used files set
1392{
1393 if (fd == nullptr) return;
1394
1395 if (std::find(m_files.begin(), m_files.end(), fd) == m_files.end()) m_files.push_back(fd);
1396
1397 for (const auto &ti : m_templateInstances)
1398 {
1399 if (ClassDefMutable *cdm = toClassDefMutable(ti.classDef)) cdm->insertUsedFile(fd);
1400 }
1401}
1402
1404{
1405 if (bcd.prot!=Protection::Public || bcd.virt!=Specifier::Normal)
1406 {
1407 ol.startTypewriter();
1408 ol.docify(" [");
1409 StringVector sl;
1410 if (bcd.prot==Protection::Protected) sl.emplace_back("protected");
1411 else if (bcd.prot==Protection::Private) sl.emplace_back("private");
1412 if (bcd.virt==Specifier::Virtual) sl.emplace_back("virtual");
1413 bool first=true;
1414 for (const auto &s : sl)
1415 {
1416 if (!first) ol.docify(", ");
1417 ol.docify(s);
1418 first=false;
1419 }
1420 ol.docify("]");
1421 ol.endTypewriter();
1422 }
1423}
1424
1426 const QCString &includeName,bool local, bool force)
1427{
1428 //printf("ClassDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,includeName,local,force);
1429 if (!m_incInfo) m_incInfo = std::make_unique<IncludeInfo>();
1430 if ((!includeName.isEmpty() && m_incInfo->includeName.isEmpty()) ||
1431 (fd!=nullptr && m_incInfo->fileDef==nullptr)
1432 )
1433 {
1434 //printf("Setting file info\n");
1435 m_incInfo->fileDef = fd;
1436 m_incInfo->includeName = includeName;
1438 }
1439 if (force && !includeName.isEmpty())
1440 {
1441 m_incInfo->includeName = includeName;
1443 }
1444}
1445
1446// TODO: fix this: a nested template class can have multiple outer templates
1447//ArgumentList *ClassDefImpl::outerTemplateArguments() const
1448//{
1449// int ti;
1450// ClassDef *pcd=nullptr;
1451// int pi=0;
1452// if (m_tempArgs) return m_tempArgs;
1453// // find the outer most class scope
1454// while ((ti=name().find("::",pi))!=-1 &&
1455// (pcd=getClass(name().left(ti)))==0
1456// ) pi=ti+2;
1457// if (pcd)
1458// {
1459// return pcd->templateArguments();
1460// }
1461// return nullptr;
1462//}
1463
1464static void searchTemplateSpecs(/*in*/ const Definition *d,
1465 /*out*/ ArgumentLists &result,
1466 /*out*/ QCString &name,
1467 /*in*/ SrcLangExt lang)
1468{
1470 {
1471 if (d->getOuterScope())
1472 {
1473 searchTemplateSpecs(d->getOuterScope(),result,name,lang);
1474 }
1475 const ClassDef *cd=toClassDef(d);
1476 if (!name.isEmpty()) name+="::";
1477 QCString clName = d->localName();
1478 if (clName.endsWith("-p"))
1479 {
1480 clName = clName.left(clName.length()-2);
1481 }
1482 name+=clName;
1483 bool isSpecialization = d->localName().find('<')!=-1;
1484 if (!cd->templateArguments().empty())
1485 {
1486 result.push_back(cd->templateArguments());
1487 if (!isSpecialization)
1488 {
1489 name+=tempArgListToString(cd->templateArguments(),lang);
1490 }
1491 }
1492 }
1493 else
1494 {
1495 name+=d->qualifiedName();
1496 }
1497}
1498
1500 const QCString &type,SrcLangExt lang) const
1501{
1502 ArgumentLists specs;
1503 QCString name;
1504 searchTemplateSpecs(d,specs,name,lang);
1505 if (!specs.empty()) // class has template scope specifiers
1506 {
1508 for (const ArgumentList &al : specs)
1509 {
1510 ol.docify("template<");
1511 auto it = al.begin();
1512 while (it!=al.end())
1513 {
1514 Argument a = *it;
1516 d, // scope
1517 getFileDef(), // fileScope
1518 this, // self
1519 a.type, // text
1520 FALSE // autoBreak
1521 );
1522 if (!a.name.isEmpty())
1523 {
1524 ol.docify(" ");
1525 ol.docify(a.name);
1526 }
1527 if (a.defval.length()!=0)
1528 {
1529 ol.docify(" = ");
1530 ol.docify(a.defval);
1531 }
1532 ++it;
1533 if (it!=al.end()) ol.docify(", ");
1534 }
1535 ol.docify(">");
1536 ol.lineBreak();
1537 }
1538 if (!m_requiresClause.isEmpty())
1539 {
1540 ol.docify("requires ");
1542 d, // scope
1543 getFileDef(), // fileScope
1544 this, // self
1545 m_requiresClause, // text
1546 FALSE // autoBreak
1547 );
1548 ol.lineBreak();
1549 }
1550 ol.docify(type.lower()+" "+name);
1552 }
1553}
1554
1555void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) const
1556{
1557 if (hasBriefDescription())
1558 {
1559 ol.startParagraph();
1560 ol.pushGeneratorState();
1562 ol.writeString(" - ");
1563 ol.popGeneratorState();
1565 briefLine(),
1566 this,
1567 nullptr,
1569 DocOptions()
1570 .setIndexWords(true)
1571 .setSingleLine(true));
1572 ol.pushGeneratorState();
1574 ol.writeString(" \n");
1576 ol.popGeneratorState();
1577
1578 if (hasDetailedDescription() || exampleFlag)
1579 {
1580 writeMoreLink(ol,anchor());
1581 }
1582
1583 ol.endParagraph();
1584 }
1585 ol.writeSynopsis();
1586}
1587
1589{
1590 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1591
1592 ol.startTextBlock();
1593
1594 if (getLanguage()==SrcLangExt::Cpp)
1595 {
1597 }
1598
1599 // repeat brief description
1600 if (!briefDescription().isEmpty() && repeatBrief)
1601 {
1603 briefLine(),
1604 this,
1605 nullptr,
1607 DocOptions());
1608 }
1609 if (!briefDescription().isEmpty() && repeatBrief &&
1610 !documentation().isEmpty())
1611 {
1612 ol.pushGeneratorState();
1614 ol.writeString("\n\n");
1615 ol.popGeneratorState();
1616 }
1617 // write documentation
1618 if (!documentation().isEmpty())
1619 {
1620 ol.generateDoc(docFile(),
1621 docLine(),
1622 this,
1623 nullptr,
1624 documentation(),
1625 DocOptions()
1626 .setIndexWords(true));
1627 }
1628 // write type constraints
1630
1631 ol.generateDoc(
1632 docFile(),docLine(),
1633 this,
1634 nullptr, // memberDef
1636 DocOptions()
1637 .setIndexWords(true));
1638
1639 // write examples
1640 if (hasExamples())
1641 {
1642 ol.startExamples();
1643 ol.startDescForItem();
1645 ol.endDescForItem();
1646 ol.endExamples();
1647 }
1648 writeSourceDef(ol);
1649 ol.endTextBlock();
1650}
1651
1653{
1654 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1655 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1656 return ((!briefDescription().isEmpty() && repeatBrief) ||
1657 (!documentation().isEmpty() || m_tempArgs.hasTemplateDocumentation()) ||
1658 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()));
1659}
1660
1661// write the detailed description for this class
1662void ClassDefImpl::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag,
1663 const QCString &title,const QCString &anchor) const
1664{
1665 if (hasDetailedDescription() || exampleFlag)
1666 {
1667 ol.pushGeneratorState();
1669 ol.writeRuler();
1670 ol.popGeneratorState();
1671
1672 ol.pushGeneratorState();
1674 ol.writeAnchor(QCString(),anchor.isEmpty() ? QCString("details") : anchor);
1675 ol.popGeneratorState();
1676
1677 if (!anchor.isEmpty())
1678 {
1679 ol.pushGeneratorState();
1683 ol.popGeneratorState();
1684 }
1685
1686 ol.startGroupHeader("details");
1687 ol.parseText(title);
1688 ol.endGroupHeader();
1689
1691 }
1692 else
1693 {
1694 //writeTemplateSpec(ol,this,pageType);
1695 }
1696}
1697
1699{
1700 QCString result;
1701 SrcLangExt lang = getLanguage();
1702 size_t numFiles = m_files.size();
1703 if (lang==SrcLangExt::Fortran)
1704 {
1705 result = theTranslator->trGeneratedFromFilesFortran(
1706 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1707 numFiles==1);
1708 }
1709 else if (isJavaEnum())
1710 {
1711 result = theTranslator->trEnumGeneratedFromFiles(numFiles==1);
1712 }
1713 else if (m_compType==Service)
1714 {
1715 result = theTranslator->trServiceGeneratedFromFiles(numFiles==1);
1716 }
1717 else if (m_compType==Singleton)
1718 {
1719 result = theTranslator->trSingletonGeneratedFromFiles(numFiles==1);
1720 }
1721 else
1722 {
1723 result = theTranslator->trGeneratedFromFiles(
1724 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1725 numFiles==1);
1726 }
1727 return result;
1728}
1729
1731{
1732 ol.pushGeneratorState();
1734
1735
1736 ol.writeRuler();
1737 ol.pushGeneratorState();
1739 ol.startParagraph();
1741 ol.endParagraph();
1742 ol.popGeneratorState();
1746
1747 bool first=TRUE;
1748 for (const auto &fd : m_files)
1749 {
1750 if (first)
1751 {
1752 first=FALSE;
1753 ol.startItemList();
1754 }
1755
1756 ol.startItemListItem();
1757 QCString path=fd->getPath();
1758 if (Config_getBool(FULL_PATH_NAMES))
1759 {
1760 ol.docify(stripFromPath(path));
1761 }
1762
1763 QCString fname = fd->name();
1764 if (!fd->getVersion().isEmpty()) // append version if available
1765 {
1766 fname += " (" + fd->getVersion() + ")";
1767 }
1768
1769 // for HTML
1770 ol.pushGeneratorState();
1772 if (fd->generateSourceFile())
1773 {
1774 ol.writeObjectLink(QCString(),fd->getSourceFileBase(),QCString(),fname);
1775 }
1776 else if (fd->isLinkable())
1777 {
1778 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
1779 }
1780 else
1781 {
1782 ol.startBold();
1783 ol.docify(fname);
1784 ol.endBold();
1785 }
1786 ol.popGeneratorState();
1787
1788 // for other output formats
1789 ol.pushGeneratorState();
1791 if (fd->isLinkable())
1792 {
1793 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
1794 }
1795 else
1796 {
1797 ol.docify(fname);
1798 }
1799 ol.popGeneratorState();
1800
1801 ol.endItemListItem();
1802 }
1803 if (!first) ol.endItemList();
1804
1805 ol.popGeneratorState();
1806}
1807
1809{
1810 int count=0;
1811 for (const auto &ibcd : m_inheritedBy)
1812 {
1813 const ClassDef *icd=ibcd.classDef;
1814 if ( icd->isVisibleInHierarchy()) count++;
1815 }
1816 return count;
1817}
1818
1820{
1821 int count=0;
1822 for (const auto &ibcd : m_inherits)
1823 {
1824 const ClassDef *icd=ibcd.classDef;
1825 if ( icd->isVisibleInHierarchy()) count++;
1826 }
1827 return count;
1828}
1829
1834
1836{
1837 bool haveDot = Config_getBool(HAVE_DOT);
1838 auto classGraph = m_typeInheritanceGraph;
1839
1840 if (classGraph == CLASS_GRAPH_t::NO) return;
1841 // count direct inheritance relations
1842 int count=countInheritanceNodes();
1843
1844 bool renderDiagram = FALSE;
1845 if (haveDot && (classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH))
1846 // write class diagram using dot
1847 {
1848 DotClassGraph inheritanceGraph(this,GraphType::Inheritance);
1849 if (inheritanceGraph.isTooBig())
1850 {
1851 warn_uncond("Inheritance graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
1852 name(), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
1853 }
1854 else if (!inheritanceGraph.isTrivial())
1855 {
1856 ol.pushGeneratorState();
1858 ol.startDotGraph();
1859 ol.parseText(theTranslator->trClassDiagram(displayName()));
1860 ol.endDotGraph(inheritanceGraph);
1861 ol.popGeneratorState();
1862 renderDiagram = TRUE;
1863 }
1864 }
1865 else if ((classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH || classGraph==CLASS_GRAPH_t::BUILTIN) && count>0)
1866 // write class diagram using built-in generator
1867 {
1868 ClassDiagram diagram(this); // create a diagram of this class.
1869 ol.startClassDiagram();
1871 ol.parseText(theTranslator->trClassDiagram(displayName()));
1874 renderDiagram = TRUE;
1875 }
1876
1877 if (renderDiagram) // if we already show the inheritance relations graphically,
1878 // then hide the text version
1879 {
1881 }
1882
1883 count = countInheritsNodes();
1884 if (count>0)
1885 {
1886 auto replaceFunc = [this,&ol](size_t entryIndex)
1887 {
1888 for (size_t index=0; index<m_inherits.size() ; index++)
1889 {
1890 const BaseClassDef &bcd=m_inherits[index];
1891 const ClassDef *cd=bcd.classDef;
1892
1893 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1894 {
1895 if (index==entryIndex) // found the requested index
1896 {
1897 // use the class name but with the template arguments as given
1898 // in the inheritance relation
1900 cd->displayName(),bcd.templSpecifiers);
1901
1902 if (cd->isLinkable())
1903 {
1905 cd->getOutputFileBase(),
1906 cd->anchor(),
1907 displayName);
1908 }
1909 else
1910 {
1911 ol.docify(displayName);
1912 }
1913 return;
1914 }
1915 }
1916 }
1917 };
1918
1919 ol.startParagraph();
1920 writeMarkerList(ol,
1921 theTranslator->trInheritsList(count).str(),
1922 static_cast<size_t>(count),
1923 replaceFunc);
1924 ol.endParagraph();
1925 }
1926
1927 // write subclasses
1928 count = countInheritedByNodes();
1929 if (count>0)
1930 {
1931 auto replaceFunc = [this,&ol](size_t entryIndex)
1932 {
1933 for (size_t index=0; index<m_inheritedBy.size() ; index++)
1934 {
1935 const BaseClassDef &bcd=m_inheritedBy[index];
1936 const ClassDef *cd=bcd.classDef;
1937 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1938 {
1939 if (index==entryIndex) // found the requested index
1940 {
1941 if (cd->isLinkable())
1942 {
1945 }
1946 else
1947 {
1948 ol.docify(cd->displayName());
1949 }
1950 return;
1951 }
1952 }
1953 }
1954 };
1955
1956 ol.startParagraph();
1957 writeMarkerList(ol,
1958 theTranslator->trInheritedByList(count).str(),
1959 static_cast<size_t>(count),
1960 replaceFunc);
1961 ol.endParagraph();
1962 }
1963
1964 if (renderDiagram)
1965 {
1966 ol.enableAll();
1967 }
1968}
1969
1971{
1972 if (Config_getBool(HAVE_DOT) && m_hasCollaborationGraph /*&& Config_getBool(COLLABORATION_GRAPH)*/)
1973 {
1974 DotClassGraph usageImplGraph(this,GraphType::Collaboration);
1975 if (usageImplGraph.isTooBig())
1976 {
1977 warn_uncond("Collaboration graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
1978 name(), usageImplGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
1979 }
1980 else if (!usageImplGraph.isTrivial())
1981 {
1982 ol.pushGeneratorState();
1984 ol.startDotGraph();
1985 ol.parseText(theTranslator->trCollaborationDiagram(displayName()));
1986 ol.endDotGraph(usageImplGraph);
1987 ol.popGeneratorState();
1988 }
1989 }
1990}
1991
1992
1994{
1995 if (m_incInfo)
1996 {
1997 QCString nm;
1998 const StringVector &paths = Config_getList(STRIP_FROM_PATH);
1999 if (!paths.empty() && m_incInfo->fileDef)
2000 {
2001 QCString abs = m_incInfo->fileDef->absFilePath();
2002 QCString potential;
2003 size_t length = 0;
2004 for (const auto &s : paths)
2005 {
2006 FileInfo info(s);
2007 if (info.exists())
2008 {
2009 QCString prefix = info.absFilePath();
2010 if (prefix.at(prefix.length() - 1) != '/')
2011 {
2012 prefix += '/';
2013 }
2014
2015 if (prefix.length() > length &&
2016 qstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare
2017 {
2018 length = prefix.length();
2019 potential = abs.right(abs.length() - prefix.length());
2020 }
2021 }
2022 }
2023
2024 if (length > 0)
2025 {
2026 nm = potential;
2027 }
2028 }
2029
2030 if (nm.isEmpty())
2031 {
2032 nm = m_incInfo->includeName;
2033 }
2034
2035 ol.startParagraph();
2036 ol.docify(theTranslator->trDefinedIn()+" ");
2037 ol.startTypewriter();
2038 ol.docify("<");
2039 if (m_incInfo->fileDef)
2040 {
2041 ol.writeObjectLink(QCString(),m_incInfo->fileDef->includeName(),QCString(),nm);
2042 }
2043 else
2044 {
2045 ol.docify(nm);
2046 }
2047 ol.docify(">");
2048 ol.endTypewriter();
2049 ol.endParagraph();
2050 }
2051
2052 // Write a summary of the Slice definition including metadata.
2053 ol.startParagraph();
2054 ol.startTypewriter();
2055 if (!m_metaData.isEmpty())
2056 {
2057 ol.docify(m_metaData);
2058 ol.lineBreak();
2059 }
2060 if (m_spec.isLocal())
2061 {
2062 ol.docify("local ");
2063 }
2064 if (m_spec.isInterface())
2065 {
2066 ol.docify("interface ");
2067 }
2068 else if (m_spec.isStruct())
2069 {
2070 ol.docify("struct ");
2071 }
2072 else if (m_spec.isException())
2073 {
2074 ol.docify("exception ");
2075 }
2076 else
2077 {
2078 ol.docify("class ");
2079 }
2080 ol.docify(stripScope(name()));
2081 if (!m_inherits.empty())
2082 {
2083 if (m_spec.isInterface() || m_spec.isException())
2084 {
2085 ol.docify(" extends ");
2086 bool first=true;
2087 for (const auto &ibcd : m_inherits)
2088 {
2089 if (!first) ol.docify(", ");
2090 ClassDef *icd = ibcd.classDef;
2091 ol.docify(icd->name());
2092 first=false;
2093 }
2094 }
2095 else
2096 {
2097 // Must be a class.
2098 bool implements = false;
2099 for (const auto &ibcd : m_inherits)
2100 {
2101 ClassDef *icd = ibcd.classDef;
2102 if (icd->isInterface())
2103 {
2104 implements = true;
2105 }
2106 else
2107 {
2108 ol.docify(" extends ");
2109 ol.docify(icd->name());
2110 }
2111 }
2112 if (implements)
2113 {
2114 ol.docify(" implements ");
2115 bool first = true;
2116 for (const auto &ibcd : m_inherits)
2117 {
2118 ClassDef *icd = ibcd.classDef;
2119 if (icd->isInterface())
2120 {
2121 if (!first) ol.docify(", ");
2122 first = false;
2123 ol.docify(icd->name());
2124 }
2125 }
2126 }
2127 }
2128 }
2129 ol.docify(" { ... }");
2130 ol.endTypewriter();
2131 ol.endParagraph();
2132}
2133
2135{
2136 if (m_incInfo /*&& Config_getBool(SHOW_HEADERFILE)*/)
2137 {
2138 SrcLangExt lang = getLanguage();
2139 QCString nm=m_incInfo->includeName.isEmpty() ?
2140 (m_incInfo->fileDef ?
2141 m_incInfo->fileDef->docName() : QCString()
2142 ) :
2143 m_incInfo->includeName;
2144 if (!nm.isEmpty())
2145 {
2146 ol.startParagraph();
2147 ol.startTypewriter();
2148 ol.docify(::includeStatement(lang,m_incInfo->kind));
2149 ol.docify(::includeOpen(lang,m_incInfo->kind));
2150 ol.pushGeneratorState();
2152 ol.docify(nm);
2155 if (m_incInfo->fileDef)
2156 {
2157 ol.writeObjectLink(QCString(),m_incInfo->fileDef->includeName(),QCString(),nm);
2158 }
2159 else
2160 {
2161 ol.docify(nm);
2162 }
2163 ol.popGeneratorState();
2164 ol.docify(::includeClose(lang,m_incInfo->kind));
2165 ol.endTypewriter();
2166 ol.endParagraph();
2167 }
2168 }
2169}
2170
2171void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) const
2172{
2173 // write user defined member groups
2174 for (const auto &mg : m_memberGroups)
2175 {
2176 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
2177 {
2178 mg->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,showInline);
2179 }
2180 else // add this group to the corresponding member section
2181 {
2182 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
2183 //mg->addToDeclarationSection();
2184 }
2185 }
2186}
2187
2189{
2190 // nested classes
2191 m_innerClasses.writeDeclaration(ol,nullptr,title,TRUE);
2192}
2193
2195{
2196 m_innerClasses.writeDocumentation(ol,this);
2197}
2198
2200{
2201 //printf("%s: ClassDefImpl::startMemberDocumentation()\n",qPrint(name()));
2202 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2203 {
2206 }
2207}
2208
2210{
2211 //printf("%s: ClassDefImpl::endMemberDocumentation()\n",qPrint(name()));
2212 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2213 {
2216 }
2217}
2218
2220{
2221 //printf("%s: ClassDefImpl::startMemberDeclarations()\n",qPrint(name()));
2223}
2224
2226{
2227 //printf("%s: ClassDefImpl::endMemberDeclarations()\n",qPrint(name()));
2228 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
2229 if (!inlineInheritedMembers && countAdditionalInheritedMembers()>0)
2230 {
2231 ol.startMemberHeader("inherited");
2232 ol.parseText(theTranslator->trAdditionalInheritedMembers());
2233 ol.endMemberHeader();
2235 }
2236 ol.endMemberSections();
2237}
2238
2240{
2241 ol.pushGeneratorState();
2243 ol.writeString("\n");
2244 ol.startGroupHeader();
2245 ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
2246 ol.endGroupHeader();
2247 ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString(PROJECT_NAME)));
2248 ol.popGeneratorState();
2249}
2250
2251
2253{
2254 static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2255 ol.pushGeneratorState();
2257 bool first=TRUE;
2258 SrcLangExt lang = getLanguage();
2259
2260 if (lang!=SrcLangExt::VHDL)
2261 {
2262 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2263 {
2264 if (lde->kind()==LayoutDocEntry::ClassNestedClasses &&
2265 m_innerClasses.declVisible()
2266 )
2267 {
2268 for (const auto &innerCd : m_innerClasses)
2269 {
2270 if (!innerCd->isAnonymous() &&
2271 !innerCd->isExtension() &&
2272 (innerCd->protection()!=Protection::Private || extractPrivate) &&
2273 innerCd->visibleInParentsDeclList()
2274 )
2275 {
2276 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection *>(lde.get());
2277 ol.writeSummaryLink(QCString(),"nested-classes",ls->title(lang),first);
2278 first=FALSE;
2279 break;
2280 }
2281 }
2282 }
2283 else if (lde->kind()==LayoutDocEntry::ClassAllMembersLink &&
2285 !Config_getBool(OPTIMIZE_OUTPUT_FOR_C)
2286 )
2287 {
2288 ol.writeSummaryLink(getMemberListFileName(),"all-members-list",theTranslator->trListOfAllMembers(),first);
2289 first=FALSE;
2290 }
2291 else if (lde->kind()==LayoutDocEntry::MemberDecl)
2292 {
2293 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2294 if (lmd)
2295 {
2296 MemberList * ml = getMemberList(lmd->type);
2297 if (ml && ml->declVisible())
2298 {
2299 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
2300 first=FALSE;
2301 }
2302 }
2303 }
2304 }
2305 }
2306 else // VDHL only
2307 {
2308 for (const auto &s : m_vhdlSummaryTitles)
2309 {
2310 ol.writeSummaryLink(QCString(),convertToId(s),s,first);
2311 first=FALSE;
2312 }
2313 }
2314 if (!first)
2315 {
2316 ol.writeString(" </div>\n");
2317 }
2318 ol.popGeneratorState();
2319}
2320
2325
2327{
2328 if (!isLinkableInProject() || isArtificial()) return;
2329 tagFile << " <compound kind=\"";
2330 if (isFortran() && (compoundTypeString() == "type"))
2331 tagFile << "struct";
2332 else
2333 tagFile << compoundTypeString();
2334 tagFile << "\"";
2335 if (isObjectiveC()) { tagFile << " objc=\"yes\""; }
2336 tagFile << ">\n";
2337 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
2340 tagFile << " <filename>" << convertToXML(fn) << "</filename>\n";
2341 if (!anchor().isEmpty())
2342 {
2343 tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
2344 }
2345 QCString idStr = id();
2346 if (!idStr.isEmpty())
2347 {
2348 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
2349 }
2350 for (const Argument &a : m_tempArgs)
2351 {
2352 tagFile << " <templarg>" << convertToXML(a.type);
2353 if (!a.name.isEmpty())
2354 {
2355 tagFile << " " << convertToXML(a.name);
2356 }
2357 tagFile << "</templarg>\n";
2358 }
2359 for (const auto &ibcd : m_inherits)
2360 {
2361 ClassDef *cd=ibcd.classDef;
2362 if (cd && cd->isLinkable())
2363 {
2364 tagFile << " <base";
2365 if (ibcd.prot==Protection::Protected)
2366 {
2367 tagFile << " protection=\"protected\"";
2368 }
2369 else if (ibcd.prot==Protection::Private)
2370 {
2371 tagFile << " protection=\"private\"";
2372 }
2373 if (ibcd.virt==Specifier::Virtual)
2374 {
2375 tagFile << " virtualness=\"virtual\"";
2376 }
2378 cd->displayName(),ibcd.templSpecifiers);
2379 tagFile << ">" << convertToXML(displayName) << "</base>\n";
2380 }
2381 }
2382 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2383 {
2384 switch (lde->kind())
2385 {
2386 case LayoutDocEntry::ClassNestedClasses:
2387 {
2388 for (const auto &innerCd : m_innerClasses)
2389 {
2390 if (innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
2391 protectionLevelVisible(innerCd->protection()) &&
2392 !innerCd->isEmbeddedInOuterScope()
2393 )
2394 {
2395 tagFile << " <class kind=\"" << innerCd->compoundTypeString() <<
2396 "\">" << convertToXML(innerCd->name()) << "</class>\n";
2397 }
2398 }
2399 }
2400 break;
2401 case LayoutDocEntry::MemberDecl:
2402 {
2403 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2404 if (lmd)
2405 {
2406 MemberList * ml = getMemberList(lmd->type);
2407 if (ml)
2408 {
2409 ml->writeTagFile(tagFile);
2410 }
2411 }
2412 }
2413 break;
2414 case LayoutDocEntry::MemberGroups:
2415 {
2416 for (const auto &mg : m_memberGroups)
2417 {
2418 mg->writeTagFile(tagFile);
2419 }
2420 }
2421 break;
2422 default:
2423 break;
2424 }
2425 }
2426 writeDocAnchorsToTagFile(tagFile);
2427 tagFile << " </compound>\n";
2428}
2429
2430/** Write class documentation inside another container (i.e. a group) */
2432{
2433 bool isSimple = m_isSimple;
2434
2435 ol.addIndexItem(name(),QCString());
2436 //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",qPrint(name()));
2437
2438 // part 1: anchor and title
2439 QCString s = compoundTypeString()+" "+name();
2440
2441 // part 1a
2442 ol.pushGeneratorState();
2444 { // only HTML only
2445 ol.writeAnchor(QCString(),anchor());
2448 ol.parseText(s);
2449 ol.endMemberDocName();
2450 ol.endMemberDoc(FALSE);
2451 ol.writeString("</div>");
2452 ol.startIndent();
2453 }
2454 ol.popGeneratorState();
2455
2456 // part 1b
2457 ol.pushGeneratorState();
2460 { // for LaTeX/RTF only
2462 }
2463 ol.popGeneratorState();
2464
2465 // part 1c
2466 ol.pushGeneratorState();
2468 {
2469 // for LaTeX/RTF/Man
2470 ol.startGroupHeader("",1);
2471 ol.parseText(s);
2472 ol.endGroupHeader(1);
2473 }
2474 ol.popGeneratorState();
2475
2476 SrcLangExt lang=getLanguage();
2477
2478 // part 2: the header and detailed description
2479 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2480 {
2481 switch (lde->kind())
2482 {
2483 case LayoutDocEntry::BriefDesc:
2484 {
2485 // since we already shown the brief description in the
2486 // declaration part of the container, so we use this to
2487 // show the details on top.
2489 }
2490 break;
2491 case LayoutDocEntry::ClassInheritanceGraph:
2493 break;
2494 case LayoutDocEntry::ClassCollaborationGraph:
2496 break;
2497 case LayoutDocEntry::MemberDeclStart:
2499 break;
2500 case LayoutDocEntry::MemberDecl:
2501 {
2502 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2503 if (lmd)
2504 {
2505 ClassDefSet visitedClasses;
2506 if (!isSimple) writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang),TRUE);
2507 }
2508 }
2509 break;
2510 case LayoutDocEntry::MemberGroups:
2512 break;
2513 case LayoutDocEntry::MemberDeclEnd:
2515 break;
2516 case LayoutDocEntry::MemberDefStart:
2518 break;
2519 case LayoutDocEntry::MemberDef:
2520 {
2521 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2522 if (lmd)
2523 {
2524 if (isSimple)
2525 {
2527 }
2528 else
2529 {
2530 writeMemberDocumentation(ol,lmd->type,lmd->title(lang),TRUE);
2531 }
2532 }
2533 }
2534 break;
2535 case LayoutDocEntry::MemberDefEnd:
2537 break;
2538 default:
2539 break;
2540 }
2541 }
2542
2543 // part 3: close the block
2544 ol.pushGeneratorState();
2546 { // HTML only
2547 ol.endIndent();
2548 }
2549 ol.popGeneratorState();
2550}
2551
2553{
2554 // TODO: clean up this mess by moving it to
2555 // the output generators...
2556 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
2557 bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
2558 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
2559
2560 // HTML only
2561 ol.pushGeneratorState();
2563 ol.docify(" ");
2565 anchor.isEmpty() ? QCString("details") : anchor);
2566 ol.parseText(theTranslator->trMore());
2567 ol.endTextLink();
2568 ol.popGeneratorState();
2569
2570 if (!anchor.isEmpty())
2571 {
2572 ol.pushGeneratorState();
2573 // LaTeX + RTF
2577 if (!(usePDFLatex && pdfHyperlinks))
2578 {
2580 }
2581 if (!rtfHyperlinks)
2582 {
2584 }
2585 ol.docify(" ");
2587 ol.parseText(theTranslator->trMore());
2588 ol.endTextLink();
2589 // RTF only
2591 ol.writeString("\\par");
2592 ol.popGeneratorState();
2593 }
2594}
2595
2597{
2598 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2599 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
2600 bool extractLocalClasses = Config_getBool(EXTRACT_LOCAL_CLASSES);
2601 bool linkable = isLinkable();
2602 return (!isAnonymous() && !isExtension() &&
2603 (protection()!=Protection::Private || extractPrivate) &&
2604 (linkable || (!hideUndocClasses && (!isLocal() || extractLocalClasses)))
2605 );
2606}
2607
2608void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const
2609{
2610 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2611 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2612 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2613 SrcLangExt lang = getLanguage();
2615 {
2616 if (!found) // first class
2617 {
2618 if (sliceOpt)
2619 {
2620 if (compoundType()==Interface)
2621 {
2622 ol.startMemberHeader("interfaces");
2623 }
2624 else if (compoundType()==Struct)
2625 {
2626 ol.startMemberHeader("structs");
2627 }
2628 else if (compoundType()==Exception)
2629 {
2630 ol.startMemberHeader("exceptions");
2631 }
2632 else // compoundType==Class
2633 {
2634 ol.startMemberHeader("nested-classes");
2635 }
2636 }
2637 else // non-Slice optimization: single header for class/struct/..
2638 {
2639 ol.startMemberHeader("nested-classes");
2640 }
2641 if (!header.isEmpty())
2642 {
2643 ol.parseText(header);
2644 }
2645 else if (lang==SrcLangExt::VHDL)
2646 {
2648 }
2649 else
2650 {
2651 ol.parseText(lang==SrcLangExt::Fortran ?
2652 theTranslator->trDataTypes() :
2653 theTranslator->trCompounds());
2654 }
2655 ol.endMemberHeader();
2656 ol.startMemberList();
2657 found=TRUE;
2658 }
2660 QCString ctype = compoundTypeString();
2661 QCString cname = displayName(!localNames);
2662 QCString anc = anchor();
2663 if (anc.isEmpty()) anc = cname; else anc.prepend(cname+"_");
2665
2666 if (lang!=SrcLangExt::VHDL) // for VHDL we swap the name and the type
2667 {
2668 if (isSliceLocal())
2669 {
2670 ol.writeString("local ");
2671 }
2672 ol.writeString(ctype);
2673 ol.writeString(" ");
2674 ol.insertMemberAlign();
2675 }
2676 if (isLinkable())
2677 {
2680 anchor(),
2681 cname
2682 );
2683 }
2684 else
2685 {
2686 ol.startBold();
2687 ol.docify(cname);
2688 ol.endBold();
2689 }
2690 if (lang==SrcLangExt::VHDL) // now write the type
2691 {
2692 ol.writeString(" ");
2693 ol.insertMemberAlign();
2695 }
2697
2698 // add the brief description if available
2699 if (!briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
2700 {
2701 auto parser { createDocParser() };
2702 auto ast { validatingParseDoc(*parser.get(),
2703 briefFile(),
2704 briefLine(),
2705 this,
2706 nullptr,
2708 DocOptions()
2709 .setSingleLine(true))
2710 };
2711 if (!ast->isEmpty())
2712 {
2714 ol.writeDoc(ast.get(),this,nullptr);
2715 if (isLinkableInProject())
2716 {
2717 writeMoreLink(ol,anchor());
2718 }
2720 }
2721 }
2723 }
2724}
2725
2727{
2728 StringVector sl;
2729 if (isFinal()) sl.emplace_back("final");
2730 if (isSealed()) sl.emplace_back("sealed");
2731 if (isAbstract()) sl.emplace_back("abstract");
2732 if (isExported()) sl.emplace_back("export");
2733 if (getLanguage()==SrcLangExt::IDL && isPublished()) sl.emplace_back("published");
2734
2735 for (const auto &sx : m_qualifiers)
2736 {
2737 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2738 if (!alreadyAdded)
2739 {
2740 sl.push_back(sx);
2741 }
2742 }
2743
2744 ol.pushGeneratorState();
2746 if (!sl.empty())
2747 {
2748 ol.startLabels();
2749 size_t i=0;
2750 for (const auto &s : sl)
2751 {
2752 i++;
2753 ol.writeLabel(s,i==sl.size());
2754 }
2755 ol.endLabels();
2756 }
2757 ol.popGeneratorState();
2758}
2759
2761{
2762 ol.startContents();
2763
2764 QCString pageType = " ";
2765 pageType += compoundTypeString();
2766
2767 bool exampleFlag=hasExamples();
2768
2769 //---------------------------------------- start flexible part -------------------------------
2770
2771 SrcLangExt lang = getLanguage();
2772
2773 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2774 {
2775 switch (lde->kind())
2776 {
2777 case LayoutDocEntry::BriefDesc:
2778 writeBriefDescription(ol,exampleFlag);
2779 break;
2780 case LayoutDocEntry::ClassIncludes:
2781 if (lang==SrcLangExt::Slice)
2782 {
2784 }
2785 else
2786 {
2788 }
2789 break;
2790 case LayoutDocEntry::ClassInheritanceGraph:
2792 break;
2793 case LayoutDocEntry::ClassCollaborationGraph:
2795 break;
2796 case LayoutDocEntry::ClassAllMembersLink:
2797 //writeAllMembersLink(ol); // this is now part of the summary links
2798 break;
2799 case LayoutDocEntry::MemberDeclStart:
2801 break;
2802 case LayoutDocEntry::MemberGroups:
2804 break;
2805 case LayoutDocEntry::MemberDecl:
2806 {
2807 ClassDefSet visitedClasses;
2808 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2809 if (lmd)
2810 {
2811 writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang));
2812 }
2813 }
2814 break;
2815 case LayoutDocEntry::ClassNestedClasses:
2816 {
2817 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2818 if (ls)
2819 {
2820 writeNestedClasses(ol,ls->title(lang));
2821 }
2822 }
2823 break;
2824 case LayoutDocEntry::MemberDeclEnd:
2826 break;
2827 case LayoutDocEntry::DetailedDesc:
2828 {
2829 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2830 if (ls)
2831 {
2832 writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang));
2833 }
2834 }
2835 break;
2836 case LayoutDocEntry::MemberDefStart:
2838 break;
2839 case LayoutDocEntry::ClassInlineClasses:
2841 break;
2842 case LayoutDocEntry::MemberDef:
2843 {
2844 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2845 if (lmd)
2846 {
2847 writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
2848 }
2849 }
2850 break;
2851 case LayoutDocEntry::MemberDefEnd:
2853 break;
2854 case LayoutDocEntry::ClassUsedFiles:
2855 showUsedFiles(ol);
2856 break;
2857 case LayoutDocEntry::AuthorSection:
2859 break;
2860 case LayoutDocEntry::NamespaceNestedNamespaces:
2861 case LayoutDocEntry::NamespaceNestedConstantGroups:
2862 case LayoutDocEntry::NamespaceClasses:
2863 case LayoutDocEntry::NamespaceConcepts:
2864 case LayoutDocEntry::NamespaceInterfaces:
2865 case LayoutDocEntry::NamespaceStructs:
2866 case LayoutDocEntry::NamespaceExceptions:
2867 case LayoutDocEntry::NamespaceInlineClasses:
2868 case LayoutDocEntry::ConceptDefinition:
2869 case LayoutDocEntry::FileClasses:
2870 case LayoutDocEntry::FileConcepts:
2871 case LayoutDocEntry::FileInterfaces:
2872 case LayoutDocEntry::FileStructs:
2873 case LayoutDocEntry::FileExceptions:
2874 case LayoutDocEntry::FileNamespaces:
2875 case LayoutDocEntry::FileConstantGroups:
2876 case LayoutDocEntry::FileIncludes:
2877 case LayoutDocEntry::FileIncludeGraph:
2878 case LayoutDocEntry::FileIncludedByGraph:
2879 case LayoutDocEntry::FileSourceLink:
2880 case LayoutDocEntry::FileInlineClasses:
2881 case LayoutDocEntry::GroupClasses:
2882 case LayoutDocEntry::GroupConcepts:
2883 case LayoutDocEntry::GroupModules:
2884 case LayoutDocEntry::GroupInlineClasses:
2885 case LayoutDocEntry::GroupNamespaces:
2886 case LayoutDocEntry::GroupDirs:
2887 case LayoutDocEntry::GroupNestedGroups:
2888 case LayoutDocEntry::GroupFiles:
2889 case LayoutDocEntry::GroupGraph:
2890 case LayoutDocEntry::GroupPageDocs:
2891 case LayoutDocEntry::ModuleExports:
2892 case LayoutDocEntry::ModuleClasses:
2893 case LayoutDocEntry::ModuleConcepts:
2894 case LayoutDocEntry::ModuleUsedFiles:
2895 case LayoutDocEntry::DirSubDirs:
2896 case LayoutDocEntry::DirFiles:
2897 case LayoutDocEntry::DirGraph:
2898 err("Internal inconsistency: member '{}' should not be part of LayoutDocManager::Class entry list\n",lde->entryToString());
2899 break;
2900 }
2901 }
2902
2903 ol.endContents();
2904}
2905
2907{
2908 QCString pageTitle;
2909 SrcLangExt lang = getLanguage();
2910
2911 auto getReferenceTitle = [this](std::function<QCString()> translateFunc) -> QCString
2912 {
2913 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
2914 };
2915
2916 if (lang==SrcLangExt::Fortran)
2917 {
2918 pageTitle = getReferenceTitle([this](){
2919 return theTranslator->trCompoundReferenceFortran(displayName(), m_compType, !m_tempArgs.empty());
2920 });
2921 }
2922 else if (lang==SrcLangExt::Slice)
2923 {
2924 pageTitle = getReferenceTitle([this](){
2925 return theTranslator->trCompoundReferenceSlice(displayName(), m_compType, isSliceLocal());
2926 });
2927 }
2928 else if (lang==SrcLangExt::VHDL)
2929 {
2930 pageTitle = getReferenceTitle([this](){
2931 return theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this));
2932 });
2933 }
2934 else if (isJavaEnum())
2935 {
2936 pageTitle = getReferenceTitle([this](){
2937 return theTranslator->trEnumReference(displayName());
2938 });
2939 }
2940 else if (m_compType==Service)
2941 {
2942 pageTitle = getReferenceTitle([this](){
2943 return theTranslator->trServiceReference(displayName());
2944 });
2945 }
2946 else if (m_compType==Singleton)
2947 {
2948 pageTitle = getReferenceTitle([this](){
2949 return theTranslator->trSingletonReference(displayName());
2950 });
2951 }
2952 else
2953 {
2954 pageTitle = getReferenceTitle([this](){
2955 return theTranslator->trCompoundReference(displayName(),
2956 m_compType == Interface && getLanguage()==SrcLangExt::ObjC ? Class : m_compType,
2957 !m_tempArgs.empty());
2958 });
2959 }
2960 return pageTitle;
2961}
2962
2963// write all documentation for this class
2965{
2966 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
2967 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2968 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2969 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2970 QCString pageTitle = title();
2971
2973 if (sliceOpt)
2974 {
2975 if (compoundType()==Interface)
2976 {
2978 }
2979 else if (compoundType()==Struct)
2980 {
2982 }
2983 else if (compoundType()==Exception)
2984 {
2986 }
2987 else
2988 {
2990 }
2991 }
2992 else
2993 {
2995 }
2996
2997 AUTO_TRACE("name='{}' getOutputFileBase='{}'",name(),getOutputFileBase());
2998 bool hasAllMembersLink=false;
2999 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3000 {
3001 if (lde->kind()==LayoutDocEntry::ClassAllMembersLink)
3002 {
3003 hasAllMembersLink = true;
3004 break;
3005 }
3006 }
3007 QCString memListFile;
3008 if (hasAllMembersLink && !m_allMemberNameInfoLinkedMap.empty() && !Config_getBool(OPTIMIZE_OUTPUT_FOR_C))
3009 {
3010 memListFile = getMemberListFileName();
3011 }
3012 startFile(ol,getOutputFileBase(),false,name(),pageTitle,hli,!generateTreeView,QCString(),0,memListFile);
3013 if (!generateTreeView)
3014 {
3016 {
3018 }
3019 ol.endQuickIndices();
3020 }
3021
3022 startTitle(ol,getOutputFileBase(),this);
3023 ol.parseText(pageTitle);
3025 addGroupListToTitle(ol,this);
3027 writeDocumentationContents(ol,pageTitle);
3028
3029 endFileWithNavPath(ol,this);
3030
3031 if (Config_getBool(SEPARATE_MEMBER_PAGES))
3032 {
3033 writeMemberPages(ol);
3034 }
3035}
3036
3038{
3039 ///////////////////////////////////////////////////////////////////////////
3040 //// Member definitions on separate pages
3041 ///////////////////////////////////////////////////////////////////////////
3042
3043 ol.pushGeneratorState();
3045
3046 for (const auto &ml : m_memberLists)
3047 {
3048 if (ml->numDocMembers()>ml->numDocEnumValues() && ml->listType().isDetailed())
3049 {
3050 ml->writeDocumentationPage(ol,displayName(),this);
3051 }
3052 }
3053
3054 ol.popGeneratorState();
3055}
3056
3058{
3059 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
3060
3061 ol.writeString(" <div class=\"navtab\">\n");
3062 ol.writeString(" <table>\n");
3063
3064 for (auto &mni : m_allMemberNameInfoLinkedMap)
3065 {
3066 for (auto &mi : *mni)
3067 {
3068 const MemberDef *md=mi->memberDef();
3069 if (md->getClassDef()==this && md->isLinkable() && !md->isEnumValue())
3070 {
3071 if (md->isLinkableInProject())
3072 {
3073 if (md==currentMd) // selected item => highlight
3074 {
3075 ol.writeString(" <tr><td class=\"navtabHL\">");
3076 }
3077 else
3078 {
3079 ol.writeString(" <tr><td class=\"navtab\">");
3080 }
3081 ol.writeString("<span class=\"label\"><a ");
3082 ol.writeString("href=\"");
3083 if (createSubDirs) ol.writeString("../../");
3084 QCString url = md->getOutputFileBase();
3086 ol.writeString(url+"#"+md->anchor());
3087 ol.writeString("\">");
3088 ol.writeString(convertToHtml(md->name()));
3089 ol.writeString("</a></span>");
3090 ol.writeString("</td></tr>\n");
3091 }
3092 }
3093 }
3094 }
3095
3096 ol.writeString(" </table>\n");
3097 ol.writeString(" </div>\n");
3098}
3099
3100
3101
3103{
3104 // write inner classes after the parent, so the tag files contain
3105 // the definition in proper order!
3106 for (const auto &innerCd : m_innerClasses)
3107 {
3108 if (
3109 innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
3110 protectionLevelVisible(innerCd->protection()) &&
3111 !innerCd->isEmbeddedInOuterScope()
3112 )
3113 {
3114 msg("Generating docs for nested compound {}...\n",innerCd->displayName());
3115 innerCd->writeDocumentation(ol);
3116 innerCd->writeMemberList(ol);
3117 }
3118 innerCd->writeDocumentationForInnerClasses(ol);
3119 }
3120}
3121
3122// write the list of all (inherited) members for this class
3124{
3125 bool cOpt = Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
3126 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3127 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3128 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3129 if (m_allMemberNameInfoLinkedMap.empty() || cOpt) return;
3130 // only for HTML
3131 ol.pushGeneratorState();
3133
3135 if (sliceOpt)
3136 {
3137 if (compoundType()==Interface)
3138 {
3140 }
3141 else if (compoundType()==Struct)
3142 {
3144 }
3145 else if (compoundType()==Exception)
3146 {
3148 }
3149 else
3150 {
3152 }
3153 }
3154 else
3155 {
3157 }
3158
3159 QCString memListFile = getMemberListFileName();
3160 startFile(ol,memListFile,false,memListFile,theTranslator->trMemberList(),hli,!generateTreeView,getOutputFileBase());
3161 if (!generateTreeView)
3162 {
3164 {
3166 }
3167 ol.endQuickIndices();
3168 }
3169 startTitle(ol,QCString());
3170 ol.parseText(displayName()+" "+theTranslator->trMemberList());
3171 endTitle(ol,QCString(),QCString());
3172 ol.startContents();
3173 ol.startParagraph();
3174 ol.parseText(theTranslator->trThisIsTheListOfAllMembers());
3175 ol.docify(" ");
3177 ol.parseText(theTranslator->trIncludingInheritedMembers());
3178 ol.endParagraph();
3179
3180 //ol.startItemList();
3181
3182 bool first = true; // to prevent empty table
3183 int idx=0;
3184 for (auto &mni : m_allMemberNameInfoLinkedMap)
3185 {
3186 for (auto &mi : *mni)
3187 {
3188 const MemberDef *md=mi->memberDef();
3189 const ClassDef *cd=md->getClassDef();
3190 Protection prot = mi->prot();
3191 Specifier virt=md->virtualness();
3192
3193 //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n",
3194 // qPrint(name()),qPrint(md->name()),qPrint(cd->name()),md->protection(),mi->prot,prot,mi->inherited);
3195
3196 if (cd && !md->name().isEmpty() && !md->isAnonymous())
3197 {
3198 bool memberWritten=FALSE;
3199 if (cd->isLinkable() && md->isLinkable())
3200 // create a link to the documentation
3201 {
3202 QCString name=mi->ambiguityResolutionScope()+md->name();
3203 //ol.writeListItem();
3204 if (first)
3205 {
3206 ol.writeString("<table class=\"directory\">\n");
3207 first = false;
3208 }
3209 ol.writeString(" <tr");
3210 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3211 idx++;
3212 ol.writeString("><td class=\"entry\">");
3213 if (cd->isObjectiveC())
3214 {
3215 if (md->isObjCMethod())
3216 {
3217 if (md->isStatic())
3218 ol.writeString("+&#160;</td><td>");
3219 else
3220 ol.writeString("-&#160;</td><td>");
3221 }
3222 else
3223 ol.writeString("</td><td class=\"entry\">");
3224 }
3225 if (md->isObjCMethod())
3226 {
3228 md->getOutputFileBase(),
3229 md->anchor(),md->name());
3230 }
3231 else
3232 {
3233 //Definition *bd = md->getGroupDef();
3234 //if (bd==nullptr) bd=cd;
3236 md->getOutputFileBase(),
3237 md->anchor(),name);
3238
3239 if ( md->isFunction() || md->isSignal() || md->isSlot() ||
3240 (md->isFriend() && !md->argsString().isEmpty()))
3241 ol.docify(md->argsString());
3242 else if (md->isEnumerate())
3243 ol.parseText(" "+theTranslator->trEnumName());
3244 else if (md->isEnumValue())
3245 ol.parseText(" "+theTranslator->trEnumValue());
3246 else if (md->isTypedef())
3247 ol.docify(" typedef");
3248 else if (md->isFriend() && md->typeString()=="friend class")
3249 ol.docify(" class");
3250 //ol.writeString("\n");
3251 }
3252 ol.writeString("</td>");
3253 memberWritten=TRUE;
3254 }
3255 else if (!cd->isArtificial() &&
3256 !Config_getBool(HIDE_UNDOC_MEMBERS) &&
3258 ) // no documentation,
3259 // generate link to the class instead.
3260 {
3261 //ol.writeListItem();
3262 if (first)
3263 {
3264 ol.writeString("<table class=\"directory\">\n");
3265 first = false;
3266 }
3267 ol.writeString(" <tr bgcolor=\"#f0f0f0\"");
3268 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3269 idx++;
3270 ol.writeString("><td class=\"entry\">");
3271 if (cd->isObjectiveC())
3272 {
3273 if (md->isObjCMethod())
3274 {
3275 if (md->isStatic())
3276 ol.writeString("+&#160;</td><td class=\"entry\">");
3277 else
3278 ol.writeString("-&#160;</td><td class=\"entry\">");
3279 }
3280 else
3281 ol.writeString("</td><td class=\"entry\">");
3282 }
3283 ol.startBold();
3284 ol.docify(md->name());
3285 ol.endBold();
3286 if (!md->isObjCMethod())
3287 {
3288 if ( md->isFunction() || md->isSignal() || md->isSlot() )
3289 ol.docify(md->argsString());
3290 else if (md->isEnumerate())
3291 ol.parseText(" "+theTranslator->trEnumName());
3292 else if (md->isEnumValue())
3293 ol.parseText(" "+theTranslator->trEnumValue());
3294 else if (md->isTypedef())
3295 ol.docify(" typedef");
3296 }
3297 ol.writeString(" (");
3298 ol.parseText(theTranslator->trDefinedIn()+" ");
3299 if (cd->isLinkable())
3300 {
3301 ol.writeObjectLink(
3302 cd->getReference(),
3303 cd->getOutputFileBase(),
3304 cd->anchor(),
3305 cd->displayName());
3306 }
3307 else
3308 {
3309 ol.startBold();
3310 ol.docify(cd->displayName());
3311 ol.endBold();
3312 }
3313 ol.writeString(")");
3314 ol.writeString("</td>");
3315 memberWritten=TRUE;
3316 }
3317 if (memberWritten)
3318 {
3319 ol.writeString("<td class=\"entry\">");
3321 cd->getOutputFileBase(),
3322 cd->anchor(),
3323 md->category() ?
3324 md->category()->displayName() :
3325 cd->displayName());
3326 ol.writeString("</td>");
3327 ol.writeString("<td class=\"entry\">");
3328 }
3329 SrcLangExt lang = md->getLanguage();
3330 if (
3331 (prot!=Protection::Public || (virt!=Specifier::Normal && getLanguage()!=SrcLangExt::ObjC) ||
3332 md->isFriend() || md->isRelated() || md->isExplicit() ||
3333 md->isMutable() || (md->isInline() && Config_getBool(INLINE_INFO)) ||
3334 md->isSignal() || md->isSlot() || md->isThreadLocal() ||
3335 (getLanguage()==SrcLangExt::IDL &&
3336 (md->isOptional() || md->isAttribute() || md->isUNOProperty())) ||
3337 md->isStatic() || lang==SrcLangExt::VHDL
3338 )
3339 && memberWritten)
3340 {
3341 StringVector sl;
3342 if (lang==SrcLangExt::VHDL)
3343 {
3344 sl.push_back(theTranslator->trVhdlType(md->getVhdlSpecifiers(),TRUE).str()); //append vhdl type
3345 }
3346 else if (md->isFriend()) sl.emplace_back("friend");
3347 else if (md->isRelated()) sl.emplace_back("related");
3348 else
3349 {
3350 if (Config_getBool(INLINE_INFO) && md->isInline())
3351 sl.emplace_back("inline");
3352 if (md->isExplicit()) sl.emplace_back("explicit");
3353 if (md->isMutable()) sl.emplace_back("mutable");
3354 if (md->isThreadLocal()) sl.emplace_back("thread_local");
3355 if (prot==Protection::Protected) sl.emplace_back("protected");
3356 else if (prot==Protection::Private) sl.emplace_back("private");
3357 else if (prot==Protection::Package) sl.emplace_back("package");
3358 if (virt==Specifier::Virtual && getLanguage()!=SrcLangExt::ObjC)
3359 sl.emplace_back("virtual");
3360 else if (virt==Specifier::Pure) sl.emplace_back("pure virtual");
3361 if (md->isStatic()) sl.emplace_back("static");
3362 if (md->isSignal()) sl.emplace_back("signal");
3363 if (md->isSlot()) sl.emplace_back("slot");
3364// this is the extra member page
3365 if (md->isOptional()) sl.emplace_back("optional");
3366 if (md->isAttribute()) sl.emplace_back("attribute");
3367 if (md->isUNOProperty()) sl.emplace_back("property");
3368 if (md->isReadonly()) sl.emplace_back("readonly");
3369 if (md->isBound()) sl.emplace_back("bound");
3370 if (md->isRemovable()) sl.emplace_back("removable");
3371 if (md->isConstrained()) sl.emplace_back("constrained");
3372 if (md->isTransient()) sl.emplace_back("transient");
3373 if (md->isMaybeVoid()) sl.emplace_back("maybevoid");
3374 if (md->isMaybeDefault()) sl.emplace_back("maybedefault");
3375 if (md->isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
3376 }
3377 bool firstSpan=true;
3378 for (const auto &s : sl)
3379 {
3380 if (!firstSpan)
3381 {
3382 ol.writeString("</span><span class=\"mlabel\">");
3383 }
3384 else
3385 {
3386 ol.writeString("<span class=\"mlabel\">");
3387 firstSpan=false;
3388 }
3389 ol.docify(s);
3390 }
3391 if (!firstSpan) ol.writeString("</span>");
3392 }
3393 if (memberWritten)
3394 {
3395 ol.writeString("</td>");
3396 ol.writeString("</tr>\n");
3397 }
3398 }
3399 }
3400 }
3401 //ol.endItemList();
3402
3403 if (!first) ol.writeString("</table>");
3404
3405 endFile(ol);
3406 ol.popGeneratorState();
3407}
3408
3409// add a reference to an example
3410bool ClassDefImpl::addExample(const QCString &anchor,const QCString &nameStr, const QCString &file)
3411{
3412 return m_examples.inSort(Example(anchor,nameStr,file));
3413}
3414
3415// returns TRUE if this class is used in an example
3417{
3418 return !m_examples.empty();
3419}
3420
3421void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCString &type)
3422{
3423 //printf("addTypeConstraint(%s,%s)\n",qPrint(type),qPrint(typeConstraint));
3424 bool hideUndocRelation = Config_getBool(HIDE_UNDOC_RELATIONS);
3425 if (typeConstraint.isEmpty() || type.isEmpty()) return;
3426 SymbolResolver resolver(getFileDef());
3427 ClassDefMutable *cd = resolver.resolveClassMutable(this,typeConstraint);
3428 if (cd==nullptr && !hideUndocRelation)
3429 {
3430 cd = toClassDefMutable(
3431 Doxygen::hiddenClassLinkedMap->add(typeConstraint,
3432 std::unique_ptr<ClassDef>(
3433 new ClassDefImpl(
3435 getDefColumn(),
3436 typeConstraint,
3437 ClassDef::Class))));
3438 if (cd)
3439 {
3440 cd->setUsedOnly(TRUE);
3441 cd->setLanguage(getLanguage());
3442 //printf("Adding undocumented constraint '%s' to class %s on type %s\n",
3443 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3444 }
3445 }
3446 if (cd)
3447 {
3448 auto it = std::find_if(m_constraintClassList.begin(),
3450 [&cd](const auto &ccd) { return ccd.classDef==cd; });
3451
3452 if (it==m_constraintClassList.end())
3453 {
3454 m_constraintClassList.emplace_back(cd);
3455 it = m_constraintClassList.end()-1;
3456 }
3457 (*it).addAccessor(type);
3458 //printf("Adding constraint '%s' to class %s on type %s\n",
3459 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3460 }
3461}
3462
3463// Java Type Constrains: A<T extends C & I>
3465{
3466 for (const Argument &a : m_tempArgs)
3467 {
3468 if (!a.typeConstraint.isEmpty())
3469 {
3470 QCString typeConstraint;
3471 int i=0,p=0;
3472 while ((i=a.typeConstraint.find('&',p))!=-1) // typeConstraint="A &I" for C<T extends A & I>
3473 {
3474 typeConstraint = a.typeConstraint.mid(p,i-p).stripWhiteSpace();
3475 addTypeConstraint(typeConstraint,a.type);
3476 p=i+1;
3477 }
3478 typeConstraint = a.typeConstraint.right(a.typeConstraint.length()-p).stripWhiteSpace();
3479 addTypeConstraint(typeConstraint,a.type);
3480 }
3481 }
3482}
3483
3484// C# Type Constraints: D<T> where T : C, I
3489
3491{
3492 m_tempArgs = al;
3493}
3494
3495static bool hasNonReferenceSuperClassRec(const ClassDef *cd,int level)
3496{
3497 bool found=!cd->isReference() && cd->isLinkableInProject() && !cd->isHidden();
3498 if (found)
3499 {
3500 return TRUE; // we're done if this class is not a reference
3501 }
3502 for (const auto &ibcd : cd->subClasses())
3503 {
3504 const ClassDef *bcd=ibcd.classDef;
3505 if (level>256)
3506 {
3507 err("Possible recursive class relation while inside {} and looking for base class {}\n",cd->name(),bcd->name());
3508 return FALSE;
3509 }
3510 // recurse into the super class branch
3511 found = found || hasNonReferenceSuperClassRec(bcd,level+1);
3512 if (!found)
3513 {
3514 // look for template instances that might have non-reference super classes
3515 for (const auto &cil : bcd->getTemplateInstances())
3516 {
3517 // recurse into the template instance branch
3518 found = hasNonReferenceSuperClassRec(cil.classDef,level+1);
3519 if (found) break;
3520 }
3521 }
3522 else
3523 {
3524 break;
3525 }
3526 }
3527 return found;
3528}
3529
3530/*! Returns \c TRUE iff this class or a class inheriting from this class
3531 * is \e not defined in an external tag file.
3532 */
3534{
3535 return hasNonReferenceSuperClassRec(this,0);
3536}
3537
3542
3544{
3545 m_requiresClause = req;
3546}
3547
3548/*! called from MemberDef::writeDeclaration() to (recursively) write the
3549 * definition of an anonymous struct, union or class.
3550 */
3551void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,int indentLevel,
3552 const ClassDef *inheritedFrom,const QCString &inheritId) const
3553{
3554 //printf("ClassName='%s' inGroup=%d\n",qPrint(name()),inGroup);
3555
3558 if (!cn.isEmpty())
3559 {
3560 ol.docify(" ");
3561 if (md && isLinkable())
3562 {
3563 ol.writeObjectLink(QCString(),QCString(),md->anchor(),cn);
3564 }
3565 else
3566 {
3567 ol.startBold();
3568 ol.docify(cn);
3569 ol.endBold();
3570 }
3571 }
3572 ol.docify(" {");
3574 ol.endMemberDeclaration(md ? md->anchor() : QCString(),inheritId);
3575
3576 // write user defined member groups
3577 for (const auto &mg : m_memberGroups)
3578 {
3579 mg->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
3580 }
3581
3582 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3583 {
3584 if (lde->kind()==LayoutDocEntry::MemberDecl)
3585 {
3586 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
3587 if (lmd)
3588 {
3589 writePlainMemberDeclaration(ol,lmd->type,inGroup,indentLevel,inheritedFrom,inheritId);
3590 }
3591 }
3592 }
3593}
3594
3595/*! a link to this class is possible within this project */
3597{
3598 bool extractLocal = Config_getBool(EXTRACT_LOCAL_CLASSES);
3599 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3600 bool hideUndoc = Config_getBool(HIDE_UNDOC_CLASSES);
3602 {
3603 return m_templateMaster->isLinkableInProject();
3604 }
3605 else
3606 {
3607 //printf("%s::isLinkableInProject() conditions: artificial=%d hidden=%d anonymous=%d protection=%d local=%d docs=%d static=%d ref=%d\n",
3608 // qPrint(name()),
3609 // !isArtificial(),
3610 // !isHidden(),
3611 // !isAnonymous(),
3612 // m_prot,
3613 // !m_isLocal || extractLocal,
3614 // hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc,
3615 // !m_isStatic || extractStatic,
3616 // !isReference());
3617 return
3618 !isArtificial() && !isHidden() && /* not hidden */
3619 !isAnonymous() && /* not anonymous */
3620 protectionLevelVisible(m_prot) && /* private/internal */
3621 (!m_isLocal || extractLocal) && /* local */
3622 (hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc) && /* documented */
3623 (!m_isStatic || extractStatic) && /* static */
3624 !isReference(); /* not an external reference */
3625 }
3626}
3627
3629{
3631 {
3632 return m_templateMaster->isLinkable();
3633 }
3634 else
3635 {
3636 return isReference() || isLinkableInProject();
3637 }
3638}
3639
3640
3641/*! the class is visible in a class diagram, or class hierarchy */
3643{
3644 bool allExternals = Config_getBool(ALLEXTERNALS);
3645 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
3646 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3647
3648 return // show all classes or a subclass is visible
3649 ((allExternals && !isArtificial()) || hasNonReferenceSuperClass()) &&
3650 // and not an anonymous compound
3651 !isAnonymous() &&
3652 // and not privately inherited
3654 // documented or shown anyway or documentation is external
3655 (hasDocumentation() ||
3656 !hideUndocClasses ||
3657 (m_templateMaster && m_templateMaster->hasDocumentation()) ||
3658 isReference()
3659 ) &&
3660 // if this is an implicit template instance then it most be part of the inheritance hierarchy
3661 (!m_implicitTemplateInstance || !m_inherits.empty() || !m_inheritedBy.empty()) &&
3662 // is not part of an unnamed namespace or shown anyway
3663 (!m_isStatic || extractStatic);
3664}
3665
3670
3671//----------------------------------------------------------------------
3672// recursive function:
3673// returns the distance to the base class definition 'bcd' represents an (in)direct base
3674// class of class definition 'cd' or nullptr if it does not.
3675
3676int ClassDefImpl::isBaseClass(const ClassDef *bcd, bool followInstances,const QCString &templSpec) const
3677{
3678 int distance=0;
3679 //printf("isBaseClass(cd=%s) looking for %s templSpec=%s\n",qPrint(name()),qPrint(bcd->name()),qPrint(templSpec));
3680 for (const auto &bclass : baseClasses())
3681 {
3682 const ClassDef *ccd = bclass.classDef;
3683 if (!followInstances && ccd->templateMaster())
3684 {
3685 ccd=ccd->templateMaster();
3686 }
3687 if (ccd==bcd && (templSpec.isEmpty() || templSpec==bclass.templSpecifiers))
3688 {
3689 distance=1;
3690 break; // no shorter path possible
3691 }
3692 else
3693 {
3694 int d = ccd->isBaseClass(bcd,followInstances,templSpec);
3695 if (d>256)
3696 {
3697 err("Possible recursive class relation while inside {} and looking for base class {}\n",name(),bcd->name());
3698 return 0;
3699 }
3700 else if (d>0) // path found
3701 {
3702 if (distance==0 || d+1<distance) // update if no path found yet or shorter path found
3703 {
3704 distance=d+1;
3705 }
3706 }
3707 }
3708 }
3709 return distance;
3710}
3711
3712//----------------------------------------------------------------------
3713
3714bool ClassDefImpl::isSubClass(ClassDef *cd,int level) const
3715{
3716 bool found=FALSE;
3717 if (level>256)
3718 {
3719 err("Possible recursive class relation while inside {} and looking for derived class {}\n",name(),cd->name());
3720 return FALSE;
3721 }
3722 for (const auto &iscd : subClasses())
3723 {
3724 ClassDef *ccd=iscd.classDef;
3725 found = (ccd==cd) || ccd->isSubClass(cd,level+1);
3726 if (found) break;
3727 }
3728 return found;
3729}
3730
3731//----------------------------------------------------------------------------
3732
3733static bool isStandardFunc(const MemberDef *md)
3734{
3735 return md->name()=="operator=" || // assignment operator
3736 md->isConstructor() || // constructor
3737 md->isDestructor(); // destructor
3738}
3739
3740void ClassDefImpl::mergeMembersFromBaseClasses(bool mergeVirtualBaseClass)
3741{
3742 SrcLangExt lang = getLanguage();
3744 size_t sepLen = sep.length();
3745 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
3746 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
3747
3748 //printf(" mergeMembers for %s mergeVirtualBaseClass=%d\n",qPrint(name()),mergeVirtualBaseClass);
3749 // the merge the base members with this class' members
3750 for (const auto &bcd : baseClasses())
3751 {
3752 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
3753 if (bClass)
3754 {
3755 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
3757
3758 for (auto &srcMni : srcMnd)
3759 {
3760 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
3761 if (dstMni)
3762 // a member with that name is already in the class.
3763 // the member may hide or reimplement the one in the sub class
3764 // or there may be another path to the base class that is already
3765 // visited via another branch in the class hierarchy.
3766 {
3767 //printf(" %s hides member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
3768 for (auto &srcMi : *srcMni)
3769 {
3770 MemberDef *srcMd = srcMi->memberDef();
3771 bool found=FALSE;
3772 bool ambiguous=FALSE;
3773 bool hidden=FALSE;
3774 const ClassDef *srcCd = srcMd->getClassDef();
3775 for (auto &dstMi : *dstMni)
3776 {
3777 const MemberDef *dstMd = dstMi->memberDef();
3778 if (srcMd!=dstMd) // different members
3779 {
3780 const ClassDef *dstCd = dstMd->getClassDef();
3781 //printf(" Is %s a base class of %s?\n",qPrint(srcCd->name()),qPrint(dstCd->name()));
3782 if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE))
3783 // member is in the same or a base class
3784 {
3785 const ArgumentList &srcAl = srcMd->argumentList();
3786 const ArgumentList &dstAl = dstMd->argumentList();
3787 found=matchArguments2(
3788 srcMd->getOuterScope(),srcMd->getFileDef(),srcMd->typeString(),&srcAl,
3789 dstMd->getOuterScope(),dstMd->getFileDef(),dstMd->typeString(),&dstAl,
3790 TRUE,lang
3791 );
3792 //printf(" Yes, matching (%s<->%s): %d\n",
3793 // qPrint(argListToString(srcMd->argumentList())),
3794 // qPrint(argListToString(dstMd->argumentList())),
3795 // found);
3796 hidden = hidden || !found;
3797 }
3798 else // member is in a non base class => multiple inheritance
3799 // using the same base class.
3800 {
3801 //printf(" $$ Existing member %s %s add scope %s\n",
3802 // qPrint(dstMi->ambiguityResolutionScope()),
3803 // qPrint(dstMd->name()),
3804 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3805
3806 QCString scope=dstMi->scopePath().left(dstMi->scopePath().find(sep)+sepLen);
3807 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3808 {
3809 dstMi->setAmbiguityResolutionScope(scope+dstMi->ambiguityResolutionScope());
3810 }
3811 ambiguous=TRUE;
3812 }
3813 }
3814 else // same members
3815 {
3816 // do not add if base class is virtual or
3817 // if scope paths are equal or
3818 // if base class is an interface (and thus implicitly virtual).
3819 //printf(" same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt(),dstMi->virt());
3820 if ((srcMi->virt()!=Specifier::Normal && dstMi->virt()!=Specifier::Normal) ||
3821 bClass->name()+sep+srcMi->scopePath() == dstMi->scopePath() ||
3823 )
3824 {
3825 found=TRUE;
3826 }
3827 else // member can be reached via multiple paths in the
3828 // inheritance tree
3829 {
3830 //printf(" $$ Existing member %s %s add scope %s\n",
3831 // qPrint(dstMi->ambiguityResolutionScope()),
3832 // qPrint(dstMd->name()),
3833 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3834
3835 QCString scope=dstMi->scopePath().left(dstMi->scopePath().find(sep)+sepLen);
3836 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3837 {
3838 dstMi->setAmbiguityResolutionScope(dstMi->ambiguityResolutionScope()+scope);
3839 }
3840 ambiguous=TRUE;
3841 }
3842 }
3843 if (found) break;
3844 }
3845 //printf(" member %s::%s hidden %d ambiguous %d srcMi->ambigClass=%p found=%d\n",
3846 // qPrint(srcCd->name()),qPrint(srcMd->name()),hidden,ambiguous,
3847 // (void*)srcMi->ambigClass(),found);
3848
3849 // TODO: fix the case where a member is hidden by inheritance
3850 // of a member with the same name but with another prototype,
3851 // while there is more than one path to the member in the
3852 // base class due to multiple inheritance. In this case
3853 // it seems that the member is not reachable by prefixing a
3854 // scope name either (according to my compiler). Currently,
3855 // this case is shown anyway.
3856 if (!found && srcMd->protection()!=Protection::Private && !srcMd->isFriend() &&
3857 srcMi->virtualBaseClass()==mergeVirtualBaseClass && lang!=SrcLangExt::Python)
3858 {
3859 Protection prot = srcMd->protection();
3860 if (bcd.prot==Protection::Protected && prot==Protection::Public)
3861 {
3862 prot = bcd.prot;
3863 }
3864 else if (bcd.prot==Protection::Private)
3865 {
3866 prot = bcd.prot;
3867 }
3868
3869 if (inlineInheritedMembers)
3870 {
3871 if (!isStandardFunc(srcMd))
3872 {
3873 //printf(" %s::insertMember(%s)\n",qPrint(name()),qPrint(srcMd->name()));
3874 internalInsertMember(srcMd,prot,FALSE);
3875 }
3876 }
3877
3878 Specifier virt=srcMi->virt();
3879 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
3880 bool virtualBaseClass = bcd.virt!=Specifier::Normal;
3881
3882 auto newMi = std::make_unique<MemberInfo>(srcMd,prot,virt,TRUE,virtualBaseClass);
3883 newMi->setScopePath(bClass->name()+sep+srcMi->scopePath());
3884 if (ambiguous)
3885 {
3886 //printf("$$ New member %s %s add scope %s::\n",
3887 // qPrint(srcMi->ambiguityResolutionScope),
3888 // qPrint(srcMd->name()),
3889 // qPrint(bClass->name()));
3890
3891 QCString scope=bClass->name()+sep;
3892 if (scope!=srcMi->ambiguityResolutionScope().left(scope.length()))
3893 {
3894 newMi->setAmbiguityResolutionScope(scope+srcMi->ambiguityResolutionScope());
3895 }
3896 }
3897 if (hidden)
3898 {
3899 if (srcMi->ambigClass()==nullptr)
3900 {
3901 newMi->setAmbigClass(bClass);
3902 newMi->setAmbiguityResolutionScope(bClass->name()+sep);
3903 }
3904 else
3905 {
3906 newMi->setAmbigClass(srcMi->ambigClass());
3907 newMi->setAmbiguityResolutionScope(srcMi->ambigClass()->name()+sep);
3908 }
3909 }
3910 dstMni->push_back(std::move(newMi));
3911 }
3912 }
3913 }
3914 else // base class has a member that is not in the sub class => copy
3915 {
3916 //printf(" %s adds member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
3917 // create a deep copy of the list (only the MemberInfo's will be
3918 // copied, not the actual MemberDef's)
3919 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
3920
3921 // copy the member(s) from the base to the sub class
3922 for (auto &mi : *srcMni)
3923 {
3924 if (mi->virtualBaseClass()==mergeVirtualBaseClass && !mi->memberDef()->isFriend()) // don't inherit friends
3925 {
3926 Protection prot = mi->prot();
3927 if (bcd.prot==Protection::Protected)
3928 {
3929 if (prot==Protection::Public) prot=Protection::Protected;
3930 }
3931 else if (bcd.prot==Protection::Private)
3932 {
3933 prot=Protection::Private;
3934 }
3935 Specifier virt=mi->virt();
3936 bool virtualBaseClass = bcd.virt!=Specifier::Normal || mi->virtualBaseClass();
3937 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
3938 //printf(" %s::%s: [mi.prot=%d, bcd.prot=%d => prot=%d], [mi.virt=%d, bcd.virt=%d => virt=%d] virtualBase=%d\n",
3939 // qPrint(name()),qPrint(mi->memberDef()->name()),
3940 // mi->prot(),bcd.prot,prot,
3941 // mi->virt(),bcd.virt,virt,
3942 // virtualBaseClass
3943 // );
3944
3945 if (prot!=Protection::Private || extractPrivate)
3946 {
3947
3948 if (inlineInheritedMembers)
3949 {
3950 if (!isStandardFunc(mi->memberDef()))
3951 {
3952 //printf(" %s::insertMember '%s'\n",qPrint(name()),qPrint(mi->memberDef()->name()));
3953 internalInsertMember(mi->memberDef(),prot,FALSE);
3954 }
3955 }
3956 //printf("Adding!\n");
3957 std::unique_ptr<MemberInfo> newMi = std::make_unique<MemberInfo>(mi->memberDef(),prot,virt,TRUE,virtualBaseClass);
3958 newMi->setScopePath(bClass->name()+sep+mi->scopePath());
3959 newMi->setAmbigClass(mi->ambigClass());
3960 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
3961 newMni->push_back(std::move(newMi));
3962 }
3963 }
3964 }
3965 }
3966 }
3967 }
3968 }
3969}
3970
3971// See issue11260, referring to a variable in a base class will make doxygen
3972// add it as a member to the derived class, but this is not correct for non-private variables
3973// so we correct this here, now we know the inheritance hierarchy
3975{
3976 //printf("hideDerivedVariableInPython()\n");
3977 if (bClass)
3978 {
3979 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
3981
3982 // recurse up the inheritance hierarchy
3983 for (const auto &bcd : bClass->baseClasses())
3984 {
3986 }
3987
3988 for (auto &srcMni : srcMnd) // for each member in a base class
3989 {
3990 //printf(" candidate(%s)\n",qPrint(srcMni->memberName()));
3991 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
3992 if (dstMni) // that is also in this class
3993 {
3995 //printf("%s member in %s and %s\n",qPrint(name()),qPrint(bClass->name()),qPrint(name()));
3996 for (it=dstMni->begin();it!=dstMni->end();)
3997 {
3998 MemberDefMutable *dstMd = toMemberDefMutable((*it)->memberDef());
3999 if (dstMd && dstMd->isVariable() && !dstMd->name().startsWith("__"))
4000 {
4001 //printf(" hiding member %s\n",qPrint(dstMd->name()));
4002 // hide a member variable if it is already defined in a base class, unless
4003 // it is a __private variable
4004 removeMemberFromLists(dstMd);
4005 it = dstMni->erase(it);
4006 }
4007 else
4008 {
4009 ++it;
4010 }
4011 }
4012 if (dstMni->empty()) // if the list has become empty, remove the entry from the dictionary
4013 {
4014 dstMnd.del(srcMni->memberName());
4015 }
4016 }
4017 }
4018 }
4019}
4020
4021/*!
4022 * recursively merges the 'all members' lists of a class base
4023 * with that of this class. Must only be called for classes without
4024 * subclasses!
4025 */
4027{
4028 if (m_membersMerged) return;
4029 if (getLanguage()==SrcLangExt::Python)
4030 {
4031 for (const auto &bcd : baseClasses())
4032 {
4033 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4035 }
4036 }
4037
4038 //printf("> %s::mergeMembers()\n",qPrint(name()));
4039
4041
4042 // first merge the members of the base class recursively
4043 for (const auto &bcd : baseClasses())
4044 {
4045 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4046 if (bClass)
4047 {
4048 // merge the members in the base class of this inheritance branch first
4049 bClass->mergeMembers();
4050 }
4051 }
4052
4053 // first merge the member that are not inherited via a virtual base class
4054 // (as this can end up reimplemented via multiple paths, see #10717 for examples)
4056 // then process the member that are inherited via a virtual base class to add the
4057 // ones that are not reimplemented via any path
4059
4060 //printf("< %s::mergeMembers()\n",qPrint(name()));
4061}
4062
4063//----------------------------------------------------------------------------
4064
4065/*! Merges the members of a Objective-C category into this class.
4066 */
4068{
4069 AUTO_TRACE();
4070 ClassDefMutable *category = toClassDefMutable(cat);
4071 if (category)
4072 {
4073 bool extractLocalMethods = Config_getBool(EXTRACT_LOCAL_METHODS);
4074 bool makePrivate = category->isLocal();
4075 // in case extract local methods is not enabled we don't add the methods
4076 // of the category in case it is defined in the .m file.
4077 if (makePrivate && !extractLocalMethods) return;
4078 bool isExtension = category->isExtension();
4079
4080 category->setCategoryOf(this);
4081 if (isExtension)
4082 {
4083 category->setArtificial(TRUE);
4084
4085 // copy base classes/protocols from extension
4086 for (const auto &bcd : category->baseClasses())
4087 {
4088 insertBaseClass(bcd.classDef,bcd.usedName,bcd.prot,bcd.virt,bcd.templSpecifiers);
4089 // correct bcd.classDef so that they do no longer derive from
4090 // category, but from this class!
4091 BaseClassList scl = bcd.classDef->subClasses();
4092 for (auto &scd : scl)
4093 {
4094 if (scd.classDef==category)
4095 {
4096 scd.classDef=this;
4097 }
4098 }
4099 bcd.classDef->updateSubClasses(scl);
4100 }
4101 }
4102 // make methods private for categories defined in the .m file
4103 //printf("%s::mergeCategory makePrivate=%d\n",qPrint(name()),makePrivate);
4104
4105 const MemberNameInfoLinkedMap &srcMnd = category->memberNameInfoLinkedMap();
4107
4108 for (auto &srcMni : srcMnd)
4109 {
4110 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4111 if (dstMni) // method is already defined in the class
4112 {
4113 AUTO_TRACE_ADD("Existing member {}",srcMni->memberName());
4114 const auto &dstMi = dstMni->front();
4115 const auto &srcMi = srcMni->front();
4116 if (srcMi && dstMi)
4117 {
4118 MemberDefMutable *smdm = toMemberDefMutable(srcMi->memberDef());
4119 MemberDefMutable *dmdm = toMemberDefMutable(dstMi->memberDef());
4120 if (smdm && dmdm)
4121 {
4123 dmdm->setCategory(category);
4124 dmdm->setCategoryRelation(smdm);
4125 smdm->setCategoryRelation(dmdm);
4126 }
4127 }
4128 }
4129 else // new method name
4130 {
4131 AUTO_TRACE_ADD("New member {}",srcMni->memberName());
4132 // create a deep copy of the list
4133 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
4134
4135 // copy the member(s) from the category to this class
4136 for (auto &mi : *srcMni)
4137 {
4138 //printf("Adding '%s'\n",qPrint(mi->memberDef->name()));
4139 Protection prot = mi->prot();
4140 //if (makePrivate) prot = Private;
4141 auto newMd = mi->memberDef()->deepCopy();
4142 if (newMd)
4143 {
4144 auto mmd = toMemberDefMutable(newMd.get());
4145 AUTO_TRACE_ADD("Copying member {}",mmd->name());
4146 mmd->moveTo(this);
4147
4148 auto newMi=std::make_unique<MemberInfo>(newMd.get(),prot,mi->virt(),mi->inherited(),mi->virtualBaseClass());
4149 newMi->setScopePath(mi->scopePath());
4150 newMi->setAmbigClass(mi->ambigClass());
4151 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
4152 newMni->push_back(std::move(newMi));
4153
4154 // also add the newly created member to the global members list
4155
4156 QCString name = newMd->name();
4158
4159 mmd->setCategory(category);
4160 mmd->setCategoryRelation(mi->memberDef());
4161 auto miMmd = toMemberDefMutable(mi->memberDef());
4162 if (miMmd) miMmd->setCategoryRelation(newMd.get());
4163
4164 if (makePrivate || isExtension)
4165 {
4166 mmd->makeImplementationDetail();
4167 }
4168 internalInsertMember(newMd.get(),prot,FALSE);
4169 mn->push_back(std::move(newMd));
4170 }
4171 }
4172 }
4173 }
4174 }
4175}
4176
4177//----------------------------------------------------------------------------
4178
4180 Protection prot)
4181{
4182 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4183 bool umlLook = Config_getBool(UML_LOOK);
4184 if (prot==Protection::Private && !extractPrivate) return;
4185 //printf("%s::addUsedClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4186
4187 auto it = std::find_if(m_usesImplClassList.begin(),
4188 m_usesImplClassList.end(),
4189 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4190 if (it==m_usesImplClassList.end())
4191 {
4192 m_usesImplClassList.emplace_back(cd);
4193 //printf("Adding used class %s to class %s via accessor %s\n",
4194 // qPrint(cd->name()),qPrint(name()),accessName);
4195 it = m_usesImplClassList.end()-1;
4196 }
4197 QCString acc = accessName;
4198 if (umlLook)
4199 {
4200 switch(prot)
4201 {
4202 case Protection::Public: acc.prepend("+"); break;
4203 case Protection::Private: acc.prepend("-"); break;
4204 case Protection::Protected: acc.prepend("#"); break;
4205 case Protection::Package: acc.prepend("~"); break;
4206 }
4207 }
4208 (*it).addAccessor(acc);
4209}
4210
4212 Protection prot)
4213{
4214 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4215 bool umlLook = Config_getBool(UML_LOOK);
4216 if (prot==Protection::Private && !extractPrivate) return;
4217 //printf("%s::addUsedByClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4218 //
4219 auto it = std::find_if(m_usedByImplClassList.begin(),
4221 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4222 if (it==m_usedByImplClassList.end())
4223 {
4224 m_usedByImplClassList.emplace_back(cd);
4225 //printf("Adding used by class %s to class %s\n",
4226 // qPrint(cd->name()),qPrint(name()));
4227 it = m_usedByImplClassList.end()-1;
4228 }
4229 QCString acc = accessName;
4230 if (umlLook)
4231 {
4232 switch(prot)
4233 {
4234 case Protection::Public: acc.prepend("+"); break;
4235 case Protection::Private: acc.prepend("-"); break;
4236 case Protection::Protected: acc.prepend("#"); break;
4237 case Protection::Package: acc.prepend("~"); break;
4238 }
4239 }
4240 (*it).addAccessor(acc);
4241}
4242
4243
4248
4250{
4251 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
4252 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
4254 {
4255 Definition *scope=nullptr;
4256 if (inlineGroupedClasses && !partOfGroups().empty())
4257 {
4258 // point to the group that embeds this class
4259 return partOfGroups().front()->getOutputFileBase();
4260 }
4261 else if (inlineSimpleClasses && m_isSimple && !partOfGroups().empty())
4262 {
4263 // point to simple struct inside a group
4264 return partOfGroups().front()->getOutputFileBase();
4265 }
4266 else if (inlineSimpleClasses && m_isSimple && (scope=getOuterScope()))
4267 {
4268 if (scope==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) // simple struct embedded in file
4269 {
4270 return getFileDef()->getOutputFileBase();
4271 }
4272 else if (scope->isLinkableInProject()) // simple struct embedded in other container (namespace/group/class)
4273 {
4274 return getOuterScope()->getOutputFileBase();
4275 }
4276 }
4277 }
4278 AUTO_TRACE("name='{}' m_templateMaster={} m_implicitTemplateInstance={}",name(),(void*)m_templateMaster,m_implicitTemplateInstance);
4280 {
4281 // point to the template of which this class is an instance
4282 return m_templateMaster->getOutputFileBase();
4283 }
4284 return m_fileName;
4285}
4286
4291
4293{
4295 {
4296 return m_templateMaster->getSourceFileBase();
4297 }
4298 else
4299 {
4301 }
4302}
4303
4304void ClassDefImpl::setGroupDefForAllMembers(GroupDef *gd,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs)
4305{
4306 gd->addClass(this);
4307 //printf("ClassDefImpl::setGroupDefForAllMembers(%s)\n",qPrint(gd->name()));
4308 for (auto &mni : m_allMemberNameInfoLinkedMap)
4309 {
4310 for (auto &mi : *mni)
4311 {
4312 MemberDefMutable *md = toMemberDefMutable(mi->memberDef());
4313 if (md)
4314 {
4315 md->setGroupDef(gd,pri,fileName,startLine,hasDocs);
4316 gd->insertMember(md,TRUE);
4318 if (innerClass) innerClass->setGroupDefForAllMembers(gd,pri,fileName,startLine,hasDocs);
4319 }
4320 }
4321 }
4322}
4323
4325{
4326 //printf("**** %s::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
4327 if (d->definitionType()==Definition::TypeClass) // only classes can be
4328 // nested in classes.
4329 {
4330 m_innerClasses.add(d->localName(),toClassDef(d));
4331 }
4332}
4333
4335{
4336 return m_innerClasses.find(name);
4337}
4338
4340 int startLine, int startColumn, const QCString &templSpec,bool &freshInstance)
4341{
4342 freshInstance = FALSE;
4343 auto it = std::find_if(m_templateInstances.begin(),
4344 m_templateInstances.end(),
4345 [&templSpec](const auto &ti) { return templSpec==ti.templSpec; });
4346 ClassDefMutable *templateClass=nullptr;
4347 if (it!=m_templateInstances.end())
4348 {
4349 templateClass = toClassDefMutable((*it).classDef);
4350 }
4351 if (templateClass==nullptr)
4352 {
4353 QCString tcname = removeRedundantWhiteSpace(name()+templSpec);
4354 AUTO_TRACE("New template instance class name='{}' templSpec='{}' inside '{}' hidden={}",
4355 name(),templSpec,name(),isHidden());
4356
4357 ClassDef *foundCd = Doxygen::classLinkedMap->find(tcname);
4358 if (foundCd)
4359 {
4360 return foundCd;
4361 }
4362 templateClass =
4364 Doxygen::classLinkedMap->add(tcname,
4365 std::unique_ptr<ClassDef>(
4366 new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
4367 if (templateClass)
4368 {
4369 templateClass->setTemplateMaster(this);
4370 ArgumentList tal = *stringToArgumentList(getLanguage(),templSpec);
4371 templateClass->setTemplateArguments(tal);
4372 templateClass->setOuterScope(getOuterScope());
4373 templateClass->setHidden(isHidden());
4374 templateClass->setArtificial(isArtificial());
4375 templateClass->setImplicitTemplateInstance(true);
4376 m_templateInstances.emplace_back(templSpec,templateClass);
4377
4378 // also add nested classes
4379 for (const auto &innerCd : m_innerClasses)
4380 {
4381 QCString innerName = tcname+"::"+innerCd->localName();
4382 ClassDefMutable *innerClass =
4384 Doxygen::classLinkedMap->add(innerName,
4385 std::unique_ptr<ClassDef>(
4386 new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
4387 if (innerClass)
4388 {
4389 templateClass->addInnerCompound(innerClass);
4390 innerClass->setOuterScope(templateClass);
4391 innerClass->setHidden(isHidden());
4392 innerClass->setArtificial(TRUE);
4393 innerClass->setImplicitTemplateInstance(true);
4394 }
4395 }
4396 freshInstance=TRUE;
4397 }
4398 }
4399 return templateClass;
4400}
4401
4403{
4404 AUTO_TRACE("this={} cd={} templSpec={}",name(),templateClass->name(),templSpec);
4405 m_templateInstances.emplace_back(templSpec,templateClass);
4406}
4407
4409{
4410 m_templBaseClassNames = templateNames;
4411}
4412
4417
4420 const QCString &templSpec)
4421{
4422 AUTO_TRACE("this={} md={}",name(),md->name());
4423 auto actualArguments_p = stringToArgumentList(getLanguage(),templSpec);
4424 auto imd = md->createTemplateInstanceMember(templateArguments,actualArguments_p);
4425 auto mmd = toMemberDefMutable(imd.get());
4426 mmd->setMemberClass(this);
4427 mmd->setTemplateMaster(md);
4428 mmd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
4429 mmd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
4430 mmd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
4431 mmd->setMemberSpecifiers(md->getMemberSpecifiers());
4432 mmd->setMemberGroupId(md->getMemberGroupId());
4433 mmd->setArtificial(true);
4434 insertMember(imd.get());
4435 //printf("Adding member=%s %s%s to class %s templSpec %s\n",
4436 // imd->typeString(),qPrint(imd->name()),imd->argsString(),
4437 // qPrint(imd->getClassDef()->name()),templSpec);
4438 // insert imd in the list of all members
4439 //printf("Adding member=%s class=%s\n",qPrint(imd->name()),qPrint(name()));
4440 MemberName *mn = Doxygen::memberNameLinkedMap->add(imd->name());
4441 mn->push_back(std::move(imd));
4442}
4443
4445{
4446 AUTO_TRACE("this={} cd={} templSpec={}",name(),cd->name(),templSpec);
4447 //printf("%s::addMembersToTemplateInstance(%s,%s)\n",qPrint(name()),qPrint(cd->name()),templSpec);
4448 for (const auto &mni : cd->memberNameInfoLinkedMap())
4449 {
4450 for (const auto &mi : *mni)
4451 {
4452 const MemberDef *md = mi->memberDef();
4453 if (m_allMemberNameInfoLinkedMap.find(md->name())==nullptr) // only insert the member if not hidden by one with the same name (#11541)
4454 {
4456 }
4457 }
4458 }
4459 // also instantatie members for nested classes
4460 for (const auto &innerCd : cd->getClasses())
4461 {
4462 ClassDefMutable *ncd = toClassDefMutable(m_innerClasses.find(innerCd->localName()));
4463 if (ncd)
4464 {
4465 ncd->addMembersToTemplateInstance(innerCd,cd->templateArguments(),templSpec);
4466 }
4467 }
4468}
4469
4471{
4473 {
4474 return m_templateMaster->getReference();
4475 }
4476 else
4477 {
4479 }
4480}
4481
4483{
4485 {
4486 return m_templateMaster->isReference();
4487 }
4488 else
4489 {
4491 }
4492}
4493
4495{
4496 ArgumentLists result;
4498 while (d && d->definitionType()==Definition::TypeClass)
4499 {
4500 result.insert(result.begin(),toClassDef(d)->templateArguments());
4501 d = d->getOuterScope();
4502 }
4503 if (!templateArguments().empty())
4504 {
4505 result.push_back(templateArguments());
4506 }
4507 return result;
4508}
4509
4511 const ArgumentLists *actualParams,uint32_t *actualParamIndex) const
4512{
4513 return makeQualifiedNameWithTemplateParameters(this,actualParams,actualParamIndex);
4514}
4515
4517{
4518 QCString name = m_className.isEmpty() ? localName() : m_className;
4519 auto lang = getLanguage();
4520 if (lang==SrcLangExt::CSharp)
4521 {
4523 }
4524 return name;
4525}
4526
4531
4533{
4534 SrcLangExt lang = getLanguage();
4535 if (!isLinkableInProject()) return;
4536 //printf("ClassDef(%s)::addListReferences()\n",qPrint(name()));
4537 {
4538 const RefItemVector &xrefItems = xrefListItems();
4539 addRefItem(xrefItems,
4540 qualifiedName(),
4541 theTranslator->trCompoundType(compoundType(), lang),
4543 displayName(),
4544 QCString(),
4545 this
4546 );
4547 }
4548 for (const auto &mg : m_memberGroups)
4549 {
4550 mg->addListReferences(this);
4551 }
4552 for (auto &ml : m_memberLists)
4553 {
4554 if (ml->listType().isDetailed())
4555 {
4556 ml->addListReferences(this);
4557 }
4558 }
4559}
4560
4562{
4563 const MemberDef *xmd = nullptr;
4565 if (mni)
4566 {
4567 const int maxInheritanceDepth = 100000;
4568 int mdist=maxInheritanceDepth;
4569 for (auto &mi : *mni)
4570 {
4571 const ClassDef *mcd=mi->memberDef()->getClassDef();
4572 int m=minClassDistance(this,mcd);
4573 //printf("found member in %s linkable=%d m=%d\n",
4574 // qPrint(mcd->name()),mcd->isLinkable(),m);
4575 if (m<mdist)
4576 {
4577 mdist=m;
4578 xmd=mi->memberDef();
4579 }
4580 }
4581 }
4582 //printf("getMemberByName(%s)=%p\n",qPrint(name),xmd);
4583 return xmd;
4584}
4585
4587{
4588 return md->getClassDef() && isBaseClass(md->getClassDef(),TRUE,QCString());
4589}
4590
4592{
4593 for (auto &ml : m_memberLists)
4594 {
4595 if (ml->listType()==lt)
4596 {
4597 return ml.get();
4598 }
4599 }
4600 return nullptr;
4601}
4602
4604{
4605 AUTO_TRACE("{} md={} lt={} isBrief={}",name(),md->name(),lt,isBrief);
4606 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
4607 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
4608 const auto &ml = m_memberLists.get(lt,MemberListContainer::Class);
4609 ml->setNeedsSorting((isBrief && sortBriefDocs) || (!isBrief && sortMemberDocs));
4610 ml->push_back(md);
4611
4612 // for members in the declaration lists we set the section, needed for member grouping
4613 if (!ml->listType().isDetailed())
4614 {
4616 if (mdm)
4617 {
4618 mdm->setSectionList(this,ml.get());
4619 }
4620 }
4621}
4622
4624{
4625 for (auto &ml : m_memberLists)
4626 {
4627 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
4628 }
4629 if (Config_getBool(SORT_BRIEF_DOCS))
4630 {
4631 std::stable_sort(m_innerClasses.begin(),
4632 m_innerClasses.end(),
4633 [](const auto &c1,const auto &c2)
4634 {
4635 return Config_getBool(SORT_BY_SCOPE_NAME) ?
4636 qstricmp_sort(c1->name(), c2->name() )<0 :
4637 qstricmp_sort(c1->className(), c2->className())<0 ;
4638 });
4639 }
4640}
4641
4643 MemberListType lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const
4644{
4645 //printf("%s: countMemberDeclarations for %s and %s\n",qPrint(name()),lt.to_string(),lt2.to_string());
4646 int count=0;
4647 MemberList * ml = getMemberList(lt);
4648 MemberList * ml2 = getMemberList(lt2);
4649 if (getLanguage()!=SrcLangExt::VHDL) // use specific declarations function
4650 {
4651 if (ml)
4652 {
4653 count+=ml->numDecMembers(inheritedFrom);
4654 //printf("-> ml=%d\n",ml->numDecMembers());
4655 }
4656 if (ml2)
4657 {
4658 count+=ml2->numDecMembers(inheritedFrom);
4659 //printf("-> ml2=%d\n",ml2->numDecMembers());
4660 }
4661 // also include grouped members that have their own section in the class (see bug 722759)
4662 if (inheritedFrom)
4663 {
4664 for (const auto &mg : m_memberGroups)
4665 {
4666 count+=mg->countGroupedInheritedMembers(lt);
4667 if (!lt2.isInvalid()) count+=mg->countGroupedInheritedMembers(lt2);
4668 }
4669 }
4670 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4671 if (!inlineInheritedMembers) // show inherited members as separate lists
4672 {
4673 count+=countInheritedDecMembers(lt,inheritedFrom,invert,showAlways,visitedClasses);
4674 }
4675 }
4676 //printf("-> %d\n",count);
4677 return count;
4678}
4679
4681{
4682 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4683 {
4684 if (lde->kind()==LayoutDocEntry::MemberDecl)
4685 {
4686 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4687 if (lmd)
4688 {
4689 MemberList * ml = getMemberList(lmd->type);
4690 if (ml)
4691 {
4693 }
4694 }
4695 }
4696 else if (lde->kind()==LayoutDocEntry::MemberGroups)
4697 {
4698 for (const auto &mg : m_memberGroups)
4699 {
4700 mg->setAnonymousEnumType();
4701 }
4702 }
4703 }
4704}
4705
4707{
4708 for (auto &ml : m_memberLists)
4709 {
4710 ml->countDecMembers();
4711 ml->countDocMembers();
4712 }
4713 for (const auto &mg : m_memberGroups)
4714 {
4715 mg->countDecMembers();
4716 mg->countDocMembers();
4717 }
4718}
4719
4721 const ClassDef *inheritedFrom,bool invert,bool showAlways,
4722 ClassDefSet &visitedClasses) const
4723{
4724 int inhCount = 0;
4725 int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
4726 bool process = count>0;
4727 //printf("%s: countInheritedDecMembers: lt=%s process=%d count=%d invert=%d\n",
4728 // qPrint(name()),lt.to_string(),process,count,invert);
4729 if ((process^invert) || showAlways)
4730 {
4731 for (const auto &ibcd : m_inherits)
4732 {
4733 ClassDefMutable *icd = toClassDefMutable(ibcd.classDef);
4736 if (icd && icd->isLinkable())
4737 {
4738 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt2);
4739 //printf("%s: convert %s->(%s,%s) prot=%d\n",
4740 // qPrint(icd->name()),lt.to_string(),lt1.to_string(),lt2.to_string(),ibcd.prot);
4741 if (visitedClasses.find(icd)==visitedClasses.end())
4742 {
4743 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4744 if (!lt1.isInvalid())
4745 {
4746 inhCount+=icd->countMemberDeclarations(lt1,inheritedFrom,lt2,FALSE,TRUE,visitedClasses);
4747 }
4748 }
4749 }
4750 }
4751 }
4752 //printf("%s: count=%d\n",qPrint(name()),inhCount);
4753 return inhCount;
4754}
4755
4757 QCString &title,QCString &subtitle) const
4758{
4759 SrcLangExt lang = getLanguage();
4760 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4761 {
4762 if (lde->kind()==LayoutDocEntry::MemberDecl)
4763 {
4764 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4765 if (lmd && lmd->type==type)
4766 {
4767 title = lmd->title(lang);
4768 subtitle = lmd->subtitle(lang);
4769 return;
4770 }
4771 }
4772 }
4773 title="";
4774 subtitle="";
4775}
4776
4778{
4779 int totalCount=0;
4780 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4781 {
4782 if (lde->kind()==LayoutDocEntry::MemberDecl)
4783 {
4784 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4785 if (lmd && lmd->type!=MemberListType::Friends()) // friendship is not inherited
4786 {
4787 ClassDefSet visited;
4788 totalCount+=countInheritedDecMembers(lmd->type,this,TRUE,FALSE,visited);
4789 }
4790 }
4791 }
4792 //printf("countAdditionalInheritedMembers()=%d\n",totalCount);
4793 return totalCount;
4794}
4795
4797{
4798 //printf("**** writeAdditionalInheritedMembers()\n");
4799 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4800 {
4801 if (lde->kind()==LayoutDocEntry::MemberDecl)
4802 {
4803 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4804 if (lmd && lmd->type!=MemberListType::Friends())
4805 {
4806 ClassDefSet visited;
4808 }
4809 }
4810 }
4811}
4812
4814 const ClassDef *inheritedFrom,bool additional) const
4815{
4816 int count=0;
4817 MemberList *ml = getMemberList(lt);
4818 if (ml)
4819 {
4820 count=ml->countInheritableMembers(inheritedFrom);
4821 }
4822 //printf("%s:countMembersIncludingGrouped: count=%d\n",qPrint(name()),count);
4823 for (const auto &mg : m_memberGroups)
4824 {
4825 bool hasOwnSection = !mg->allMembersInSameSection() ||
4826 !m_subGrouping; // group is in its own section
4827 if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
4828 {
4829 count+=mg->countGroupedInheritedMembers(lt);
4830 }
4831 }
4832 //printf("%s:countMembersIncludingGrouped(lt=%s,%s)=%d\n",
4833 // qPrint(name()),qPrint(lt.to_string()),ml?qPrint(ml->listType().to_string()):"<none>",count);
4834 return count;
4835}
4836
4837
4840 const ClassDef *inheritedFrom,bool invert,bool showAlways) const
4841{
4842 int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
4843 bool process = count>0;
4844 //printf("%s: writeInheritedMemberDec: lt=%s process=%d invert=%d always=%d\n",
4845 // qPrint(name()),qPrint(lt.to_string()),process,invert,showAlways);
4846 if ((process^invert) || showAlways)
4847 {
4848 for (const auto &ibcd : m_inherits)
4849 {
4850 ClassDefMutable *icd=toClassDefMutable(ibcd.classDef);
4851 if (icd && icd->isLinkable())
4852 {
4855 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt3);
4856 if (lt2.isInvalid() && !lt3.isInvalid())
4857 {
4858 lt2=lt3;
4859 }
4860 //printf("%s:convert %s->(%s,%s) prot=%d\n",qPrint(icd->name()),qPrint(lt.to_string()),
4861 // qPrint(lt1.to_string()),qPrint(lt2.to_string()),ibcd.prot);
4862 if (visitedClasses.find(icd)==visitedClasses.end())
4863 {
4864 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4865 if (!lt1.isInvalid())
4866 {
4867 //printf("--> writeMemberDeclarations for type %s\n",qPrint(lt1.to_string()));
4868 icd->writeMemberDeclarations(ol,visitedClasses,lt1,
4869 title,QCString(),FALSE,inheritedFrom,lt2,FALSE,TRUE);
4870 }
4871 }
4872 else
4873 {
4874 //printf("%s: class already visited!\n",qPrint(icd->name()));
4875 }
4876 }
4877 }
4878 }
4879}
4880
4882 MemberListType lt,const QCString &title,
4883 const QCString &subTitle,bool showInline,const ClassDef *inheritedFrom,MemberListType lt2,
4884 bool invert,bool showAlways) const
4885{
4886 //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%s lt2=%s\n",qPrint(name()),qPrint(lt.to_string()),qPrint(lt2.to_string()));
4887 MemberList * ml = getMemberList(lt);
4888 MemberList * ml2 = getMemberList(lt2);
4889 if (getLanguage()==SrcLangExt::VHDL) // use specific declarations function
4890 {
4891 static const ClassDef *cdef;
4892 if (cdef!=this)
4893 { // only one inline link
4895 cdef=this;
4896 }
4897 if (ml)
4898 {
4899 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,this,nullptr,nullptr,nullptr);
4900 }
4901 }
4902 else
4903 {
4904 //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",qPrint(name()),qPrint(title),(void*)ml,(void*)ml2);
4905 QCString tt = title, st = subTitle;
4906 if (ml)
4907 {
4908 //printf(" writeDeclarations ml type=%s count=%d\n",qPrint(lt.to_string()),ml->numDecMembers(inheritedFrom));
4909 ml->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,true);
4910 tt.clear();
4911 st.clear();
4912 }
4913 if (ml2)
4914 {
4915 //printf(" writeDeclarations ml2 type=%s count=%d\n",qPrint(lt2.to_string()),ml2->numDecMembers(inheritedFrom));
4916 ml2->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,FALSE,showInline,inheritedFrom,lt,ml==nullptr);
4917 }
4918 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4919 if (!inlineInheritedMembers) // show inherited members as separate lists
4920 {
4921 writeInheritedMemberDeclarations(ol,visitedClasses,lt,lt2,title,
4922 inheritedFrom ? inheritedFrom : this,
4923 invert,showAlways);
4924 }
4925 }
4926}
4927
4929 const ClassDef *inheritedFrom,const QCString &inheritId) const
4930{
4931 //printf("** %s::addGroupedInheritedMembers() inheritId=%s\n",qPrint(name()),qPrint(inheritId));
4932 for (const auto &mg : m_memberGroups)
4933 {
4934 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
4935 {
4936 mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId);
4937 }
4938 }
4939}
4940
4942{
4943 //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",qPrint(name()));
4944 MemberList * ml = getMemberList(lt);
4945 if (ml) ml->writeDocumentation(ol,displayName(),this,title,ml->listType().toLabel(),FALSE,showInline);
4946}
4947
4949{
4950 //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",qPrint(name()));
4951 MemberList * ml = getMemberList(lt);
4952 if (ml) ml->writeSimpleDocumentation(ol,this);
4953}
4954
4956 MemberListType lt,bool inGroup,
4957 int indentLevel,const ClassDef *inheritedFrom,const QCString &inheritId) const
4958{
4959 //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",qPrint(name()));
4960 MemberList * ml = getMemberList(lt);
4961 if (ml)
4962 {
4963 ml->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
4964 }
4965}
4966
4968{
4969 return m_isLocal;
4970}
4971
4976
4981
4983{
4984 return m_inherits;
4985}
4986
4988{
4989 m_inherits = bcd;
4990}
4991
4993{
4994 return m_inheritedBy;
4995}
4996
4998{
4999 m_inheritedBy = bcd;
5000}
5001
5006
5008{
5009 std::stable_sort(m_allMemberNameInfoLinkedMap.begin(),
5011 [](const auto &m1,const auto &m2)
5012 {
5013 return qstricmp_sort(m1->memberName(),m2->memberName())<0;
5014 });
5015}
5016
5018{
5019 return m_prot;
5020}
5021
5023{
5024 return m_tempArgs;
5025}
5026
5028{
5029 return m_fileDef;
5030}
5031
5033{
5034 return m_moduleDef;
5035}
5036
5041
5043{
5044 return m_templateMaster;
5045}
5046
5051
5056
5058{
5059 return !m_tempArgs.empty();
5060}
5061
5063{
5064 return m_incInfo.get();
5065}
5066
5071
5076
5081
5083{
5084 return m_isTemplArg;
5085}
5086
5088{
5089 return m_isAbstract || m_spec.isAbstract();
5090}
5091
5093{
5094 return m_spec.isFinal();
5095}
5096
5098{
5099 return m_spec.isSealed();
5100}
5101
5103{
5104 return m_spec.isPublished();
5105}
5106
5108{
5109 return m_spec.isForwardDecl();
5110}
5111
5113{
5114 return m_spec.isInterface();
5115}
5116
5118{
5119 return getLanguage()==SrcLangExt::ObjC;
5120}
5121
5123{
5124 return getLanguage()==SrcLangExt::Fortran;
5125}
5126
5128{
5129 return getLanguage()==SrcLangExt::CSharp;
5130}
5131
5133{
5134 return m_categoryOf;
5135}
5136
5138{
5139 return m_memberLists;
5140}
5141
5143{
5144 return m_memberGroups;
5145}
5146
5148{
5149 m_fileDef = fd;
5150}
5151
5153{
5154 m_moduleDef = mod;
5155}
5156
5158{
5159 m_subGrouping = enabled;
5160}
5161
5163{
5164 m_prot=p;
5165 if (getLanguage()==SrcLangExt::VHDL && VhdlDocGen::convert(p)==VhdlDocGen::ARCHITECTURECLASS)
5166 {
5167 m_className = name();
5168 }
5169}
5170
5172{
5173 m_isStatic=b;
5174}
5175
5180
5182{
5183 assert(tm!=this);
5185}
5186
5188{
5189 m_isTemplArg = b;
5190}
5191
5193{
5194 m_categoryOf = cd;
5195}
5196
5198{
5199 m_usedOnly = b;
5200}
5201
5203{
5204 return m_usedOnly;
5205}
5206
5208{
5209 return m_isSimple;
5210}
5211
5213{
5214 return m_arrowOperator;
5215}
5216
5218{
5219 md->setMemberType(t);
5220 for (auto &ml : m_memberLists)
5221 {
5222 ml->remove(md);
5223 }
5224 insertMember(md);
5225}
5226
5228{
5229 QCString anc;
5231 {
5233 {
5234 // point to the template of which this class is an instance
5235 anc = m_templateMaster->getOutputFileBase();
5236 }
5237 else
5238 {
5239 anc = m_fileName;
5240 }
5241 }
5242 return anc;
5243}
5244
5246{
5247 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
5248 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
5249
5250 Definition *container = getOuterScope();
5251
5252 bool containerLinkable =
5253 container &&
5254 (
5255 (container==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) || // global class in documented file
5256 container->isLinkableInProject() // class in documented scope
5257 );
5258
5259 // inline because of INLINE_GROUPED_CLASSES=YES ?
5260 bool b1 = (inlineGroupedClasses && !partOfGroups().empty()); // a grouped class
5261 // inline because of INLINE_SIMPLE_STRUCTS=YES ?
5262 bool b2 = (inlineSimpleClasses && m_isSimple && // a simple class
5263 (containerLinkable || // in a documented container
5264 !partOfGroups().empty() // or part of a group
5265 )
5266 );
5267 //printf("%s::isEmbeddedInOuterScope(): inlineGroupedClasses=%d "
5268 // "inlineSimpleClasses=%d partOfGroups()=%p m_isSimple=%d "
5269 // "getOuterScope()=%s b1=%d b2=%d\n",
5270 // qPrint(name()),inlineGroupedClasses,inlineSimpleClasses,
5271 // partOfGroups().pointer(),m_isSimple,getOuterScope()?qPrint(getOuterScope()->name()):"<none>",b1,b2);
5272 return b1 || b2; // either reason will do
5273}
5274
5276{
5277 return m_tagLessRef;
5278}
5279
5281{
5282 m_tagLessRef = cd;
5283}
5284
5286{
5287 for (auto &ml : m_memberLists)
5288 {
5289 ml->remove(md);
5290 }
5291}
5292
5294{
5295 return m_isJavaEnum;
5296}
5297
5299{
5300 m_spec = spec;
5301}
5302
5304{
5305 for (const auto &sx : qualifiers)
5306 {
5307 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5308 if (!alreadyAdded)
5309 {
5310 m_qualifiers.push_back(sx);
5311 }
5312 }
5313}
5314
5319
5321{
5322 AUTO_TRACE("name={}",md->name());
5323 const auto &mni = m_allMemberNameInfoLinkedMap.find(md->name());
5324 if (mni)
5325 {
5326 for (const auto &mi : *mni)
5327 {
5328 const MemberDef *classMd = mi->memberDef();
5329 const ArgumentList &classAl = classMd->argumentList();
5330 const ArgumentList &al = md->argumentList();
5331 bool found = matchArguments2(
5332 classMd->getOuterScope(),classMd->getFileDef(),classMd->typeString(),&classAl,
5333 md->getOuterScope(),md->getFileDef(),md->typeString(),&al,
5334 true,getLanguage()
5335 );
5336 if (found)
5337 {
5338 AUTO_TRACE_EXIT("true");
5339 return true;
5340 }
5341 }
5342 }
5343 AUTO_TRACE_EXIT("false");
5344 return false;
5345}
5346
5348{
5349 QCString n = name();
5350 int si = n.find('(');
5351 int ei = n.find(')');
5352 bool b = ei>si && n.mid(si+1,ei-si-1).stripWhiteSpace().isEmpty();
5353 return b;
5354}
5355
5357{
5358 return m_files;
5359}
5360
5362{
5363 return m_typeConstraints;
5364}
5365
5367{
5368 return m_examples;
5369}
5370
5372{
5373 return m_subGrouping;
5374}
5375
5377{
5378 return m_spec.isLocal();
5379}
5380
5382{
5383 m_metaData = md;
5384}
5385
5390
5395
5397{
5399}
5400
5402{
5404}
5405
5407{
5408 switch (compoundType())
5409 {
5410 case Class: return CodeSymbolType::Class; break;
5411 case Struct: return CodeSymbolType::Struct; break;
5412 case Union: return CodeSymbolType::Union; break;
5413 case Interface: return CodeSymbolType::Interface; break;
5414 case Protocol: return CodeSymbolType::Protocol; break;
5415 case Category: return CodeSymbolType::Category; break;
5416 case Exception: return CodeSymbolType::Exception; break;
5417 case Service: return CodeSymbolType::Service; break;
5418 case Singleton: return CodeSymbolType::Singleton; break;
5419 }
5420 return CodeSymbolType::Class;
5421}
5422
5427
5432
5433
5434// --- Cast functions
5435//
5437{
5438 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5439 {
5440 return static_cast<ClassDef*>(d);
5441 }
5442 else
5443 {
5444 return nullptr;
5445 }
5446}
5447
5449{
5450 Definition *d = toDefinition(md);
5451 if (d && typeid(*d)==typeid(ClassDefImpl))
5452 {
5453 return static_cast<ClassDef*>(d);
5454 }
5455 else
5456 {
5457 return nullptr;
5458 }
5459}
5460
5462{
5463 if (d && (typeid(*d)==typeid(ClassDefImpl) || typeid(*d)==typeid(ClassDefAliasImpl)))
5464 {
5465 return static_cast<const ClassDef*>(d);
5466 }
5467 else
5468 {
5469 return nullptr;
5470 }
5471}
5472
5474{
5475 if (d && typeid(*d)==typeid(ClassDefImpl))
5476 {
5477 return static_cast<ClassDefMutable*>(d);
5478 }
5479 else
5480 {
5481 return nullptr;
5482 }
5483}
5484
5485// --- Helpers
5486
5487/*! Get a class definition given its name.
5488 * Returns nullptr if the class is not found.
5489 */
5491{
5492 if (n.isEmpty()) return nullptr;
5493 return Doxygen::classLinkedMap->find(n);
5494}
5495
5497{
5498 for (const auto &bcd : bcl)
5499 {
5500 const ClassDef *cd=bcd.classDef;
5501 if (cd->isVisibleInHierarchy()) return true;
5502 if (classHasVisibleRoot(cd->baseClasses())) return true;
5503 }
5504 return false;
5505}
5506
5508{
5509 BaseClassList bcl;
5510
5511 if (cd->getLanguage()==SrcLangExt::VHDL) // reverse baseClass/subClass relation
5512 {
5513 if (cd->baseClasses().empty()) return FALSE;
5514 bcl=cd->baseClasses();
5515 }
5516 else
5517 {
5518 if (cd->subClasses().empty()) return FALSE;
5519 bcl=cd->subClasses();
5520 }
5521
5522 for (const auto &bcd : bcl)
5523 {
5524 if (bcd.classDef->isVisibleInHierarchy())
5525 {
5526 return TRUE;
5527 }
5528 }
5529 return FALSE;
5530}
5531
5533{
5534 bool allExternals = Config_getBool(ALLEXTERNALS);
5535 return (allExternals && cd->isLinkable()) || cd->isLinkableInProject();
5536}
5537
5538//----------------------------------------------------------------------
5539// recursive function that returns the number of branches in the
5540// inheritance tree that the base class 'bcd' is below the class 'cd'
5541
5542int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level)
5543{
5544 const int maxInheritanceDepth = 100000;
5545 if (bcd->categoryOf()) // use class that is being extended in case of
5546 // an Objective-C category
5547 {
5548 bcd=bcd->categoryOf();
5549 }
5550 if (cd==bcd) return level;
5551 if (level==256)
5552 {
5553 warn_uncond("class {} seem to have a recursive inheritance relation!\n",cd->name());
5554 return -1;
5555 }
5556 int m=maxInheritanceDepth;
5557 for (const auto &bcdi : cd->baseClasses())
5558 {
5559 int mc=minClassDistance(bcdi.classDef,bcd,level+1);
5560 if (mc<m) m=mc;
5561 if (m<0) break;
5562 }
5563 return m;
5564}
5565
5567{
5568 if (bcd->categoryOf()) // use class that is being extended in case of
5569 // an Objective-C category
5570 {
5571 bcd=bcd->categoryOf();
5572 }
5573 if (cd==bcd)
5574 {
5575 goto exit;
5576 }
5577 if (level==256)
5578 {
5579 err("Internal inconsistency: found class {} seem to have a recursive "
5580 "inheritance relation! Please send a bug report to doxygen@gmail.com\n",cd->name());
5581 }
5582 else if (prot!=Protection::Private)
5583 {
5584 for (const auto &bcdi : cd->baseClasses())
5585 {
5586 Protection baseProt = classInheritedProtectionLevel(bcdi.classDef,bcd,bcdi.prot,level+1);
5587 if (baseProt==Protection::Private) prot=Protection::Private;
5588 else if (baseProt==Protection::Protected) prot=Protection::Protected;
5589 }
5590 }
5591exit:
5592 //printf("classInheritedProtectionLevel(%s,%s)=%d\n",qPrint(cd->name()),qPrint(bcd->name()),prot);
5593 return prot;
5594}
5595
5596
constexpr auto prefix
Definition anchor.cpp:44
std::vector< ArgumentList > ArgumentLists
Definition arguments.h:147
This class represents an function or template argument list.
Definition arguments.h:65
bool empty() const
Definition arguments.h:99
Argument & at(size_t i)
Definition arguments.h:107
bool isSimple() const override
Definition classdef.cpp: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:5916
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
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const QCString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const QCString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:1966
QCString removeRedundantWhiteSpace(const QCString &s)
Definition util.cpp:569
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5134
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition util.cpp:3683
bool protectionLevelVisible(Protection prot)
Definition util.cpp:5876
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:3900
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
Definition util.cpp:5382
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:1244
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:4753
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:4840
QCString demangleCSharpGenericName(const QCString &name, const QCString &templArgs)
Definition util.cpp:6860
QCString removeAnonymousScopes(const QCString &str)
Definition util.cpp:163
void createSubDirs(const Dir &d)
Definition util.cpp:3577
QCString stripScope(const QCString &name)
Definition util.cpp:3716
QCString inlineTemplateArgListToDoc(const ArgumentList &al)
Definition util.cpp:1172
QCString stripExtension(const QCString &fName)
Definition util.cpp:4872
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:3441
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:3849
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:6166
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:5836
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:1101
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:3809
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:1125
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:4850
A bunch of utility functions.