Doxygen
Loading...
Searching...
No Matches
ClassDefImpl Class Referencefinal

Implementation of the ClassDef interface. More...

Inheritance diagram for ClassDefImpl:
Collaboration diagram for ClassDefImpl:

Public Member Functions

 ClassDefImpl (const DString &fileName, int startLine, size_t startColumn, const DString &name, CompoundType ct, const DString &ref=DString(), const DString &fName=DString(), bool isSymbol=true, bool isJavaEnum=false)
DefType definitionType () const override
std::unique_ptr< ClassDef > deepCopy (const DString &name) const override
void moveTo (Definition *) override
CodeSymbolType codeSymbolType () const override
DString getOutputFileBase () const override
DString getInstanceOutputFileBase () const override
DString getSourceFileBase () const override
DString getReference () const override
bool isReference () const override
bool isLocal () const override
 Returns true if this is a local class definition, see EXTRACT_LOCAL_CLASSES.
ClassLinkedRefMap getClasses () const override
 returns the classes nested into this class
bool hasDocumentation () const override
bool hasDetailedDescription () const override
 returns true if this class has a non-empty detailed description
DString collaborationGraphFileName () const override
 returns the file name to use for the collaboration graph
DString inheritanceGraphFileName () const override
 returns the file name to use for the inheritance graph
DString displayName (bool includeScope=true) const override
CompoundType compoundType () const override
 Returns the type of compound this is, i.e. class/struct/union/...
DString compoundTypeString () const override
 Returns the type of compound as a string.
const BaseClassList & baseClasses () const override
 Returns the list of base classes from which this class directly inherits.
void updateBaseClasses (const BaseClassList &bcd) override
 Update the list of base classes to the one passed.
const BaseClassList & subClasses () const override
 Returns the list of sub classes that directly derive from this class.
void updateSubClasses (const BaseClassList &bcd) override
 Update the list of sub classes to the one passed.
const MemberNameInfoLinkedMap & memberNameInfoLinkedMap () const override
 Returns a dictionary of all members.
Protection protection () const override
 Return the protection level (Public,Protected,Private) in which this compound was found.
bool isLinkableInProject () const override
bool isLinkable () const override
bool isVisibleInHierarchy () const override
bool visibleInParentsDeclList () const override
 show this class in the declaration section of its parent?
const ArgumentList & templateArguments () const override
 Returns the template arguments of this class.
FileDef * getFileDef () const override
 Returns the file in which this compound's definition can be found.
ModuleDef * getModuleDef () const override
 Returns the C++20 module in which this compound's definition can be found.
const MemberDef * getMemberByName (const DString &) const override
 Returns the member with the given name.
int isBaseClass (const ClassDef *bcd, bool followInstances, const DString &templSpec) const override
 Returns true iff bcd is a direct or indirect base class of this class.
bool isSubClass (ClassDef *bcd, int level=0) const override
 Returns true iff bcd is a direct or indirect sub class of this class.
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
const TemplateInstanceList & getTemplateInstances () const override
 Returns a sorted dictionary with all template instances found for this template class.
const ClassDef * templateMaster () const override
 Returns the template master of which this class is an instance.
bool isTemplate () const override
 Returns true if this class is a template.
const IncludeInfo * includeInfo () const override
const UsesClassList & usedImplementationClasses () const override
const UsesClassList & usedByImplementationClasses () const override
const ConstraintClassList & templateTypeConstraints () const override
bool isTemplateArgument () const override
const Definition * findInnerCompound (const DString &name) const override
ArgumentLists getTemplateParameterLists () const override
 Returns the template parameter lists that form the template declaration of this class.
DString qualifiedNameWithTemplateParameters (const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const override
bool isAbstract () const override
 Returns true if there is at least one pure virtual member in this class.
bool isObjectiveC () const override
 Returns true if this class is implemented in Objective-C.
bool isFortran () const override
 Returns true if this class is implemented in Fortran.
bool isCSharp () const override
 Returns true if this class is implemented in C#.
bool isFinal () const override
 Returns true if this class is marked as final.
bool isSealed () const override
 Returns true if this class is marked as sealed.
bool isRef () const override
 Returns true if this class is a C# ref struct or a C++/CLI ref class.
bool isPublished () const override
 Returns true if this class is marked as published.
bool isExtension () const override
 Returns true if this class represents an Objective-C 2.0 extension (nameless category).
bool isForwardDeclared () const override
 Returns true if this class represents a forward declaration of a template class.
bool isInterface () const override
 Returns true if this class represents an interface.
ClassDef * categoryOf () const override
 Returns the class of which this is a category (Objective-C only).
DString className () const override
 Returns the name of the class including outer classes, but not including namespaces.
MemberList * getMemberList (MemberListType lt) const override
 Returns the members in the list identified by lt.
const MemberLists & getMemberLists () const override
 Returns the list containing the list of members sorted per type.
const MemberGroupList & getMemberGroups () const override
 Returns the member groups defined for this class.
const TemplateNameMap & getTemplateBaseClassNames () const override
bool isUsedOnly () const override
DString anchor () const override
bool isEmbeddedInOuterScope () const override
bool isSimple () const override
const ClassDef * taglessParent () const override
bool hasNamedVariable () const override
const MemberDef * isSmartPointer () const override
bool isJavaEnum () const override
DString title () const override
DString generatedFromFiles () const override
const FileList & usedFiles () const override
const ArgumentList & typeConstraints () const override
const ExampleList & getExamples () const override
bool hasExamples () const override
DString getMemberListFileName () const override
bool subGrouping () const override
bool isSliceLocal () const override
bool hasNonReferenceSuperClass () const override
DString requiresClause () const override
StringVector getQualifiers () const override
bool containsOverload (const MemberDef *md) const override
bool isImplicitTemplateInstance () const override
ClassDef * insertTemplateInstance (const DString &fileName, int startLine, size_t startColumn, const DString &templSpec, bool &freshInstance) override
void insertBaseClass (ClassDef *, const DString &name, Protection p, Specifier s, const DString &t=DString()) override
void insertSubClass (ClassDef *, Protection p, Specifier s, const DString &t=DString()) override
void insertExplicitTemplateInstance (ClassDef *instance, const DString &spec) override
void setIncludeFile (FileDef *fd, const DString &incName, bool local, bool force) override
void insertMember (MemberDef *) override
void insertUsedFile (const FileDef *) override
bool addExample (const DString &anchor, const DString &name, const DString &file) override
void mergeCategory (ClassDef *category) override
void setFileDef (FileDef *fd) override
void setModuleDef (ModuleDef *mod) override
void setSubGrouping (bool enabled) override
void setProtection (Protection p) override
void setGroupDefForAllMembers (GroupDef *g, Grouping::GroupPri_t pri, const DString &fileName, int startLine, bool hasDocs) override
void addInnerCompound (Definition *d) override
void addUsedClass (ClassDef *cd, const DString &accessName, Protection prot) override
void addUsedByClass (ClassDef *cd, const DString &accessName, Protection prot) override
void setIsStatic (bool b) override
void setCompoundType (CompoundType t) override
void setClassName (const DString &name) override
void setClassSpecifier (TypeSpecifier spec) override
void addQualifiers (const StringVector &qualifiers) override
void setTemplateArguments (const ArgumentList &al) override
void setTemplateBaseClassNames (const TemplateNameMap &templateNames) override
void setTemplateMaster (const ClassDef *tm) override
void setImplicitTemplateInstance (bool b) override
void setTypeConstraints (const ArgumentList &al) override
void addMemberToTemplateInstance (const MemberDef *md, const ArgumentList &templateArguments, const DString &templSpec) override
void addMembersToTemplateInstance (const ClassDef *cd, const ArgumentList &templateArguments, const DString &templSpec) override
void makeTemplateArgument (bool b=true) override
void setCategoryOf (ClassDef *cd) override
void setUsedOnly (bool b) override
void setTaglessParent (const ClassDef *cd) override
void setHasNamedVariable (bool b) override
void setMetaData (const DString &md) override
void findSectionsInDocumentation () override
void addMembersToMemberGroup () override
void addListReferences () override
void addRequirementReferences () override
void addTypeConstraints () override
void computeAnchors () override
void mergeMembers () override
void sortMemberLists () override
void distributeMemberGroupDocumentation () override
void writeDocumentation (OutputList &ol) const override
void writeDocumentationForInnerClasses (OutputList &ol) const override
void writeMemberPages (OutputList &ol) const override
void writeMemberList (OutputList &ol) const override
void writeDeclaration (OutputList &ol, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const DString &inheritId) const override
void writeQuickMemberLinks (OutputList &ol, const MemberDef *md) const override
void writePageNavigation (OutputList &ol) const override
void writeSummaryLinks (OutputList &ol) const override
void reclassifyMember (MemberDefMutable *md, MemberType t) override
void writeInlineDocumentation (OutputList &ol) const override
 Write class documentation inside another container (i.e. a group).
void writeDeclarationLink (OutputList &ol, bool &found, const DString &header, bool localNames) const override
void removeMemberFromLists (MemberDef *md) override
void setAnonymousEnumType () override
void countMembers () override
void sortAllMembersList () override
void addGroupedInheritedMembers (OutputList &ol, MemberListType lt, const ClassDef *inheritedFrom, const DString &inheritId) const override
void writeTagFile (TextStream &) const override
int countMembersIncludingGrouped (MemberListType lt, const ClassDef *inheritedFrom, bool additional) const override
int countMemberDeclarations (MemberListType lt, const ClassDef *inheritedFrom, MemberListType lt2, bool invert, bool showAlways, ClassDefSet &visitedClasses) const override
void writeMemberDeclarations (OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, const DString &title, const DString &subTitle=DString(), bool showInline=false, const ClassDef *inheritedFrom=nullptr, MemberListType lt2=MemberListType::Invalid(), bool invert=false, bool showAlways=false) const override
void setRequiresClause (const DString &req) override
void setPrimaryConstructorParams (const ArgumentList &list) override
CLASS_GRAPH_t hasInheritanceGraph () const override
void overrideInheritanceGraph (CLASS_GRAPH_t e) override
bool hasCollaborationGraph () const override
void overrideCollaborationGraph (bool e) override
Public Member Functions inherited from DefinitionMixin< ClassDefMutable >
 DefinitionMixin (const DString &defFileName, int defLine, size_t defColumn, const DString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=true)
DefinitionMixin & operator= (const DefinitionMixin &other)
 ~DefinitionMixin () override=default
bool isAlias () const override
const DString & name () const override
bool isAnonymous () const override
const DString & localName () const override
DString qualifiedName () const override
DString symbolName () const override
DString getSourceFileBase () const override
DString getSourceAnchor () const override
DString documentation () const override
int docLine () const override
DString docFile () const override
DString briefDescription (bool abbreviate=false) const override
DString briefDescriptionAsTooltip () const override
int briefLine () const override
DString inbodyDocumentation () const override
DString inbodyFile () const override
int inbodyLine () const override
DString briefFile () const override
DString getDefFileName () const override
DString getDefFileExtension () const override
int getDefLine () const override
size_t getDefColumn () const override
bool hasDocumentation () const override
bool hasUserDocumentation () const override
bool isVisibleInProject () const override
bool isVisible () const override
bool isHidden () const override
bool isArtificial () const override
bool isExported () const override
DString getReference () const override
bool isReference () const override
DString externalReference (const DString &relPath) const override
int getStartDefLine () const override
int getStartBodyLine () const override
int getEndBodyLine () const override
const FileDef * getBodyDef () const override
SrcLangExt getLanguage () const override
const GroupList & partOfGroups () const override
bool isLinkableViaGroup () const override
const RefItemVector & xrefListItems () const override
const RequirementRefs & requirementReferences () const override
const Definition * findInnerCompound (const DString &name) const override
Definition * getOuterScope () const override
const MemberVector & getReferencesMembers () const override
const MemberVector & getReferencedByMembers () const override
bool hasSections () const override
bool hasSources () const override
bool hasBriefDescription () const override
DString id () const override
const SectionRefs & getSectionRefs () const override
void setName (const DString &name) override
void setId (const DString &name) override
void setDefFile (const DString &df, int defLine, size_t defColumn) override
void setDocumentation (const DString &doc, const DString &docFile, int docLine, bool stripWhiteSpace=true) override
void setBriefDescription (const DString &brief, const DString &briefFile, int briefLine) override
void setInbodyDocumentation (const DString &doc, const DString &docFile, int docLine) override
void setReference (const DString &r) override
void addSectionsToDefinition (const std::vector< const SectionInfo * > &anchorList) override
void setBodySegment (int defLine, int bls, int ble) override
void setBodyDef (const FileDef *fd) override
void addSourceReferencedBy (MemberDef *md, const DString &sourceRefName) override
void addSourceReferences (MemberDef *md, const DString &sourceRefName) override
void setRefItems (const RefItemVector &sli) override
void setRequirementReferences (const RequirementRefs &rqli) override
void mergeRefItems (Definition *def) override
void mergeReferences (const Definition *other) override
void mergeReferencedBy (const Definition *other) override
void addInnerCompound (Definition *def) override
void setOuterScope (Definition *def) override
void setHidden (bool b) override
void setArtificial (bool b) override
void setExported (bool b) override
void setLanguage (SrcLangExt lang) override
void writeSourceDef (OutputList &ol) const override
void writeInlineCode (OutputList &ol, const DString &scopeName) const override
bool hasSourceRefs () const override
bool hasSourceReffedBy () const override
void writeSourceRefs (OutputList &ol, const DString &scopeName) const override
void writeSourceReffedBy (OutputList &ol, const DString &scopeName) const override
bool hasRequirementRefs () const override
void writeRequirementRefs (OutputList &ol) const override
void makePartOfGroup (GroupDef *gd) override
void writeNavigationPath (OutputList &ol) const override
DString navigationPathAsString () const override
void writeQuickMemberLinks (OutputList &ol, const MemberDef *md) const override
void writeSummaryLinks (OutputList &ol) const override
void writePageNavigation (OutputList &ol) const override
DString pathFragment () const override
void writeDocAnchorsToTagFile (TextStream &fs) const override
void setLocalName (const DString &name) override
void writeToc (OutputList &ol, const LocalToc &lt) const override
void computeTooltip () override
void _setSymbolName (const DString &name) override
DString _symbolName () const override

Private Member Functions

int countInheritedByNodes () const
int countInheritsNodes () const
int countInheritanceNodes () const
void addUsedInterfaceClasses (MemberDef *md, const DString &typeStr)
void showUsedFiles (OutputList &ol) const
void writeDocumentationContents (OutputList &ol, const DString &pageTitle) const
void internalInsertMember (MemberDef *md, Protection prot, bool addToAllList)
void addMemberToList (MemberListType lt, MemberDef *md, bool isBrief)
void writeInheritedMemberDeclarations (OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, MemberListType lt2, const DString &title, const ClassDef *inheritedFrom, bool invert, bool showAlways) const
void writeMemberDocumentation (OutputList &ol, MemberListType lt, const DString &title, bool showInline=false) const
void writeSimpleMemberDocumentation (OutputList &ol, MemberListType lt) const
void writePlainMemberDeclaration (OutputList &ol, MemberListType lt, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const DString &inheritId) const
void writeBriefDescription (OutputList &ol, bool exampleFlag) const
void writeDetailedDescription (OutputList &ol, const DString &pageType, bool exampleFlag, const DString &title, const DString &anchor=DString()) const
void writeIncludeFiles (OutputList &ol) const
void writeIncludeFilesForSlice (OutputList &ol) const
void writeInheritanceGraph (OutputList &ol) const
void writeCollaborationGraph (OutputList &ol) const
void writeMemberGroups (OutputList &ol, bool showInline=false) const
void writeNestedClasses (OutputList &ol, const DString &title) const
void writeInlineClasses (OutputList &ol) const
void startMemberDeclarations (OutputList &ol) const
void endMemberDeclarations (OutputList &ol) const
void startMemberDocumentation (OutputList &ol) const
void endMemberDocumentation (OutputList &ol) const
void writeAuthorSection (OutputList &ol) const
void writeMoreLink (OutputList &ol, const DString &anchor) const
void writeDetailedDocumentationBody (OutputList &ol) const
int countAdditionalInheritedMembers () const
void writeAdditionalInheritedMembers (OutputList &ol) const
void addClassAttributes (OutputList &ol) const
int countInheritedDecMembers (MemberListType lt, const ClassDef *inheritedFrom, bool invert, bool showAlways, ClassDefSet &visitedClasses) const
void getTitleForMemberListType (MemberListType type, DString &title, DString &subtitle) const
void addTypeConstraint (const DString &typeConstraint, const DString &type)
void writeTemplateSpec (OutputList &ol, const Definition *d, const DString &type, SrcLangExt lang) const
void mergeMembersFromBaseClasses (bool mergeVirtualBaseClass)
void hideDerivedVariablesInPython (ClassDefMutable *cls)

Private Attributes

DString m_fileName
DString m_memberListFileName
DString m_collabFileName
DString m_inheritFileName
std::unique_ptr< IncludeInfo > m_incInfo
BaseClassList m_inherits
BaseClassList m_inheritedBy
FileDef * m_fileDef = nullptr
ModuleDef * m_moduleDef = nullptr
MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap
ArgumentList m_tempArgs
ArgumentList m_typeConstraints
FileList m_files
ExampleList m_examples
ClassDef::CompoundType m_compType
Protection m_prot
ClassLinkedRefMap m_innerClasses
UsesClassList m_usesImplClassList
UsesClassList m_usedByImplClassList
ConstraintClassList m_constraintClassList
TemplateInstanceList m_templateInstances
TemplateNameMap m_templBaseClassNames
const ClassDef * m_templateMaster = nullptr
DString m_className
ClassDef * m_categoryOf = nullptr
MemberLists m_memberLists
MemberGroupList m_memberGroups
bool m_isAbstract = false
bool m_isStatic = false
bool m_membersMerged = false
bool m_isLocal = false
bool m_isTemplArg = false
bool m_subGrouping = false
bool m_usedOnly = false
 Reason of existence is a "use" relation.
StringSet m_vhdlSummaryTitles
 List of titles to use for the summary.
bool m_isSimple = false
 Is this a simple (non-nested) C structure?
const MemberDef * m_arrowOperator = nullptr
 Does this class overloaded the -> operator?
const ClassDef * m_taglessParent = nullptr
bool m_hasNamedVariable = false
bool m_isJavaEnum = false
 Does this class represent a Java style enum?
TypeSpecifier m_spec
DString m_metaData
DString m_requiresClause
 C++20 requires clause.
StringVector m_qualifiers
bool m_hasCollaborationGraph = false
CLASS_GRAPH_t m_typeInheritanceGraph = CLASS_GRAPH_t::NO
bool m_implicitTemplateInstance = false
ArgumentList m_primaryConstructorParams

Additional Inherited Members

Public Types inherited from ClassDef
enum  CompoundType {
  Class , Struct , Record , Union ,
  Interface , Protocol , Category , Exception ,
  Service , Singleton
}
 The various compound types. More...
Public Types inherited from Definition
enum  DefType {
  TypeClass = 0 , TypeFile = 1 , TypeNamespace = 2 , TypeModule = 3 ,
  TypeMember = 4 , TypeGroup = 5 , TypePackage = 6 , TypePage = 7 ,
  TypeDir = 8 , TypeConcept = 9
}

Detailed Description

Implementation of the ClassDef interface.

Definition at line 201 of file classdef.cpp.

Constructor & Destructor Documentation

◆ ClassDefImpl()

ClassDefImpl::ClassDefImpl ( const DString & fileName,
int startLine,
size_t startColumn,
const DString & name,
CompoundType ct,
const DString & ref = DString(),
const DString & fName = DString(),
bool isSymbol = true,
bool isJavaEnum = false )

Definition at line 829 of file classdef.cpp.

834 : DefinitionMixin(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),nullptr,nullptr,isSymbol)
835{
836 AUTO_TRACE("name={}",name());
837 setReference(lref);
838 m_compType = ct;
840 DString compTypeString = getCompoundTypeString(getLanguage(),ct,isJavaEnum);
841 if (!fName.empty())
842 {
844 }
845 else
846 {
847 m_fileName=compTypeString+name();
848 }
849 m_prot=Protection::Public;
850 //nspace=nullptr;
851 m_fileDef=nullptr;
852 m_moduleDef=nullptr;
853 m_subGrouping=Config_getBool(SUBGROUPING);
854 m_templateMaster =nullptr;
855 m_isAbstract = false;
856 m_isStatic = false;
857 m_isTemplArg = false;
858 m_membersMerged = false;
859 m_categoryOf = nullptr;
860 m_usedOnly = false;
861 m_isSimple = Config_getBool(INLINE_SIMPLE_STRUCTS);
862 m_arrowOperator = nullptr;
863 m_taglessParent = nullptr;
864 m_hasNamedVariable = false;
865 m_spec=TypeSpecifier();
866 //DString ns;
867 //extractNamespaceName(name,className,ns);
868 //printf("m_name=%s m_className=%s ns=%s\n",qPrint(m_name),qPrint(m_className),qPrint(ns));
869
870 // we cannot use getLanguage at this point, as setLanguage has not been called.
871 SrcLangExt lang = getLanguageFromFileName(defFileName);
872 if ((lang==SrcLangExt::Cpp || lang==SrcLangExt::ObjC) && EntryType::guessSection(defFileName).isSource())
873 {
874 m_isLocal=true;
875 }
876 else
877 {
878 m_isLocal=false;
879 }
880 m_hasCollaborationGraph = Config_getBool(COLLABORATION_GRAPH);
882 m_memberListFileName = convertNameToFile(compTypeString+name()+"-members");
885 if (lref.empty())
886 {
888 }
889 AUTO_TRACE_EXIT("m_fileName='{}'",m_fileName);
890}
const MemberDef * m_arrowOperator
Does this class overloaded the -> operator?
Definition classdef.cpp:559
TypeSpecifier m_spec
Definition classdef.cpp:567
DString m_fileName
Definition classdef.cpp:435
ClassDef * m_categoryOf
Definition classdef.cpp:522
Protection m_prot
Definition classdef.cpp:493
const ClassDef * m_templateMaster
Definition classdef.cpp:514
bool m_membersMerged
Definition classdef.cpp:536
bool m_hasNamedVariable
Definition classdef.cpp:562
bool m_isJavaEnum
Does this class represent a Java style enum?
Definition classdef.cpp:565
ModuleDef * m_moduleDef
Definition classdef.cpp:469
bool isJavaEnum() const override
DString m_inheritFileName
Definition classdef.cpp:444
bool m_isSimple
Is this a simple (non-nested) C structure?
Definition classdef.cpp:556
CLASS_GRAPH_t m_typeInheritanceGraph
Definition classdef.cpp:577
DString m_memberListFileName
Definition classdef.cpp:438
bool m_isAbstract
Definition classdef.cpp:530
FileDef * m_fileDef
Definition classdef.cpp:466
ClassDef::CompoundType m_compType
Definition classdef.cpp:487
bool m_hasCollaborationGraph
Definition classdef.cpp:576
const ClassDef * m_taglessParent
Definition classdef.cpp:561
bool m_isTemplArg
Definition classdef.cpp:541
bool m_usedOnly
Reason of existence is a "use" relation.
Definition classdef.cpp:550
bool m_subGrouping
Definition classdef.cpp:547
DString m_collabFileName
Definition classdef.cpp:441
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
const DString & name() const override
void setReference(const DString &r) override
DefinitionMixin(const DString &defFileName, int defLine, size_t defColumn, const DString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=true)
SrcLangExt getLanguage() const override
static EntryType guessSection(const DString &name)
Definition types.cpp:22
static DString getCompoundTypeString(SrcLangExt lang, ClassDef::CompoundType compType, bool isJavaEnum)
Definition classdef.cpp:162
#define Config_getBool(name)
Definition config.h:33
#define Config_getEnum(name)
Definition config.h:35
#define AUTO_TRACE(...)
Definition docnode.cpp:53
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:55
SrcLangExt
Definition types.h:207
DString stripExtension(const DString &fName)
Definition util.cpp:4087
DString removeRedundantWhiteSpace(const DString &s)
Definition util.cpp:427
DString convertNameToFile(const DString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:2995
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4300

References AUTO_TRACE, AUTO_TRACE_EXIT, Config_getBool, Config_getEnum, convertNameToFile(), DefinitionMixin< ClassDefMutable >::DefinitionMixin(), DString::empty(), getCompoundTypeString(), DefinitionMixin< ClassDefMutable >::getLanguage(), getLanguageFromFileName(), EntryType::guessSection(), isJavaEnum(), m_arrowOperator, m_categoryOf, m_collabFileName, m_compType, m_fileDef, m_fileName, m_hasCollaborationGraph, m_hasNamedVariable, m_inheritFileName, m_isAbstract, m_isJavaEnum, m_isLocal, m_isSimple, m_isStatic, m_isTemplArg, m_memberListFileName, m_membersMerged, m_moduleDef, m_prot, m_spec, m_subGrouping, m_taglessParent, m_templateMaster, m_typeInheritanceGraph, m_usedOnly, DefinitionMixin< ClassDefMutable >::name(), removeRedundantWhiteSpace(), DefinitionMixin< ClassDefMutable >::setReference(), and stripExtension().

Referenced by addTypeConstraint(), and insertTemplateInstance().

Member Function Documentation

◆ addClassAttributes()

void ClassDefImpl::addClassAttributes ( OutputList & ol) const
private

Definition at line 2782 of file classdef.cpp.

2783{
2784 StringVector sl;
2785 if (isFinal()) sl.emplace_back("final");
2786 if (isSealed()) sl.emplace_back("sealed");
2787 if (isAbstract()) sl.emplace_back("abstract");
2788 if (isRef()) sl.emplace_back("ref");
2789 if (isExported()) sl.emplace_back("export");
2790 if (getLanguage()==SrcLangExt::IDL && isPublished()) sl.emplace_back("published");
2791
2792 for (const auto &sx : m_qualifiers)
2793 {
2794 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2795 if (!alreadyAdded)
2796 {
2797 sl.push_back(sx);
2798 }
2799 }
2800
2801 ol.pushGeneratorState();
2803 if (!sl.empty())
2804 {
2805 ol.startLabels();
2806 size_t i=0;
2807 for (const auto &s : sl)
2808 {
2809 i++;
2810 ol.writeLabel(s,i==sl.size());
2811 }
2812 ol.endLabels();
2813 }
2814 ol.popGeneratorState();
2815}
bool isFinal() const override
Returns true if this class is marked as final.
bool isPublished() const override
Returns true if this class is marked as published.
StringVector m_qualifiers
Definition classdef.cpp:574
bool isAbstract() const override
Returns true if there is at least one pure virtual member in this class.
bool isSealed() const override
Returns true if this class is marked as sealed.
bool isRef() const override
Returns true if this class is a C# ref struct or a C++/CLI ref class.
void pushGeneratorState()
void disableAllBut(OutputType o)
void popGeneratorState()
void writeLabel(const DString &l, bool isLast)
Definition outputlist.h:736
void endLabels()
Definition outputlist.h:738
void startLabels()
Definition outputlist.h:734
std::vector< std::string > StringVector
Definition containers.h:33

References OutputList::disableAllBut(), OutputList::endLabels(), DefinitionMixin< ClassDefMutable >::getLanguage(), Html, isAbstract(), DefinitionMixin< ClassDefMutable >::isExported(), isFinal(), isPublished(), isRef(), isSealed(), m_qualifiers, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startLabels(), and OutputList::writeLabel().

Referenced by writeDocumentation().

◆ addExample()

bool ClassDefImpl::addExample ( const DString & anchor,
const DString & name,
const DString & file )
overridevirtual

Implements ClassDefMutable.

Definition at line 3488 of file classdef.cpp.

3489{
3490 return m_examples.inSort(Example(anchor,nameStr,file));
3491}
ExampleList m_examples
Definition classdef.cpp:484
DString anchor() const override
bool inSort(const Example &ex)
Definition example.h:39

References anchor(), ExampleList::inSort(), and m_examples.

◆ addGroupedInheritedMembers()

void ClassDefImpl::addGroupedInheritedMembers ( OutputList & ol,
MemberListType lt,
const ClassDef * inheritedFrom,
const DString & inheritId ) const
overridevirtual

Implements ClassDef.

Definition at line 5031 of file classdef.cpp.

5033{
5034 //printf("** %s::addGroupedInheritedMembers() inheritId=%s\n",qPrint(name()),qPrint(inheritId));
5035 for (const auto &mg : m_memberGroups)
5036 {
5037 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
5038 {
5039 mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId);
5040 }
5041 }
5042}
MemberGroupList m_memberGroups
Definition classdef.cpp:527

References m_memberGroups, and m_subGrouping.

◆ addInnerCompound()

void ClassDefImpl::addInnerCompound ( Definition * d)
overridevirtual

Implements DefinitionMutable.

Definition at line 4410 of file classdef.cpp.

4411{
4412 //printf("**** %s::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
4413 if (d->definitionType()==Definition::TypeClass) // only classes can be nested in classes.
4414 {
4415 ClassDef *cd = toClassDef(d);
4416 m_innerClasses.add(d->localName(),cd);
4417 if (cd && cd->isAnonymous())
4418 {
4419 m_isSimple = false;
4420 }
4421 }
4422}
ClassLinkedRefMap m_innerClasses
Definition classdef.cpp:498
virtual DefType definitionType() const =0
virtual const DString & localName() const =0
virtual bool isAnonymous() const =0
bool add(const char *k, T *obj)
Definition linkedmap.h:284
ClassDef * toClassDef(Definition *d)

References LinkedRefMap< T, Hash, KeyEqual, Map >::add(), Definition::definitionType(), Definition::isAnonymous(), Definition::localName(), m_innerClasses, m_isSimple, toClassDef(), and Definition::TypeClass.

◆ addListReferences()

void ClassDefImpl::addListReferences ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 4622 of file classdef.cpp.

4623{
4624 if (!isLinkableInProject()) return;
4625 SrcLangExt lang = getLanguage();
4627 qualifiedName(),
4630 displayName(),
4631 DString(),
4632 this
4633 );
4634 for (const auto &mg : m_memberGroups)
4635 {
4636 mg->addListReferences(this);
4637 }
4638 for (auto &ml : m_memberLists)
4639 {
4640 if (ml->listType().isDetailed())
4641 {
4642 ml->addListReferences(this);
4643 }
4644 }
4645}
bool isLinkableInProject() const override
MemberLists m_memberLists
Definition classdef.cpp:524
DString getOutputFileBase() const override
DString displayName(bool includeScope=true) const override
CompoundType compoundType() const override
Returns the type of compound this is, i.e. class/struct/union/...
DString qualifiedName() const override
const RefItemVector & xrefListItems() const override
virtual DString trCompoundType(ClassDef::CompoundType compType, SrcLangExt lang)=0
Translator * theTranslator
Definition language.cpp:76
void addRefItem(const RefItemVector &sli, const DString &key, const DString &prefix, const DString &name, const DString &title, const DString &args, const Definition *scope)
Definition reflist.h:136

References addRefItem(), compoundType(), displayName(), DefinitionMixin< ClassDefMutable >::getLanguage(), getOutputFileBase(), isLinkableInProject(), m_memberGroups, m_memberLists, DefinitionMixin< ClassDefMutable >::qualifiedName(), theTranslator, Translator::trCompoundType(), and DefinitionMixin< ClassDefMutable >::xrefListItems().

◆ addMembersToMemberGroup()

void ClassDefImpl::addMembersToMemberGroup ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 1048 of file classdef.cpp.

1049{
1050 for (auto &ml : m_memberLists)
1051 {
1052 if (!ml->listType().isDetailed())
1053 {
1055 }
1056 }
1057
1058 // add members inside sections to their groups
1059 for (const auto &mg : m_memberGroups)
1060 {
1061 if (mg->allMembersInSameSection() && m_subGrouping)
1062 {
1063 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
1064 mg->addToDeclarationSection();
1065 }
1066 }
1067}
void addMembersToMemberGroup() override

References addMembersToMemberGroup(), m_memberGroups, m_memberLists, and m_subGrouping.

Referenced by addMembersToMemberGroup().

◆ addMembersToTemplateInstance()

void ClassDefImpl::addMembersToTemplateInstance ( const ClassDef * cd,
const ArgumentList & templateArguments,
const DString & templSpec )
overridevirtual

Implements ClassDefMutable.

Definition at line 4534 of file classdef.cpp.

4535{
4536 AUTO_TRACE("this={} cd={} templSpec={}",name(),cd->name(),templSpec);
4537 //printf("%s::addMembersToTemplateInstance(%s,%s)\n",qPrint(name()),qPrint(cd->name()),templSpec);
4538 for (const auto &mni : cd->memberNameInfoLinkedMap())
4539 {
4540 for (const auto &mi : *mni)
4541 {
4542 const MemberDef *md = mi->memberDef();
4543 if (m_allMemberNameInfoLinkedMap.find(md->name())==nullptr) // only insert the member if not hidden by one with the same name (#11541)
4544 {
4546 }
4547 }
4548 }
4549 // also instantiate members for nested classes
4550 for (const auto &innerCd : cd->getClasses())
4551 {
4552 ClassDefMutable *ncd = toClassDefMutable(m_innerClasses.find(innerCd->localName()));
4553 if (ncd)
4554 {
4555 ncd->addMembersToTemplateInstance(innerCd,cd->templateArguments(),templSpec);
4556 }
4557 }
4558}
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const =0
Returns a dictionary of all members.
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
const ArgumentList & templateArguments() const override
Returns the template arguments of this class.
void addMemberToTemplateInstance(const MemberDef *md, const ArgumentList &templateArguments, const DString &templSpec) override
MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap
Definition classdef.cpp:472
virtual void addMembersToTemplateInstance(const ClassDef *cd, const ArgumentList &templateArguments, const DString &templSpec)=0
virtual const DString & name() const =0
const T * find(const std::string &key) const
Definition linkedmap.h:47
const T * find(const std::string &key) const
Definition linkedmap.h:243
ClassDefMutable * toClassDefMutable(Definition *d)

References ClassDefMutable::addMembersToTemplateInstance(), addMemberToTemplateInstance(), AUTO_TRACE, LinkedMap< T, Hash, KeyEqual, Map >::find(), LinkedRefMap< T, Hash, KeyEqual, Map >::find(), ClassDef::getClasses(), m_allMemberNameInfoLinkedMap, m_innerClasses, ClassDef::memberNameInfoLinkedMap(), Definition::name(), DefinitionMixin< ClassDefMutable >::name(), ClassDef::templateArguments(), templateArguments(), and toClassDefMutable().

◆ addMemberToList()

void ClassDefImpl::addMemberToList ( MemberListType lt,
MemberDef * md,
bool isBrief )
private

Definition at line 4706 of file classdef.cpp.

4707{
4708 AUTO_TRACE("{} md={} lt={} isBrief={}",name(),md->name(),lt,isBrief);
4709 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
4710 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
4711 const auto &ml = m_memberLists.get(lt,MemberListContainer::Class);
4712 ml->setNeedsSorting((isBrief && sortBriefDocs) || (!isBrief && sortMemberDocs));
4713 ml->push_back(md);
4714
4715 // for members in the declaration lists we set the section, needed for member grouping
4716 if (!ml->listType().isDetailed())
4717 {
4718 MemberDefMutable *mdm = toMemberDefMutable(md);
4719 if (mdm)
4720 {
4721 mdm->setSectionList(this,ml.get());
4722 }
4723 }
4724}
virtual void setSectionList(const Definition *container, const MemberList *sl)=0
const std::unique_ptr< MemberList > & get(MemberListType lt, MemberListContainer con)
Definition memberlist.h:192
MemberDefMutable * toMemberDefMutable(Definition *d)

References AUTO_TRACE, Class, Config_getBool, MemberLists::get(), m_memberLists, Definition::name(), DefinitionMixin< ClassDefMutable >::name(), MemberDefMutable::setSectionList(), and toMemberDefMutable().

Referenced by internalInsertMember().

◆ addMemberToTemplateInstance()

void ClassDefImpl::addMemberToTemplateInstance ( const MemberDef * md,
const ArgumentList & templateArguments,
const DString & templSpec )
overridevirtual

Implements ClassDefMutable.

Definition at line 4508 of file classdef.cpp.

4511{
4512 AUTO_TRACE("this={} md={}",name(),md->name());
4513 auto actualArguments_p = stringToArgumentList(getLanguage(),templSpec);
4514 auto imd = md->createTemplateInstanceMember(templateArguments,actualArguments_p);
4515 auto mmd = toMemberDefMutable(imd.get());
4516 mmd->setMemberClass(this);
4517 mmd->setTemplateMaster(md);
4518 mmd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
4519 mmd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
4520 mmd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
4521 mmd->setMemberSpecifiers(md->getMemberSpecifiers());
4522 mmd->setMemberGroupId(md->getMemberGroupId());
4523 mmd->setArtificial(true);
4524 insertMember(imd.get());
4525 //printf("Adding member=%s %s%s to class %s templSpec %s\n",
4526 // imd->typeString(),qPrint(imd->name()),imd->argsString(),
4527 // qPrint(imd->getClassDef()->name()),templSpec);
4528 // insert imd in the list of all members
4529 //printf("Adding member=%s class=%s\n",qPrint(imd->name()),qPrint(name()));
4530 MemberName *mn = Doxygen::memberNameLinkedMap->add(imd->name());
4531 mn->push_back(std::move(imd));
4532}
void insertMember(MemberDef *) override
virtual DString briefDescription(bool abbreviate=false) const =0
virtual DString inbodyFile() const =0
virtual DString briefFile() const =0
virtual int docLine() const =0
virtual DString documentation() const =0
virtual DString inbodyDocumentation() const =0
virtual int inbodyLine() const =0
virtual int briefLine() const =0
virtual DString docFile() const =0
static MemberNameLinkedMap * memberNameLinkedMap
Definition doxygen.h:104
T * add(const char *k, Args &&... args)
Definition linkedmap.h:90
virtual int getMemberGroupId() const =0
virtual std::unique_ptr< MemberDef > createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs) const =0
virtual TypeSpecifier getMemberSpecifiers() const =0
void push_back(Ptr &&p)
Definition membername.h:52
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const DString &argsString, DString *extraTypeChars=nullptr)
Definition defargs.l:822

References LinkedMap< T, Hash, KeyEqual, Map >::add(), AUTO_TRACE, Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), MemberDef::createTemplateInstanceMember(), Definition::docFile(), Definition::docLine(), Definition::documentation(), DefinitionMixin< ClassDefMutable >::getLanguage(), MemberDef::getMemberGroupId(), MemberDef::getMemberSpecifiers(), Definition::inbodyDocumentation(), Definition::inbodyFile(), Definition::inbodyLine(), insertMember(), Doxygen::memberNameLinkedMap, Definition::name(), DefinitionMixin< ClassDefMutable >::name(), MemberName::push_back(), stringToArgumentList(), templateArguments(), and toMemberDefMutable().

Referenced by addMembersToTemplateInstance().

◆ addQualifiers()

void ClassDefImpl::addQualifiers ( const StringVector & qualifiers)
overridevirtual

Implements ClassDefMutable.

Definition at line 5426 of file classdef.cpp.

5427{
5428 for (const auto &sx : qualifiers)
5429 {
5430 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5431 if (!alreadyAdded)
5432 {
5433 m_qualifiers.push_back(sx);
5434 }
5435 }
5436}

References m_qualifiers.

◆ addRequirementReferences()

void ClassDefImpl::addRequirementReferences ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 4647 of file classdef.cpp.

4648{
4649 if (!isLinkableInProject()) return;
4651 for (const auto &mg : m_memberGroups)
4652 {
4653 mg->addRequirementReferences(this);
4654 }
4655 for (auto &ml : m_memberLists)
4656 {
4657 if (ml->listType().isDetailed())
4658 {
4659 ml->addRequirementReferences(this);
4660 }
4661 }
4662}
static RequirementManager & instance()
void addRequirementRefsForSymbol(const Definition *symbol)

References RequirementManager::addRequirementRefsForSymbol(), RequirementManager::instance(), isLinkableInProject(), m_memberGroups, and m_memberLists.

◆ addTypeConstraint()

void ClassDefImpl::addTypeConstraint ( const DString & typeConstraint,
const DString & type )
private

Definition at line 3499 of file classdef.cpp.

3500{
3501 //printf("addTypeConstraint(%s,%s)\n",qPrint(type),qPrint(typeConstraint));
3502 bool hideUndocRelation = Config_getBool(HIDE_UNDOC_RELATIONS);
3503 if (typeConstraint.empty() || type.empty()) return;
3504 SymbolResolver resolver(getFileDef());
3505 ClassDefMutable *cd = resolver.resolveClassMutable(this,typeConstraint);
3506 if (cd==nullptr && !hideUndocRelation)
3507 {
3508 cd = toClassDefMutable(
3509 Doxygen::hiddenClassLinkedMap->add(typeConstraint,
3510 std::unique_ptr<ClassDef>(
3511 new ClassDefImpl(
3513 getDefColumn(),
3514 typeConstraint,
3515 ClassDef::Class))));
3516 if (cd)
3517 {
3518 cd->setUsedOnly(true);
3519 cd->setLanguage(getLanguage());
3520 //printf("Adding undocumented constraint '%s' to class %s on type %s\n",
3521 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3522 }
3523 }
3524 if (cd)
3525 {
3526 auto it = std::find_if(m_constraintClassList.begin(),
3528 [&cd](const auto &ccd) { return ccd.classDef==cd; });
3529
3530 if (it==m_constraintClassList.end())
3531 {
3532 m_constraintClassList.emplace_back(cd);
3533 it = m_constraintClassList.end()-1;
3534 }
3535 (*it).addAccessor(type);
3536 //printf("Adding constraint '%s' to class %s on type %s\n",
3537 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3538 }
3539}
FileDef * getFileDef() const override
Returns the file in which this compound's definition can be found.
ClassDefImpl(const DString &fileName, int startLine, size_t startColumn, const DString &name, CompoundType ct, const DString &ref=DString(), const DString &fName=DString(), bool isSymbol=true, bool isJavaEnum=false)
Definition classdef.cpp:829
ConstraintClassList m_constraintClassList
Definition classdef.cpp:504
virtual void setUsedOnly(bool b)=0
size_t getDefColumn() const override
DString getDefFileName() const override
virtual void setLanguage(SrcLangExt lang)=0
static ClassLinkedMap * hiddenClassLinkedMap
Definition doxygen.h:89

References ClassDef::Class, ClassDefImpl(), Config_getBool, DString::empty(), DefinitionMixin< ClassDefMutable >::getDefColumn(), DefinitionMixin< ClassDefMutable >::getDefFileName(), DefinitionMixin< ClassDefMutable >::getDefLine(), getFileDef(), DefinitionMixin< ClassDefMutable >::getLanguage(), Doxygen::hiddenClassLinkedMap, m_constraintClassList, SymbolResolver::resolveClassMutable(), DefinitionMutable::setLanguage(), ClassDefMutable::setUsedOnly(), and toClassDefMutable().

Referenced by addTypeConstraints().

◆ addTypeConstraints()

void ClassDefImpl::addTypeConstraints ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 3542 of file classdef.cpp.

3543{
3544 for (const Argument &a : m_tempArgs)
3545 {
3546 if (!a.typeConstraint.empty())
3547 {
3548 DString typeConstraint;
3549 size_t i=0,p=0;
3550 while ((i=a.typeConstraint.find('&',p))!=DString::npos) // typeConstraint="A &I" for C<T extends A & I>
3551 {
3552 typeConstraint = a.typeConstraint.mid(p,i-p).stripWhiteSpace();
3553 addTypeConstraint(typeConstraint,a.type);
3554 p=i+1;
3555 }
3556 typeConstraint = a.typeConstraint.mid(p).stripWhiteSpace();
3557 addTypeConstraint(typeConstraint,a.type);
3558 }
3559 }
3560}
void addTypeConstraint(const DString &typeConstraint, const DString &type)
ArgumentList m_tempArgs
Definition classdef.cpp:475
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:318
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:178
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:337

References addTypeConstraint(), m_tempArgs, DString::mid(), DString::npos, and DString::stripWhiteSpace().

◆ addUsedByClass()

void ClassDefImpl::addUsedByClass ( ClassDef * cd,
const DString & accessName,
Protection prot )
overridevirtual

Implements ClassDefMutable.

Definition at line 4297 of file classdef.cpp.

4299{
4300 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4301 bool umlLook = Config_getBool(UML_LOOK);
4302 if (prot==Protection::Private && !extractPrivate) return;
4303 //printf("%s::addUsedByClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4304 //
4305 auto it = std::find_if(m_usedByImplClassList.begin(),
4307 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4308 if (it==m_usedByImplClassList.end())
4309 {
4310 m_usedByImplClassList.emplace_back(cd);
4311 //printf("Adding used by class %s to class %s\n",
4312 // qPrint(cd->name()),qPrint(name()));
4313 it = m_usedByImplClassList.end()-1;
4314 }
4315 DString acc = accessName;
4316 if (umlLook)
4317 {
4318 switch(prot)
4319 {
4320 case Protection::Public: acc.prepend("+"); break;
4321 case Protection::Private: acc.prepend("-"); break;
4322 case Protection::Protected: acc.prepend("#"); break;
4323 case Protection::Package: acc.prepend("~"); break;
4324 }
4325 }
4326 (*it).addAccessor(acc);
4327}
UsesClassList m_usedByImplClassList
Definition classdef.cpp:502
DString & prepend(const char *s)
Definition dstring.h:515

References Config_getBool, m_usedByImplClassList, and DString::prepend().

◆ addUsedClass()

void ClassDefImpl::addUsedClass ( ClassDef * cd,
const DString & accessName,
Protection prot )
overridevirtual

Implements ClassDefMutable.

Definition at line 4265 of file classdef.cpp.

4267{
4268 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4269 bool umlLook = Config_getBool(UML_LOOK);
4270 if (prot==Protection::Private && !extractPrivate) return;
4271 //printf("%s::addUsedClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4272
4273 auto it = std::find_if(m_usesImplClassList.begin(),
4274 m_usesImplClassList.end(),
4275 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4276 if (it==m_usesImplClassList.end())
4277 {
4278 m_usesImplClassList.emplace_back(cd);
4279 //printf("Adding used class %s to class %s via accessor %s\n",
4280 // qPrint(cd->name()),qPrint(name()),accessName);
4281 it = m_usesImplClassList.end()-1;
4282 }
4283 DString acc = accessName;
4284 if (umlLook)
4285 {
4286 switch(prot)
4287 {
4288 case Protection::Public: acc.prepend("+"); break;
4289 case Protection::Private: acc.prepend("-"); break;
4290 case Protection::Protected: acc.prepend("#"); break;
4291 case Protection::Package: acc.prepend("~"); break;
4292 }
4293 }
4294 (*it).addAccessor(acc);
4295}
UsesClassList m_usesImplClassList
Definition classdef.cpp:501

References Config_getBool, m_usesImplClassList, and DString::prepend().

◆ addUsedInterfaceClasses()

void ClassDefImpl::addUsedInterfaceClasses ( MemberDef * md,
const DString & typeStr )
private

References anchor(), and title().

◆ anchor()

DString ClassDefImpl::anchor ( ) const
overridevirtual

Returns the anchor within a page where this item can be found

Implements Definition.

Definition at line 5335 of file classdef.cpp.

5336{
5337 DString anc;
5339 {
5341 {
5342 // point to the template of which this class is an instance
5344 }
5345 else
5346 {
5347 anc = m_fileName;
5348 }
5349 }
5350 return anc;
5351}
bool m_implicitTemplateInstance
Definition classdef.cpp:579
bool isEmbeddedInOuterScope() const override
virtual DString getOutputFileBase() const =0
static bool generatingXmlOutput
Definition doxygen.h:127

References Doxygen::generatingXmlOutput, Definition::getOutputFileBase(), isEmbeddedInOuterScope(), m_fileName, m_implicitTemplateInstance, and m_templateMaster.

Referenced by addExample(), addUsedInterfaceClasses(), writeBriefDescription(), writeDeclarationLink(), writeDetailedDescription(), writeInlineDocumentation(), writeMemberList(), writeMoreLink(), and writeTagFile().

◆ baseClasses()

const BaseClassList & ClassDefImpl::baseClasses ( ) const
overridevirtual

Returns the list of base classes from which this class directly inherits.

Implements ClassDef.

Definition at line 5085 of file classdef.cpp.

5086{
5087 return m_inherits;
5088}
BaseClassList m_inherits
Definition classdef.cpp:454

References m_inherits.

Referenced by isBaseClass(), mergeMembers(), and mergeMembersFromBaseClasses().

◆ categoryOf()

ClassDef * ClassDefImpl::categoryOf ( ) const
overridevirtual

Returns the class of which this is a category (Objective-C only).

Implements ClassDef.

Definition at line 5240 of file classdef.cpp.

5241{
5242 return m_categoryOf;
5243}

References m_categoryOf.

◆ className()

DString ClassDefImpl::className ( ) const
overridevirtual

Returns the name of the class including outer classes, but not including namespaces.

Implements ClassDef.

Definition at line 4606 of file classdef.cpp.

4607{
4608 DString name = m_className.empty() ? localName() : m_className;
4609 auto lang = getLanguage();
4610 if (lang==SrcLangExt::CSharp)
4611 {
4613 }
4614 return name;
4615}
DString m_className
Definition classdef.cpp:517
const DString & localName() const override
DString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:908
DString demangleCSharpGenericName(const DString &name, const DString &templArgs)
Definition util.cpp:5503

References demangleCSharpGenericName(), DString::empty(), DefinitionMixin< ClassDefMutable >::getLanguage(), DefinitionMixin< ClassDefMutable >::localName(), m_className, DefinitionMixin< ClassDefMutable >::name(), tempArgListToString(), and templateArguments().

◆ codeSymbolType()

CodeSymbolType ClassDefImpl::codeSymbolType ( ) const
overridevirtual

Used for syntax highlighting symbol class

Implements Definition.

Definition at line 5529 of file classdef.cpp.

5530{
5531 switch (compoundType())
5532 {
5533 case Class: return CodeSymbolType::Class; break;
5534 case Struct: return CodeSymbolType::Struct; break;
5535 case Record: return CodeSymbolType::Record; break;
5536 case Union: return CodeSymbolType::Union; break;
5537 case Interface: return CodeSymbolType::Interface; break;
5538 case Protocol: return CodeSymbolType::Protocol; break;
5539 case Category: return CodeSymbolType::Category; break;
5540 case Exception: return CodeSymbolType::Exception; break;
5541 case Service: return CodeSymbolType::Service; break;
5542 case Singleton: return CodeSymbolType::Singleton; break;
5543 }
5544 return CodeSymbolType::Class;
5545}
@ Singleton
Definition classdef.h:114
@ Interface
Definition classdef.h:109
@ Exception
Definition classdef.h:112

References ClassDef::Category, Category, ClassDef::Class, Class, compoundType(), ClassDef::Exception, Exception, ClassDef::Interface, Interface, ClassDef::Protocol, Protocol, ClassDef::Record, Record, ClassDef::Service, Service, ClassDef::Singleton, Singleton, ClassDef::Struct, Struct, ClassDef::Union, and Union.

◆ collaborationGraphFileName()

DString ClassDefImpl::collaborationGraphFileName ( ) const
overridevirtual

returns the file name to use for the collaboration graph

Implements ClassDef.

Definition at line 5509 of file classdef.cpp.

5510{
5511 return m_collabFileName;
5512}

References m_collabFileName.

◆ compoundType()

ClassDefImpl::CompoundType ClassDefImpl::compoundType ( ) const
overridevirtual

Returns the type of compound this is, i.e. class/struct/union/...

Implements ClassDef.

Definition at line 5080 of file classdef.cpp.

5081{
5082 return m_compType;
5083}

References m_compType.

Referenced by addListReferences(), codeSymbolType(), deepCopy(), writeDeclarationLink(), writeDocumentation(), and writeMemberList().

◆ compoundTypeString()

DString ClassDefImpl::compoundTypeString ( ) const
overridevirtual

◆ computeAnchors()

void ClassDefImpl::computeAnchors ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 1396 of file classdef.cpp.

1397{
1398 for (auto &ml : m_memberLists)
1399 {
1400 if (!ml->listType().isDetailed())
1401 {
1402 ml->setAnchors();
1403 }
1404 }
1405
1406 for (const auto &mg : m_memberGroups)
1407 {
1408 mg->setAnchors();
1409 }
1410}

References m_memberGroups, and m_memberLists.

◆ containsOverload()

bool ClassDefImpl::containsOverload ( const MemberDef * md) const
overridevirtual

Implements ClassDef.

Definition at line 5443 of file classdef.cpp.

5444{
5445 AUTO_TRACE("name={}",md->name());
5446 const auto &mni = m_allMemberNameInfoLinkedMap.find(md->name());
5447 if (mni)
5448 {
5449 for (const auto &mi : *mni)
5450 {
5451 const MemberDef *classMd = mi->memberDef();
5452 const ArgumentList &classAl = classMd->argumentList();
5453 const ArgumentList &al = md->argumentList();
5454 bool found = matchArguments2(
5455 classMd->getOuterScope(),classMd->getFileDef(),classMd->typeString(),&classAl,
5456 md->getOuterScope(),md->getFileDef(),md->typeString(),&al,
5457 true,getLanguage()
5458 );
5459 if (found)
5460 {
5461 AUTO_TRACE_EXIT("true");
5462 return true;
5463 }
5464 }
5465 }
5466 AUTO_TRACE_EXIT("false");
5467 return false;
5468}
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual Definition * getOuterScope() const =0
virtual const FileDef * getFileDef() const =0
virtual const ArgumentList & argumentList() const =0
virtual DString typeString() const =0
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const DString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const DString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang, bool allowUnresolved)
Definition util.cpp:1649

References MemberDef::argumentList(), AUTO_TRACE, AUTO_TRACE_EXIT, LinkedMap< T, Hash, KeyEqual, Map >::find(), MemberDef::getFileDef(), DefinitionMixin< ClassDefMutable >::getLanguage(), Definition::getOuterScope(), m_allMemberNameInfoLinkedMap, matchArguments2(), Definition::name(), and MemberDef::typeString().

◆ countAdditionalInheritedMembers()

int ClassDefImpl::countAdditionalInheritedMembers ( ) const
private

Definition at line 4880 of file classdef.cpp.

4881{
4882 int totalCount=0;
4883 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4884 {
4885 if (lde->kind()==LayoutDocEntry::MemberDecl)
4886 {
4887 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4888 if (lmd && lmd->type!=MemberListType::Friends()) // friendship is not inherited
4889 {
4890 ClassDefSet visited;
4891 totalCount+=countInheritedDecMembers(lmd->type,this,true,false,visited);
4892 }
4893 }
4894 }
4895 //printf("countAdditionalInheritedMembers()=%d\n",totalCount);
4896 return totalCount;
4897}
int countInheritedDecMembers(MemberListType lt, const ClassDef *inheritedFrom, bool invert, bool showAlways, ClassDefSet &visitedClasses) const
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1476
std::unordered_set< const ClassDef * > ClassDefSet
Definition classdef.h:91
MemberListType type
Definition layout.h:118

References countInheritedDecMembers(), LayoutDocManager::instance(), and LayoutDocEntryMemberDecl::type.

Referenced by endMemberDeclarations().

◆ countInheritanceNodes()

int ClassDefImpl::countInheritanceNodes ( ) const
private

Definition at line 1878 of file classdef.cpp.

1879{
1881}
int countInheritsNodes() const
int countInheritedByNodes() const

References countInheritedByNodes(), and countInheritsNodes().

Referenced by writeInheritanceGraph().

◆ countInheritedByNodes()

int ClassDefImpl::countInheritedByNodes ( ) const
private

Definition at line 1856 of file classdef.cpp.

1857{
1858 int count=0;
1859 for (const auto &ibcd : m_inheritedBy)
1860 {
1861 const ClassDef *icd=ibcd.classDef;
1862 if ( icd->isVisibleInHierarchy()) count++;
1863 }
1864 return count;
1865}
virtual bool isVisibleInHierarchy() const =0
the class is visible in a class diagram, or class hierarchy
BaseClassList m_inheritedBy
Definition classdef.cpp:458

References ClassDef::isVisibleInHierarchy(), and m_inheritedBy.

Referenced by countInheritanceNodes(), and writeInheritanceGraph().

◆ countInheritedDecMembers()

int ClassDefImpl::countInheritedDecMembers ( MemberListType lt,
const ClassDef * inheritedFrom,
bool invert,
bool showAlways,
ClassDefSet & visitedClasses ) const
private

Definition at line 4823 of file classdef.cpp.

4826{
4827 int inhCount = 0;
4828 int count = countMembersIncludingGrouped(lt,inheritedFrom,false);
4829 bool process = count>0;
4830 //printf("%s: countInheritedDecMembers: lt=%s process=%d count=%d invert=%d\n",
4831 // qPrint(name()),lt.to_string(),process,count,invert);
4832 if ((process^invert) || showAlways)
4833 {
4834 for (const auto &ibcd : m_inherits)
4835 {
4836 ClassDefMutable *icd = toClassDefMutable(ibcd.classDef);
4837 MemberListType lt1 = MemberListType::Invalid();
4838 MemberListType lt2 = MemberListType::Invalid();
4839 if (icd && icd->isLinkable())
4840 {
4841 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt2);
4842 //printf("%s: convert %s->(%s,%s) prot=%d\n",
4843 // qPrint(icd->name()),lt.to_string(),lt1.to_string(),lt2.to_string(),ibcd.prot);
4844 if (visitedClasses.find(icd)==visitedClasses.end())
4845 {
4846 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4847 if (!lt1.isInvalid())
4848 {
4849 inhCount+=icd->countMemberDeclarations(lt1,inheritedFrom,lt2,false,true,visitedClasses);
4850 }
4851 }
4852 }
4853 }
4854 }
4855 //printf("%s: count=%d\n",qPrint(name()),inhCount);
4856 return inhCount;
4857}
virtual int countMemberDeclarations(MemberListType lt, const ClassDef *inheritedFrom, MemberListType lt2, bool invert, bool showAlways, ClassDefSet &visitedClasses) const =0
int countMembersIncludingGrouped(MemberListType lt, const ClassDef *inheritedFrom, bool additional) const override
virtual bool isLinkable() const =0
constexpr bool isInvalid() const noexcept
Definition types.h:372
static constexpr MemberListType Invalid() noexcept
Definition types.h:371
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:5040

References convertProtectionLevel(), ClassDef::countMemberDeclarations(), countMembersIncludingGrouped(), MemberListType::Invalid(), MemberListType::isInvalid(), Definition::isLinkable(), m_inherits, and toClassDefMutable().

Referenced by countAdditionalInheritedMembers(), and countMemberDeclarations().

◆ countInheritsNodes()

int ClassDefImpl::countInheritsNodes ( ) const
private

Definition at line 1867 of file classdef.cpp.

1868{
1869 int count=0;
1870 for (const auto &ibcd : m_inherits)
1871 {
1872 const ClassDef *icd=ibcd.classDef;
1873 if ( icd->isVisibleInHierarchy()) count++;
1874 }
1875 return count;
1876}

References ClassDef::isVisibleInHierarchy(), and m_inherits.

Referenced by countInheritanceNodes(), and writeInheritanceGraph().

◆ countMemberDeclarations()

int ClassDefImpl::countMemberDeclarations ( MemberListType lt,
const ClassDef * inheritedFrom,
MemberListType lt2,
bool invert,
bool showAlways,
ClassDefSet & visitedClasses ) const
overridevirtual

Implements ClassDef.

Definition at line 4745 of file classdef.cpp.

4747{
4748 //printf("%s: countMemberDeclarations for %s and %s\n",qPrint(name()),lt.to_string(),lt2.to_string());
4749 int count=0;
4750 MemberList * ml = getMemberList(lt);
4751 MemberList * ml2 = getMemberList(lt2);
4752 if (getLanguage()!=SrcLangExt::VHDL) // use specific declarations function
4753 {
4754 if (ml)
4755 {
4756 count+=ml->numDecMembers(inheritedFrom);
4757 //printf("-> ml=%d\n",ml->numDecMembers());
4758 }
4759 if (ml2)
4760 {
4761 count+=ml2->numDecMembers(inheritedFrom);
4762 //printf("-> ml2=%d\n",ml2->numDecMembers());
4763 }
4764 // also include grouped members that have their own section in the class (see bug 722759)
4765 if (inheritedFrom)
4766 {
4767 for (const auto &mg : m_memberGroups)
4768 {
4769 count+=mg->countGroupedInheritedMembers(lt);
4770 if (!lt2.isInvalid()) count+=mg->countGroupedInheritedMembers(lt2);
4771 }
4772 }
4773 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4774 if (!inlineInheritedMembers) // show inherited members as separate lists
4775 {
4776 count+=countInheritedDecMembers(lt,inheritedFrom,invert,showAlways,visitedClasses);
4777 }
4778 }
4779 //printf("-> %d\n",count);
4780 return count;
4781}
MemberList * getMemberList(MemberListType lt) const override
Returns the members in the list identified by lt.
int numDecMembers(const ClassDef *inheritedFrom) const
Definition memberlist.h:134

References Config_getBool, countInheritedDecMembers(), DefinitionMixin< ClassDefMutable >::getLanguage(), getMemberList(), MemberListType::isInvalid(), m_memberGroups, and MemberList::numDecMembers().

◆ countMembers()

void ClassDefImpl::countMembers ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 4809 of file classdef.cpp.

4810{
4811 for (auto &ml : m_memberLists)
4812 {
4813 ml->countDecMembers();
4814 ml->countDocMembers();
4815 }
4816 for (const auto &mg : m_memberGroups)
4817 {
4818 mg->countDecMembers();
4819 mg->countDocMembers();
4820 }
4821}

References m_memberGroups, and m_memberLists.

◆ countMembersIncludingGrouped()

int ClassDefImpl::countMembersIncludingGrouped ( MemberListType lt,
const ClassDef * inheritedFrom,
bool additional ) const
overridevirtual

Implements ClassDef.

Definition at line 4916 of file classdef.cpp.

4918{
4919 int count=0;
4920 MemberList *ml = getMemberList(lt);
4921 if (ml)
4922 {
4923 count=ml->countInheritableMembers(inheritedFrom);
4924 }
4925 //printf("%s:countMembersIncludingGrouped: count=%d\n",qPrint(name()),count);
4926 for (const auto &mg : m_memberGroups)
4927 {
4928 bool hasOwnSection = !mg->allMembersInSameSection() ||
4929 !m_subGrouping; // group is in its own section
4930 if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
4931 {
4932 count+=mg->countGroupedInheritedMembers(lt);
4933 }
4934 }
4935 //printf("%s:countMembersIncludingGrouped(lt=%s,%s)=%d\n",
4936 // qPrint(name()),qPrint(lt.to_string()),ml?qPrint(ml->listType().to_string()):"<none>",count);
4937 return count;
4938}
int countInheritableMembers(const ClassDef *inheritedFrom) const

References MemberList::countInheritableMembers(), getMemberList(), m_memberGroups, and m_subGrouping.

Referenced by countInheritedDecMembers(), and writeInheritedMemberDeclarations().

◆ deepCopy()

std::unique_ptr< ClassDef > ClassDefImpl::deepCopy ( const DString & name) const
overridevirtual

Implements ClassDef.

Definition at line 892 of file classdef.cpp.

893{
894 AUTO_TRACE("name='{}'",name);
895 auto result = std::make_unique<ClassDefImpl>(
897 std::string(),std::string(),true,m_isJavaEnum);
898 result->setBriefDescription(briefDescription(),briefFile(),briefLine());
899 result->setDocumentation(documentation(),docFile(),docLine());
900 result->setInbodyDocumentation(inbodyDocumentation(),inbodyFile(),inbodyLine());
901 result->setBodySegment(getStartDefLine(),getStartBodyLine(),getEndBodyLine());
902 result->setBodyDef(getBodyDef());
903 result->setLanguage(getLanguage());
904
905 // copy other members
906 result->m_memberListFileName = m_memberListFileName;
907 result->m_collabFileName = m_collabFileName;
908 result->m_inheritFileName = m_inheritFileName;
909 if (m_incInfo)
910 {
911 result->m_incInfo = std::make_unique<IncludeInfo>();
912 *(result->m_incInfo) = *m_incInfo;
913 }
914 result->m_inherits = m_inherits;
915 result->m_inheritedBy = m_inheritedBy;
916 result->m_fileDef = m_fileDef;
917 result->m_moduleDef = m_moduleDef;
918 result->m_tempArgs = m_tempArgs;
919 result->m_typeConstraints = m_typeConstraints;
920 result->m_files = m_files;
921 result->m_examples = m_examples;
922 result->m_compType = m_compType;
923 result->m_prot = m_prot;
924 result->m_usesImplClassList = m_usesImplClassList;
925 result->m_usedByImplClassList = m_usedByImplClassList;
926 result->m_constraintClassList = m_constraintClassList;
927 result->m_templateInstances = m_templateInstances;
928 result->m_templBaseClassNames = m_templBaseClassNames;
929 result->m_templateMaster = m_templateMaster;
930 result->m_className = m_className;
931 result->m_categoryOf = m_categoryOf;
932 result->m_isAbstract = m_isAbstract;
933 result->m_isStatic = m_isStatic;
934 result->m_membersMerged = m_membersMerged;
935 result->m_isLocal = m_isLocal;
936 result->m_isTemplArg = m_isTemplArg;
937 result->m_subGrouping = m_subGrouping;
938 result->m_usedOnly = m_usedOnly;
939 result->m_vhdlSummaryTitles = m_vhdlSummaryTitles;
940 result->m_isSimple = m_isSimple;
941 result->m_arrowOperator = m_arrowOperator;
942 result->m_taglessParent = m_taglessParent;
943 result->m_hasNamedVariable = m_hasNamedVariable;
944 result->m_isJavaEnum = m_isJavaEnum;
945 result->m_spec = m_spec;
946 result->m_metaData = m_metaData;
947 result->m_requiresClause = m_requiresClause;
948 result->m_qualifiers = m_qualifiers;
949 result->m_hasCollaborationGraph = m_hasCollaborationGraph;
950 result->m_typeInheritanceGraph = m_typeInheritanceGraph;
951
952 // set new file name
953 DString compTypeString = getCompoundTypeString(getLanguage(),m_compType,m_isJavaEnum);
954 result->m_fileName = compTypeString+name;
955 result->m_memberListFileName = convertNameToFile(compTypeString+name+"-members");
956 result->m_collabFileName = convertNameToFile(result->m_fileName+"_coll_graph");
957 result->m_inheritFileName = convertNameToFile(result->m_fileName+"_inherit_graph");
958 result->m_fileName = convertNameToFile(result->m_fileName);
959
960 // deep copy nested classes
961 for (const auto &innerCd : m_innerClasses)
962 {
963 DString innerName = name+"::"+innerCd->localName();
964 if (Doxygen::classLinkedMap->find(innerName)==nullptr)
965 {
966 auto cd = Doxygen::classLinkedMap->add(innerName,innerCd->deepCopy(innerName));
967 result->addInnerCompound(cd);
968 ClassDefMutable *cdm = toClassDefMutable(cd);
969 if (cdm)
970 {
971 cdm->setOuterScope(result.get());
972 }
973 }
974 }
975
976 // copy all member list (and make deep copies of members)
977 for (auto &mni : m_allMemberNameInfoLinkedMap)
978 {
979 for (auto &mi : *mni)
980 {
981 const MemberDef *md=mi->memberDef();
982 auto newMd = md->deepCopy();
983 if (newMd)
984 {
985 AUTO_TRACE_ADD("Copying member {}",newMd->name());
986 auto mmd = toMemberDefMutable(newMd.get());
987 if (mmd)
988 {
989 mmd->moveTo(result.get());
990 }
991
992 result->internalInsertMember(newMd.get(),newMd->protection(),true);
993
994 // also add to the global list (which will own newMd)
995 MemberName *mn = Doxygen::memberNameLinkedMap->add(newMd->name());
996 mn->push_back(std::move(newMd));
997 }
998 }
999 }
1000
1001 return result;
1002}
TemplateInstanceList m_templateInstances
Definition classdef.cpp:509
ArgumentList m_typeConstraints
Definition classdef.cpp:478
StringSet m_vhdlSummaryTitles
List of titles to use for the summary.
Definition classdef.cpp:553
FileList m_files
Definition classdef.cpp:481
TemplateNameMap m_templBaseClassNames
Definition classdef.cpp:511
std::unique_ptr< IncludeInfo > m_incInfo
Definition classdef.cpp:449
DString m_metaData
Definition classdef.cpp:569
DString m_requiresClause
C++20 requires clause.
Definition classdef.cpp:572
DString docFile() const override
DString briefFile() const override
DString briefDescription(bool abbreviate=false) const override
DString inbodyFile() const override
DString documentation() const override
const FileDef * getBodyDef() const override
DString inbodyDocumentation() const override
int getStartBodyLine() const override
virtual void setOuterScope(Definition *d)=0
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:88
virtual std::unique_ptr< MemberDef > deepCopy() const =0
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:54

References LinkedMap< T, Hash, KeyEqual, Map >::add(), AUTO_TRACE, AUTO_TRACE_ADD, DefinitionMixin< ClassDefMutable >::briefDescription(), DefinitionMixin< ClassDefMutable >::briefFile(), DefinitionMixin< ClassDefMutable >::briefLine(), Doxygen::classLinkedMap, compoundType(), convertNameToFile(), MemberDef::deepCopy(), DefinitionMixin< ClassDefMutable >::docFile(), DefinitionMixin< ClassDefMutable >::docLine(), DefinitionMixin< ClassDefMutable >::documentation(), DefinitionMixin< ClassDefMutable >::getBodyDef(), getCompoundTypeString(), DefinitionMixin< ClassDefMutable >::getDefColumn(), DefinitionMixin< ClassDefMutable >::getDefFileName(), DefinitionMixin< ClassDefMutable >::getDefLine(), DefinitionMixin< ClassDefMutable >::getEndBodyLine(), DefinitionMixin< ClassDefMutable >::getLanguage(), DefinitionMixin< ClassDefMutable >::getStartBodyLine(), DefinitionMixin< ClassDefMutable >::getStartDefLine(), DefinitionMixin< ClassDefMutable >::inbodyDocumentation(), DefinitionMixin< ClassDefMutable >::inbodyFile(), DefinitionMixin< ClassDefMutable >::inbodyLine(), m_allMemberNameInfoLinkedMap, m_arrowOperator, m_categoryOf, m_className, m_collabFileName, m_compType, m_constraintClassList, m_examples, m_fileDef, m_files, m_hasCollaborationGraph, m_hasNamedVariable, m_incInfo, m_inheritedBy, m_inheritFileName, m_inherits, m_innerClasses, m_isAbstract, m_isJavaEnum, m_isLocal, m_isSimple, m_isStatic, m_isTemplArg, m_memberListFileName, m_membersMerged, m_metaData, m_moduleDef, m_prot, m_qualifiers, m_requiresClause, m_spec, m_subGrouping, m_taglessParent, m_tempArgs, m_templateInstances, m_templateMaster, m_templBaseClassNames, m_typeConstraints, m_typeInheritanceGraph, m_usedByImplClassList, m_usedOnly, m_usesImplClassList, m_vhdlSummaryTitles, Doxygen::memberNameLinkedMap, DefinitionMixin< ClassDefMutable >::name(), MemberName::push_back(), DefinitionMutable::setOuterScope(), toClassDefMutable(), and toMemberDefMutable().

◆ definitionType()

DefType ClassDefImpl::definitionType ( ) const
inlineoverridevirtual

Use this for dynamic inspection of the type of the derived class

Implements Definition.

Definition at line 209 of file classdef.cpp.

209{ return TypeClass; }

References Definition::TypeClass.

◆ displayName()

DString ClassDefImpl::displayName ( bool includeScope = true) const
overridevirtual

Returns the name of the definition as it appears in the output

Implements Definition.

Definition at line 1023 of file classdef.cpp.

1024{
1025 return makeDisplayName(this,includeScope);
1026}
static DString makeDisplayName(const ClassDef *cd, bool includeScope)
Definition classdef.cpp:111

References makeDisplayName().

Referenced by addListReferences(), title(), writeCollaborationGraph(), writeDeclarationLink(), writeDocumentation(), writeInheritanceGraph(), writeMemberDocumentation(), writeMemberList(), writeMemberPages(), and writeTagFile().

◆ distributeMemberGroupDocumentation()

void ClassDefImpl::distributeMemberGroupDocumentation ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 1412 of file classdef.cpp.

1413{
1414 for (const auto &mg : m_memberGroups)
1415 {
1416 mg->distributeMemberGroupDocumentation();
1417 }
1418}

References m_memberGroups.

◆ endMemberDeclarations()

void ClassDefImpl::endMemberDeclarations ( OutputList & ol) const
private

Definition at line 2277 of file classdef.cpp.

2278{
2279 //printf("%s: ClassDefImpl::endMemberDeclarations()\n",qPrint(name()));
2280 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
2281 if (!inlineInheritedMembers && countAdditionalInheritedMembers()>0)
2282 {
2283 ol.startMemberHeader("inherited");
2285 ol.endMemberHeader();
2287 }
2288 ol.endMemberSections();
2289}
int countAdditionalInheritedMembers() const
void writeAdditionalInheritedMembers(OutputList &ol) const
void parseText(const DString &textStr)
void startMemberHeader(const DString &anchor, int typ=2)
Definition outputlist.h:465
void endMemberHeader()
Definition outputlist.h:467
void endMemberSections()
Definition outputlist.h:459
virtual DString trAdditionalInheritedMembers()=0

References Config_getBool, countAdditionalInheritedMembers(), OutputList::endMemberHeader(), OutputList::endMemberSections(), OutputList::parseText(), OutputList::startMemberHeader(), theTranslator, Translator::trAdditionalInheritedMembers(), and writeAdditionalInheritedMembers().

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ endMemberDocumentation()

void ClassDefImpl::endMemberDocumentation ( OutputList & ol) const
private

Definition at line 2261 of file classdef.cpp.

2262{
2263 //printf("%s: ClassDefImpl::endMemberDocumentation()\n",qPrint(name()));
2264 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2265 {
2268 }
2269}
static bool suppressDocWarnings
Definition doxygen.h:123
void enable(OutputType o)

References Config_getBool, OutputList::enable(), Html, and Doxygen::suppressDocWarnings.

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ findInnerCompound()

const Definition * ClassDefImpl::findInnerCompound ( const DString & name) const
overridevirtual

◆ findSectionsInDocumentation()

void ClassDefImpl::findSectionsInDocumentation ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 1420 of file classdef.cpp.

1421{
1425 for (const auto &mg : m_memberGroups)
1426 {
1427 mg->findSectionsInDocumentation(this);
1428 }
1429 for (auto &ml : m_memberLists)
1430 {
1431 if (!ml->listType().isDetailed())
1432 {
1433 ml->findSectionsInDocumentation(this);
1434 }
1435 }
1436}
void docFindSections(const DString &input, const Definition *d, const DString &fileName)

References DefinitionMixin< ClassDefMutable >::briefDescription(), DefinitionMixin< ClassDefMutable >::docFile(), docFindSections(), DefinitionMixin< ClassDefMutable >::documentation(), DefinitionMixin< ClassDefMutable >::inbodyDocumentation(), m_memberGroups, and m_memberLists.

◆ generatedFromFiles()

DString ClassDefImpl::generatedFromFiles ( ) const
overridevirtual

Implements ClassDef.

Definition at line 1746 of file classdef.cpp.

1747{
1748 DString result;
1749 SrcLangExt lang = getLanguage();
1750 size_t numFiles = m_files.size();
1751 if (lang==SrcLangExt::Fortran)
1752 {
1754 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1755 numFiles==1);
1756 }
1757 else if (isJavaEnum())
1758 {
1759 result = theTranslator->trEnumGeneratedFromFiles(numFiles==1);
1760 }
1761 else if (m_compType==Service)
1762 {
1763 result = theTranslator->trServiceGeneratedFromFiles(numFiles==1);
1764 }
1765 else if (m_compType==Singleton)
1766 {
1767 result = theTranslator->trSingletonGeneratedFromFiles(numFiles==1);
1768 }
1769 else
1770 {
1772 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1773 numFiles==1);
1774 }
1775 return result;
1776}
virtual DString trServiceGeneratedFromFiles(bool single)=0
virtual DString trEnumGeneratedFromFiles(bool single)=0
virtual DString trGeneratedFromFiles(ClassDef::CompoundType compType, bool single)=0
virtual DString trGeneratedFromFilesFortran(ClassDef::CompoundType compType, bool single)=0
virtual DString trSingletonGeneratedFromFiles(bool single)=0

References ClassDef::Class, DefinitionMixin< ClassDefMutable >::getLanguage(), ClassDef::Interface, isJavaEnum(), m_compType, m_files, ClassDef::Service, ClassDef::Singleton, theTranslator, Translator::trEnumGeneratedFromFiles(), Translator::trGeneratedFromFiles(), Translator::trGeneratedFromFilesFortran(), Translator::trServiceGeneratedFromFiles(), and Translator::trSingletonGeneratedFromFiles().

Referenced by showUsedFiles().

◆ getClasses()

ClassLinkedRefMap ClassDefImpl::getClasses ( ) const
overridevirtual

returns the classes nested into this class

Implements ClassDef.

Definition at line 5075 of file classdef.cpp.

5076{
5077 return m_innerClasses;
5078}

References m_innerClasses.

◆ getExamples()

const ExampleList & ClassDefImpl::getExamples ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5489 of file classdef.cpp.

5490{
5491 return m_examples;
5492}

References m_examples.

◆ getFileDef()

FileDef * ClassDefImpl::getFileDef ( ) const
overridevirtual

Returns the file in which this compound's definition can be found.

Should not return 0 (but it might be a good idea to check anyway).

Implements ClassDef.

Definition at line 5130 of file classdef.cpp.

5131{
5132 return m_fileDef;
5133}

References m_fileDef.

Referenced by addTypeConstraint(), getOutputFileBase(), isEmbeddedInOuterScope(), and writeTemplateSpec().

◆ getInstanceOutputFileBase()

DString ClassDefImpl::getInstanceOutputFileBase ( ) const
overridevirtual

Implements ClassDef.

Definition at line 4373 of file classdef.cpp.

4374{
4375 return m_fileName;
4376}

References m_fileName.

◆ getMemberByName()

const MemberDef * ClassDefImpl::getMemberByName ( const DString & ) const
overridevirtual

Returns the member with the given name.

Implements ClassDef.

Definition at line 4664 of file classdef.cpp.

4665{
4666 const MemberDef *xmd = nullptr;
4667 const MemberNameInfo *mni = m_allMemberNameInfoLinkedMap.find(name);
4668 if (mni)
4669 {
4670 const int maxInheritanceDepth = 100000;
4671 int mdist=maxInheritanceDepth;
4672 for (auto &mi : *mni)
4673 {
4674 const ClassDef *mcd=mi->memberDef()->getClassDef();
4675 int m=minClassDistance(this,mcd);
4676 //printf("found member in %s linkable=%d m=%d\n",
4677 // qPrint(mcd->name()),mcd->isLinkable(),m);
4678 if (m<mdist)
4679 {
4680 mdist=m;
4681 xmd=mi->memberDef();
4682 }
4683 }
4684 }
4685 //printf("getMemberByName(%s)=%p\n",qPrint(name),xmd);
4686 return xmd;
4687}
int minClassDistance(const ClassDef *cd, const ClassDef *bcd, int level)

References LinkedMap< T, Hash, KeyEqual, Map >::find(), m_allMemberNameInfoLinkedMap, minClassDistance(), and DefinitionMixin< ClassDefMutable >::name().

◆ getMemberGroups()

const MemberGroupList & ClassDefImpl::getMemberGroups ( ) const
overridevirtual

Returns the member groups defined for this class.

Implements ClassDef.

Definition at line 5250 of file classdef.cpp.

5251{
5252 return m_memberGroups;
5253}

References m_memberGroups.

◆ getMemberList()

MemberList * ClassDefImpl::getMemberList ( MemberListType lt) const
overridevirtual

Returns the members in the list identified by lt.

Implements ClassDef.

Definition at line 4694 of file classdef.cpp.

4695{
4696 for (auto &ml : m_memberLists)
4697 {
4698 if (ml->listType()==lt)
4699 {
4700 return ml.get();
4701 }
4702 }
4703 return nullptr;
4704}

References m_memberLists.

Referenced by countMemberDeclarations(), countMembersIncludingGrouped(), setAnonymousEnumType(), writeMemberDeclarations(), writeMemberDocumentation(), writePlainMemberDeclaration(), writeSimpleMemberDocumentation(), writeSummaryLinks(), and writeTagFile().

◆ getMemberListFileName()

DString ClassDefImpl::getMemberListFileName ( ) const
overridevirtual

Implements ClassDef.

Definition at line 1018 of file classdef.cpp.

1019{
1020 return m_memberListFileName;
1021}

References m_memberListFileName.

Referenced by writeDocumentation(), writeMemberList(), and writeSummaryLinks().

◆ getMemberLists()

const MemberLists & ClassDefImpl::getMemberLists ( ) const
overridevirtual

Returns the list containing the list of members sorted per type.

Implements ClassDef.

Definition at line 5245 of file classdef.cpp.

5246{
5247 return m_memberLists;
5248}

References m_memberLists.

◆ getModuleDef()

ModuleDef * ClassDefImpl::getModuleDef ( ) const
overridevirtual

Returns the C++20 module in which this compound's definition can be found.

Implements ClassDef.

Definition at line 5135 of file classdef.cpp.

5136{
5137 return m_moduleDef;
5138}

References m_moduleDef.

◆ getOutputFileBase()

DString ClassDefImpl::getOutputFileBase ( ) const
overridevirtual

Returns the base file name (without extension) of this definition. as it is referenced to/written to disk.

Implements Definition.

Definition at line 4335 of file classdef.cpp.

4336{
4337 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
4338 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
4340 {
4341 Definition *scope=nullptr;
4342 if (inlineGroupedClasses && !partOfGroups().empty())
4343 {
4344 // point to the group that embeds this class
4345 return partOfGroups().front()->getOutputFileBase();
4346 }
4347 else if (inlineSimpleClasses && m_isSimple && !partOfGroups().empty())
4348 {
4349 // point to simple struct inside a group
4350 return partOfGroups().front()->getOutputFileBase();
4351 }
4352 else if (inlineSimpleClasses && m_isSimple && (scope=getOuterScope()))
4353 {
4354 if (scope==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) // simple struct embedded in file
4355 {
4356 return getFileDef()->getOutputFileBase();
4357 }
4358 else if (scope->isLinkableInProject()) // simple struct embedded in other container (namespace/group/class)
4359 {
4360 return getOuterScope()->getOutputFileBase();
4361 }
4362 }
4363 }
4364 AUTO_TRACE("name='{}' m_templateMaster={} m_implicitTemplateInstance={}",name(),(void*)m_templateMaster,m_implicitTemplateInstance);
4366 {
4367 // point to the template of which this class is an instance
4369 }
4370 return m_fileName;
4371}
virtual bool isLinkableInProject() const =0
Definition * getOuterScope() const override
const GroupList & partOfGroups() const override
static NamespaceDefMutable * globalScope
Definition doxygen.h:114

References AUTO_TRACE, Config_getBool, Doxygen::generatingXmlOutput, getFileDef(), DefinitionMixin< ClassDefMutable >::getOuterScope(), Definition::getOutputFileBase(), Doxygen::globalScope, isLinkableInProject(), Definition::isLinkableInProject(), m_fileName, m_implicitTemplateInstance, m_isSimple, m_templateMaster, DefinitionMixin< ClassDefMutable >::name(), and DefinitionMixin< ClassDefMutable >::partOfGroups().

Referenced by addListReferences(), writeDeclarationLink(), writeDetailedDescription(), writeDocumentation(), writeInheritanceGraph(), writeInlineDocumentation(), writeMemberList(), writeMoreLink(), and writeTagFile().

◆ getQualifiers()

StringVector ClassDefImpl::getQualifiers ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5438 of file classdef.cpp.

5439{
5440 return m_qualifiers;
5441}

References m_qualifiers.

◆ getReference()

DString ClassDefImpl::getReference ( ) const
overridevirtual

If this definition was imported via a tag file, this function returns the tagfile for the external project. This can be translated into an external link target via Doxygen::tagDestinationDict

Implements Definition.

Definition at line 4560 of file classdef.cpp.

4561{
4563 {
4565 }
4566 else
4567 {
4569 }
4570}
virtual DString getReference() const =0
DString getReference() const override

References Definition::getReference(), DefinitionMixin< Base >::getReference(), m_implicitTemplateInstance, and m_templateMaster.

Referenced by writeDeclarationLink(), and writeMemberList().

◆ getSourceFileBase()

DString ClassDefImpl::getSourceFileBase ( ) const
overridevirtual

Returns the name of the source listing of this definition.

Implements Definition.

Definition at line 4378 of file classdef.cpp.

4379{
4381 {
4383 }
4384 else
4385 {
4387 }
4388}
virtual DString getSourceFileBase() const =0
DString getSourceFileBase() const override

References Definition::getSourceFileBase(), DefinitionMixin< Base >::getSourceFileBase(), m_implicitTemplateInstance, and m_templateMaster.

◆ getTemplateBaseClassNames()

const TemplateNameMap & ClassDefImpl::getTemplateBaseClassNames ( ) const
overridevirtual

Implements ClassDef.

Definition at line 4503 of file classdef.cpp.

4504{
4505 return m_templBaseClassNames;
4506}

References m_templBaseClassNames.

◆ getTemplateInstances()

const TemplateInstanceList & ClassDefImpl::getTemplateInstances ( ) const
overridevirtual

Returns a sorted dictionary with all template instances found for this template class.

Returns 0 if not a template or no instances.

Implements ClassDef.

Definition at line 5140 of file classdef.cpp.

5141{
5142 return m_templateInstances;
5143}

References m_templateInstances.

Referenced by internalInsertMember().

◆ getTemplateParameterLists()

ArgumentLists ClassDefImpl::getTemplateParameterLists ( ) const
overridevirtual

Returns the template parameter lists that form the template declaration of this class.

Example: template<class T> class TC {} = 0; will return a list with one ArgumentList containing one argument with type="class" and name="T".

Implements ClassDef.

Definition at line 4584 of file classdef.cpp.

4585{
4586 ArgumentLists result;
4587 Definition *d=getOuterScope();
4588 while (d && d->definitionType()==Definition::TypeClass)
4589 {
4590 result.insert(result.begin(),toClassDef(d)->templateArguments());
4591 d = d->getOuterScope();
4592 }
4593 if (!templateArguments().empty())
4594 {
4595 result.push_back(templateArguments());
4596 }
4597 return result;
4598}

References Definition::definitionType(), Definition::getOuterScope(), DefinitionMixin< ClassDefMutable >::getOuterScope(), templateArguments(), toClassDef(), and Definition::TypeClass.

◆ getTitleForMemberListType()

void ClassDefImpl::getTitleForMemberListType ( MemberListType type,
DString & title,
DString & subtitle ) const
private

Definition at line 4859 of file classdef.cpp.

4861{
4862 SrcLangExt lang = getLanguage();
4863 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4864 {
4865 if (lde->kind()==LayoutDocEntry::MemberDecl)
4866 {
4867 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4868 if (lmd && lmd->type==type)
4869 {
4870 title = lmd->title(lang);
4871 subtitle = lmd->subtitle(lang);
4872 return;
4873 }
4874 }
4875 }
4876 title="";
4877 subtitle="";
4878}
DString title() const override
DString subtitle(SrcLangExt lang) const
Definition layout.cpp:1832
DString title(SrcLangExt lang) const
Definition layout.cpp:1827

References DefinitionMixin< ClassDefMutable >::getLanguage(), LayoutDocManager::instance(), LayoutDocEntryMemberDecl::subtitle(), title(), LayoutDocEntryMemberDecl::title(), and LayoutDocEntryMemberDecl::type.

◆ hasCollaborationGraph()

bool ClassDefImpl::hasCollaborationGraph ( ) const
overridevirtual

Implements ClassDefMutable.

Definition at line 5552 of file classdef.cpp.

5553{
5555}

References m_hasCollaborationGraph.

◆ hasDetailedDescription()

bool ClassDefImpl::hasDetailedDescription ( ) const
overridevirtual

returns true if this class has a non-empty detailed description

Implements ClassDef.

Definition at line 1698 of file classdef.cpp.

1699{
1700 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1701 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1702 return ((!briefDescription().empty() && repeatBrief) ||
1704 !typeConstraints().empty() ||
1705 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()) ||
1707}
bool hasTemplateDocumentation() const
Definition arguments.cpp:34
const ArgumentList & typeConstraints() const override
bool hasRequirementRefs() const override

References DefinitionMixin< ClassDefMutable >::briefDescription(), Config_getBool, DefinitionMixin< ClassDefMutable >::documentation(), DefinitionMixin< ClassDefMutable >::getBodyDef(), DefinitionMixin< ClassDefMutable >::getStartBodyLine(), DefinitionMixin< ClassDefMutable >::hasRequirementRefs(), ArgumentList::hasTemplateDocumentation(), m_tempArgs, and typeConstraints().

Referenced by writeBriefDescription(), and writeDetailedDescription().

◆ hasDocumentation()

bool ClassDefImpl::hasDocumentation ( ) const
overridevirtual

Returns true iff the definition is documented (which could be generated documentation)

See also
hasUserDocumentation()

Implements Definition.

Definition at line 3743 of file classdef.cpp.

3744{
3746}
bool hasDocumentation() const override

References DefinitionMixin< Base >::hasDocumentation().

Referenced by isLinkableInProject(), and isVisibleInHierarchy().

◆ hasExamples()

bool ClassDefImpl::hasExamples ( ) const
overridevirtual

Implements ClassDef.

Definition at line 3494 of file classdef.cpp.

3495{
3496 return !m_examples.empty();
3497}

References m_examples.

Referenced by writeDetailedDocumentationBody(), and writeDocumentationContents().

◆ hasInheritanceGraph()

CLASS_GRAPH_t ClassDefImpl::hasInheritanceGraph ( ) const
overridevirtual

Implements ClassDefMutable.

Definition at line 5524 of file classdef.cpp.

5525{
5527}

References m_typeInheritanceGraph.

◆ hasNamedVariable()

bool ClassDefImpl::hasNamedVariable ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5398 of file classdef.cpp.

5399{
5400 return m_hasNamedVariable;
5401}

References m_hasNamedVariable.

◆ hasNonReferenceSuperClass()

bool ClassDefImpl::hasNonReferenceSuperClass ( ) const
overridevirtual

Returns true iff this class or a class inheriting from this class is not defined in an external tag file.

Implements ClassDef.

Definition at line 3611 of file classdef.cpp.

3612{
3613 return hasNonReferenceSuperClassRec(this,0);
3614}
static bool hasNonReferenceSuperClassRec(const ClassDef *cd, int level)

References hasNonReferenceSuperClassRec().

Referenced by isVisibleInHierarchy().

◆ hideDerivedVariablesInPython()

void ClassDefImpl::hideDerivedVariablesInPython ( ClassDefMutable * cls)
private

Definition at line 4054 of file classdef.cpp.

4055{
4056 //printf("hideDerivedVariableInPython()\n");
4057 if (bClass)
4058 {
4059 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
4060 MemberNameInfoLinkedMap &dstMnd = m_allMemberNameInfoLinkedMap;
4061
4062 // recurse up the inheritance hierarchy
4063 for (const auto &bcd : bClass->baseClasses())
4064 {
4066 }
4067
4068 for (auto &srcMni : srcMnd) // for each member in a base class
4069 {
4070 //printf(" candidate(%s)\n",qPrint(srcMni->memberName()));
4071 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4072 if (dstMni) // that is also in this class
4073 {
4075 //printf("%s member in %s and %s\n",qPrint(name()),qPrint(bClass->name()),qPrint(name()));
4076 for (it=dstMni->begin();it!=dstMni->end();)
4077 {
4078 MemberDefMutable *dstMd = toMemberDefMutable((*it)->memberDef());
4079 if (dstMd && dstMd->isVariable() && !dstMd->name().startsWith("__"))
4080 {
4081 //printf(" hiding member %s\n",qPrint(dstMd->name()));
4082 // hide a member variable if it is already defined in a base class, unless
4083 // it is a __private variable
4084 removeMemberFromLists(dstMd);
4085 it = dstMni->erase(it);
4086 }
4087 else
4088 {
4089 ++it;
4090 }
4091 }
4092 if (dstMni->empty()) // if the list has become empty, remove the entry from the dictionary
4093 {
4094 dstMnd.del(srcMni->memberName());
4095 }
4096 }
4097 }
4098 }
4099}
void hideDerivedVariablesInPython(ClassDefMutable *cls)
void removeMemberFromLists(MemberDef *md) override
bool startsWith(const char *s) const
Definition dstring.h:600
bool del(const DString &key)
Definition linkedmap.h:183
virtual bool isVariable() const =0
bool empty() const
Definition membername.h:133
iterator begin()
Definition membername.h:129
iterator end()
Definition membername.h:130
typename Vec::iterator iterator
Definition membername.h:123
iterator erase(iterator pos)
Definition membername.h:140

References ClassDef::baseClasses(), MemberNameInfo::begin(), LinkedMap< T, Hash, KeyEqual, Map >::del(), MemberNameInfo::empty(), MemberNameInfo::end(), MemberNameInfo::erase(), LinkedMap< T, Hash, KeyEqual, Map >::find(), hideDerivedVariablesInPython(), MemberDef::isVariable(), m_allMemberNameInfoLinkedMap, ClassDef::memberNameInfoLinkedMap(), Definition::name(), removeMemberFromLists(), DString::startsWith(), toClassDefMutable(), and toMemberDefMutable().

Referenced by hideDerivedVariablesInPython(), and mergeMembers().

◆ includeInfo()

const IncludeInfo * ClassDefImpl::includeInfo ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5165 of file classdef.cpp.

5166{
5167 return m_incInfo.get();
5168}

References m_incInfo.

◆ inheritanceGraphFileName()

DString ClassDefImpl::inheritanceGraphFileName ( ) const
overridevirtual

returns the file name to use for the inheritance graph

Implements ClassDef.

Definition at line 5514 of file classdef.cpp.

5515{
5516 return m_inheritFileName;
5517}

References m_inheritFileName.

◆ insertBaseClass()

void ClassDefImpl::insertBaseClass ( ClassDef * cd,
const DString & name,
Protection p,
Specifier s,
const DString & t = DString() )
overridevirtual

Implements ClassDefMutable.

Definition at line 1029 of file classdef.cpp.

1031{
1032 //printf("*** insert base class %s into %s\n",qPrint(cd->name()),qPrint(name()));
1033 m_inherits.emplace_back(cd,n,p,s,t);
1034 m_isSimple = false;
1035}

References m_inherits, and m_isSimple.

Referenced by mergeCategory().

◆ insertExplicitTemplateInstance()

void ClassDefImpl::insertExplicitTemplateInstance ( ClassDef * instance,
const DString & spec )
overridevirtual

Implements ClassDefMutable.

Definition at line 4492 of file classdef.cpp.

4493{
4494 AUTO_TRACE("this={} cd={} templSpec={}",name(),templateClass->name(),templSpec);
4495 m_templateInstances.emplace_back(templSpec,templateClass);
4496}

References AUTO_TRACE, m_templateInstances, Definition::name(), and DefinitionMixin< ClassDefMutable >::name().

◆ insertMember()

void ClassDefImpl::insertMember ( MemberDef * md)
overridevirtual

Implements ClassDefMutable.

Definition at line 1390 of file classdef.cpp.

1391{
1392 internalInsertMember(md,md->protection(),true);
1393}
void internalInsertMember(MemberDef *md, Protection prot, bool addToAllList)
virtual Protection protection() const =0

References internalInsertMember(), and MemberDef::protection().

Referenced by addMemberToTemplateInstance(), mergeMembersFromBaseClasses(), and reclassifyMember().

◆ insertSubClass()

void ClassDefImpl::insertSubClass ( ClassDef * cd,
Protection p,
Specifier s,
const DString & t = DString() )
overridevirtual

Implements ClassDefMutable.

Definition at line 1038 of file classdef.cpp.

1040{
1041 //printf("*** insert sub class %s into %s\n",qPrint(cd->name()),qPrint(name()));
1042 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
1043 if (!extractPrivate && cd->protection()==Protection::Private) return;
1044 m_inheritedBy.emplace_back(cd,DString(),p,s,t);
1045 m_isSimple = false;
1046}
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.

References Config_getBool, m_inheritedBy, m_isSimple, and ClassDef::protection().

◆ insertTemplateInstance()

ClassDef * ClassDefImpl::insertTemplateInstance ( const DString & fileName,
int startLine,
size_t startColumn,
const DString & templSpec,
bool & freshInstance )
overridevirtual

Implements ClassDefMutable.

Definition at line 4429 of file classdef.cpp.

4431{
4432 freshInstance = false;
4433 auto it = std::find_if(m_templateInstances.begin(),
4434 m_templateInstances.end(),
4435 [&templSpec](const auto &ti) { return templSpec==ti.templSpec; });
4436 ClassDefMutable *templateClass=nullptr;
4437 if (it!=m_templateInstances.end())
4438 {
4439 templateClass = toClassDefMutable((*it).classDef);
4440 }
4441 if (templateClass==nullptr)
4442 {
4443 DString tcname = removeRedundantWhiteSpace(name()+templSpec);
4444 AUTO_TRACE("New template instance class name='{}' templSpec='{}' inside '{}' hidden={}",
4445 name(),templSpec,name(),isHidden());
4446
4447 ClassDef *foundCd = Doxygen::classLinkedMap->find(tcname);
4448 if (foundCd)
4449 {
4450 return foundCd;
4451 }
4452 templateClass =
4454 Doxygen::classLinkedMap->add(tcname,
4455 std::unique_ptr<ClassDef>(
4456 new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
4457 if (templateClass)
4458 {
4459 templateClass->setTemplateMaster(this);
4460 ArgumentList tal = *stringToArgumentList(getLanguage(),templSpec);
4461 templateClass->setTemplateArguments(tal);
4462 templateClass->setOuterScope(getOuterScope());
4463 templateClass->setHidden(isHidden());
4464 templateClass->setArtificial(isArtificial());
4465 templateClass->setImplicitTemplateInstance(true);
4466 m_templateInstances.emplace_back(templSpec,templateClass);
4467
4468 // also add nested classes
4469 for (const auto &innerCd : m_innerClasses)
4470 {
4471 DString innerName = tcname+"::"+innerCd->localName();
4472 ClassDefMutable *innerClass =
4474 Doxygen::classLinkedMap->add(innerName,
4475 std::unique_ptr<ClassDef>(
4476 new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
4477 if (innerClass)
4478 {
4479 templateClass->addInnerCompound(innerClass);
4480 innerClass->setOuterScope(templateClass);
4481 innerClass->setHidden(isHidden());
4482 innerClass->setArtificial(true);
4483 innerClass->setImplicitTemplateInstance(true);
4484 }
4485 }
4486 freshInstance=true;
4487 }
4488 }
4489 return templateClass;
4490}
virtual void setTemplateArguments(const ArgumentList &al)=0
virtual void setTemplateMaster(const ClassDef *tm)=0
virtual void setImplicitTemplateInstance(bool b)=0
virtual void setHidden(bool b)=0
virtual void addInnerCompound(Definition *d)=0
virtual void setArtificial(bool b)=0

References DefinitionMutable::addInnerCompound(), AUTO_TRACE, ClassDef::Class, ClassDefImpl(), Doxygen::classLinkedMap, LinkedMap< T, Hash, KeyEqual, Map >::find(), DefinitionMixin< ClassDefMutable >::getLanguage(), DefinitionMixin< ClassDefMutable >::getOuterScope(), DefinitionMixin< ClassDefMutable >::isArtificial(), DefinitionMixin< ClassDefMutable >::isHidden(), m_innerClasses, m_templateInstances, DefinitionMixin< ClassDefMutable >::name(), removeRedundantWhiteSpace(), DefinitionMutable::setArtificial(), DefinitionMutable::setHidden(), ClassDefMutable::setImplicitTemplateInstance(), DefinitionMutable::setOuterScope(), ClassDefMutable::setTemplateArguments(), ClassDefMutable::setTemplateMaster(), stringToArgumentList(), and toClassDefMutable().

◆ insertUsedFile()

void ClassDefImpl::insertUsedFile ( const FileDef * fd)
overridevirtual

Implements ClassDefMutable.

Definition at line 1440 of file classdef.cpp.

1441{
1442 if (fd == nullptr) return;
1443
1444 if (std::find(m_files.begin(), m_files.end(), fd) == m_files.end()) m_files.push_back(fd);
1445
1446 for (const auto &ti : m_templateInstances)
1447 {
1448 ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
1449 if (cdm && cdm->isImplicitTemplateInstance()) // (partial) specializations have their own files
1450 {
1451 cdm->insertUsedFile(fd);
1452 }
1453 }
1454}
virtual bool isImplicitTemplateInstance() const =0
virtual void insertUsedFile(const FileDef *)=0

References ClassDefMutable::insertUsedFile(), ClassDef::isImplicitTemplateInstance(), m_files, m_templateInstances, and toClassDefMutable().

◆ internalInsertMember()

void ClassDefImpl::internalInsertMember ( MemberDef * md,
Protection prot,
bool addToAllList )
private

isReference()

Definition at line 1070 of file classdef.cpp.

1074{
1075 AUTO_TRACE("{} name={} isHidden={}",name(),md->name(),md->isHidden());
1076 if (md->isHidden()) return;
1077
1078 if (getLanguage()==SrcLangExt::VHDL)
1079 {
1080 DString title=theTranslator->trVhdlType(md->getVhdlSpecifiers(),false);
1081 m_vhdlSummaryTitles.insert(title.str());
1082 }
1083
1084 if (1 /*!isReference()*/) // changed to 1 for showing members of external
1085 // classes when HAVE_DOT and UML_LOOK are enabled.
1086 {
1087 bool isSimple=false;
1088
1089 /********************************************/
1090 /* insert member in the declaration section */
1091 /********************************************/
1092 if (md->isRelated() && protectionLevelVisible(prot))
1093 {
1094 addMemberToList(MemberListType::Related(),md,true);
1095 }
1096 else if (md->isFriend())
1097 {
1098 addMemberToList(MemberListType::Friends(),md,true);
1099 }
1100 else
1101 {
1102 switch (md->memberType())
1103 {
1104 case MemberType::Service: // UNO IDL
1105 addMemberToList(MemberListType::Services(),md,true);
1106 break;
1107 case MemberType::Interface: // UNO IDL
1108 addMemberToList(MemberListType::Interfaces(),md,true);
1109 break;
1110 case MemberType::Signal: // Qt specific
1111 addMemberToList(MemberListType::Signals(),md,true);
1112 break;
1113 case MemberType::DCOP: // KDE2 specific
1114 addMemberToList(MemberListType::DcopMethods(),md,true);
1115 break;
1116 case MemberType::Property:
1117 addMemberToList(MemberListType::Properties(),md,true);
1118 break;
1119 case MemberType::Event:
1120 addMemberToList(MemberListType::Events(),md,true);
1121 break;
1122 case MemberType::Slot: // Qt specific
1123 switch (prot)
1124 {
1125 case Protection::Protected:
1126 case Protection::Package: // slots in packages are not possible!
1127 addMemberToList(MemberListType::ProSlots(),md,true);
1128 break;
1129 case Protection::Public:
1130 addMemberToList(MemberListType::PubSlots(),md,true);
1131 break;
1132 case Protection::Private:
1133 addMemberToList(MemberListType::PriSlots(),md,true);
1134 break;
1135 }
1136 break;
1137 default: // any of the other members
1138 if (md->isStatic())
1139 {
1140 if (md->isVariable())
1141 {
1142 switch (prot)
1143 {
1144 case Protection::Protected:
1145 addMemberToList(MemberListType::ProStaticAttribs(),md,true);
1146 break;
1147 case Protection::Package:
1148 addMemberToList(MemberListType::PacStaticAttribs(),md,true);
1149 break;
1150 case Protection::Public:
1151 addMemberToList(MemberListType::PubStaticAttribs(),md,true);
1152 break;
1153 case Protection::Private:
1154 addMemberToList(MemberListType::PriStaticAttribs(),md,true);
1155 break;
1156 }
1157 }
1158 else // function
1159 {
1160 switch (prot)
1161 {
1162 case Protection::Protected:
1163 addMemberToList(MemberListType::ProStaticMethods(),md,true);
1164 break;
1165 case Protection::Package:
1166 addMemberToList(MemberListType::PacStaticMethods(),md,true);
1167 break;
1168 case Protection::Public:
1169 addMemberToList(MemberListType::PubStaticMethods(),md,true);
1170 break;
1171 case Protection::Private:
1172 addMemberToList(MemberListType::PriStaticMethods(),md,true);
1173 break;
1174 }
1175 }
1176 }
1177 else // not static
1178 {
1179 if (md->isVariable())
1180 {
1181 switch (prot)
1182 {
1183 case Protection::Protected:
1184 if (md->anonymousMemberForDeclaration()==nullptr) // not a split member that has a separate declaration member
1185 {
1186 addMemberToList(MemberListType::ProAttribs(),md,true);
1187 }
1188 break;
1189 case Protection::Package:
1190 if (md->anonymousMemberForDeclaration()==nullptr) // not a split member that has a separate declaration member
1191 {
1192 addMemberToList(MemberListType::PacAttribs(),md,true);
1193 }
1194 break;
1195 case Protection::Public:
1196 {
1197 if (md->anonymousMemberForDeclaration()==nullptr) // not a split member that has a separate declaration member
1198 {
1199 addMemberToList(MemberListType::PubAttribs(),md,true);
1200 const int MAX_CELL_SIZE=60;
1201 size_t typeLen = removeAnonymousScopes(md->typeString()).length();
1202 isSimple = typeLen + md->name().length() + md->argsString().length() <= MAX_CELL_SIZE;
1203 }
1204 }
1205 break;
1206 case Protection::Private:
1207 if (md->anonymousMemberForDeclaration()==nullptr) // not a split member that has a separate declaration member
1208 {
1209 addMemberToList(MemberListType::PriAttribs(),md,true);
1210 }
1211 break;
1212 }
1213 }
1214 else if (md->isTypedef() || md->isEnumerate() || md->isEnumValue())
1215 {
1216 switch (prot)
1217 {
1218 case Protection::Protected:
1219 addMemberToList(MemberListType::ProTypes(),md,true);
1220 break;
1221 case Protection::Package:
1222 addMemberToList(MemberListType::PacTypes(),md,true);
1223 break;
1224 case Protection::Public:
1225 addMemberToList(MemberListType::PubTypes(),md,true);
1226 isSimple=!md->isEnumerate() &&
1227 !md->isEnumValue() &&
1228 md->typeString().find(")(")==DString::npos; // func ptr typedef
1229 break;
1230 case Protection::Private:
1231 addMemberToList(MemberListType::PriTypes(),md,true);
1232 break;
1233 }
1234 }
1235 else // member function
1236 {
1237 switch (prot)
1238 {
1239 case Protection::Protected:
1240 addMemberToList(MemberListType::ProMethods(),md,true);
1241 break;
1242 case Protection::Package:
1243 addMemberToList(MemberListType::PacMethods(),md,true);
1244 break;
1245 case Protection::Public:
1246 addMemberToList(MemberListType::PubMethods(),md,true);
1247 break;
1248 case Protection::Private:
1249 addMemberToList(MemberListType::PriMethods(),md,true);
1250 break;
1251 }
1252 }
1253 }
1254 break;
1255 }
1256 }
1257 if (!isSimple) // not a simple field -> not a simple struct
1258 {
1259 m_isSimple = false;
1260 }
1261 //printf("adding %s simple=%d total_simple=%d\n",qPrint(md->qualifiedName()),isSimple,m_isSimple);
1262 if ((!md->isEnumerate() && md->isAnonymous()) || // non-enum anonymous member (e.g. nameless member associated with anonymous struct/union)
1263 md->anonymousMemberForDetails()!=nullptr)
1264 {
1265 return; // The member is split in two, one for the declaration and one for the details.
1266 // Skip this member if it has an associated member for the details,
1267 // which implies this is the member for the declaration part only.
1268 }
1269
1270 /*******************************************************/
1271 /* insert member in the detailed documentation section */
1272 /*******************************************************/
1273 if ((md->isRelated() && protectionLevelVisible(prot)) || md->isFriend())
1274 {
1275 addMemberToList(MemberListType::RelatedMembers(),md,false);
1276 }
1277 else if (md->isFunction() &&
1278 md->protection()==Protection::Private &&
1279 (md->virtualness()!=Specifier::Normal || md->isOverride() || md->isFinal()) &&
1280 Config_getBool(EXTRACT_PRIV_VIRTUAL))
1281 {
1282 addMemberToList(MemberListType::FunctionMembers(),md,false);
1283 }
1284 else
1285 {
1286 switch (md->memberType())
1287 {
1288 case MemberType::Service: // UNO IDL
1289 addMemberToList(MemberListType::ServiceMembers(),md,false);
1290 break;
1291 case MemberType::Interface: // UNO IDL
1292 addMemberToList(MemberListType::InterfaceMembers(),md,false);
1293 break;
1294 case MemberType::Property:
1295 addMemberToList(MemberListType::PropertyMembers(),md,false);
1296 break;
1297 case MemberType::Event:
1298 addMemberToList(MemberListType::EventMembers(),md,false);
1299 break;
1300 case MemberType::Signal: // fall through
1301 case MemberType::DCOP:
1302 addMemberToList(MemberListType::FunctionMembers(),md,false);
1303 break;
1304 case MemberType::Slot:
1305 if (protectionLevelVisible(prot))
1306 {
1307 addMemberToList(MemberListType::FunctionMembers(),md,false);
1308 }
1309 break;
1310 default: // any of the other members
1311 if (protectionLevelVisible(prot))
1312 {
1313 switch (md->memberType())
1314 {
1315 case MemberType::Typedef:
1316 addMemberToList(MemberListType::TypedefMembers(),md,false);
1317 break;
1318 case MemberType::Enumeration:
1319 addMemberToList(MemberListType::EnumMembers(),md,false);
1320 break;
1321 case MemberType::EnumValue:
1322 addMemberToList(MemberListType::EnumValMembers(),md,false);
1323 break;
1324 case MemberType::Function:
1325 if (md->isConstructor() || md->isDestructor())
1326 {
1327 m_memberLists.get(MemberListType::Constructors(),MemberListContainer::Class)->push_back(md);
1328 }
1329 else
1330 {
1331 addMemberToList(MemberListType::FunctionMembers(),md,false);
1332 }
1333 break;
1334 case MemberType::Variable:
1335 addMemberToList(MemberListType::VariableMembers(),md,false);
1336 break;
1337 case MemberType::Define:
1338 warn(md->getDefFileName(),md->getDefLine()-1,"A define ({}) cannot be made a member of {}",
1339 md->name(), this->name());
1340 break;
1341 default:
1342 err("Unexpected member type '{}' found!\n",md->memberTypeName());
1343 }
1344 }
1345 break;
1346 }
1347 }
1348
1349 /*************************************************/
1350 /* insert member in the appropriate member group */
1351 /*************************************************/
1352 // Note: this must be done AFTER inserting the member in the
1353 // regular groups
1354 //addMemberToGroup(md,groupId);
1355
1356 }
1357
1358 if (md->virtualness()==Specifier::Pure)
1359 {
1360 m_isAbstract=true;
1361 }
1362
1363 if (md->name()=="operator->")
1364 {
1365 m_arrowOperator=md;
1366 }
1367
1368 if (addToAllList && !(Config_getBool(HIDE_FRIEND_COMPOUNDS) && md->isFriend() && isTypeAClassFriend(md->typeString())))
1369 {
1370 //printf("=======> adding member %s to class %s\n",qPrint(md->name()),qPrint(name()));
1371
1372 MemberNameInfo *mni = m_allMemberNameInfoLinkedMap.add(md->name());
1373 mni->push_back(std::make_unique<MemberInfo>(md,prot,md->virtualness(),false,false));
1374 }
1375
1376 // if we already created template instances before inserting this member (i.e. due to a typedef or using statement)
1377 // then we also need to insert the member in the template instance.
1378 for (const auto &ti : getTemplateInstances())
1379 {
1380 AUTO_TRACE_ADD("member {} of class {} with template instance {}\n",md->name(),name(),ti.templSpec);
1381 ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
1382 if (cdm && cdm->isImplicitTemplateInstance()) // (partial) specializations have their own members
1383 {
1384 cdm->addMemberToTemplateInstance(md,templateArguments(),ti.templSpec);
1385 }
1386 }
1387
1388}
void addMemberToList(MemberListType lt, MemberDef *md, bool isBrief)
const TemplateInstanceList & getTemplateInstances() const override
Returns a sorted dictionary with all template instances found for this template class.
bool isSimple() const override
virtual void addMemberToTemplateInstance(const MemberDef *md, const ArgumentList &templateArguments, const DString &templSpec)=0
size_t find(char c, size_t pos=0) const
Definition dstring.h:239
const std::string & str() const
Definition dstring.h:645
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
virtual DString getDefFileName() const =0
virtual int getDefLine() const =0
virtual bool isHidden() const =0
virtual bool isDestructor() const =0
virtual bool isConstructor() const =0
virtual bool isFriend() const =0
virtual DString argsString() const =0
virtual bool isRelated() const =0
virtual bool isOverride() const =0
virtual bool isTypedef() const =0
virtual VhdlSpecifier getVhdlSpecifiers() const =0
virtual bool isFunction() const =0
virtual bool isStatic() const =0
virtual const MemberDef * anonymousMemberForDeclaration() const =0
virtual const MemberDef * anonymousMemberForDetails() const =0
virtual bool isEnumerate() const =0
virtual MemberType memberType() const =0
virtual Specifier virtualness(int count=0) const =0
virtual bool isFinal() const =0
virtual DString memberTypeName() const =0
virtual bool isEnumValue() const =0
void push_back(Ptr &&p)
Definition membername.h:139
virtual DString trVhdlType(VhdlSpecifier type, bool single)=0
#define warn(file, line, fmt,...)
Definition message.h:97
#define err(fmt,...)
Definition message.h:127
bool isTypeAClassFriend(const DString &type)
Definition types.h:923
bool protectionLevelVisible(Protection prot)
Definition util.cpp:4807
DString removeAnonymousScopes(const DString &str)
Definition util.cpp:98

References LinkedMap< T, Hash, KeyEqual, Map >::add(), addMemberToList(), ClassDefMutable::addMemberToTemplateInstance(), MemberDef::anonymousMemberForDeclaration(), MemberDef::anonymousMemberForDetails(), MemberDef::argsString(), AUTO_TRACE, AUTO_TRACE_ADD, Class, Config_getBool, err, DString::find(), MemberLists::get(), Definition::getDefFileName(), Definition::getDefLine(), DefinitionMixin< ClassDefMutable >::getLanguage(), getTemplateInstances(), MemberDef::getVhdlSpecifiers(), Definition::isAnonymous(), MemberDef::isConstructor(), MemberDef::isDestructor(), MemberDef::isEnumerate(), MemberDef::isEnumValue(), MemberDef::isFinal(), MemberDef::isFriend(), MemberDef::isFunction(), Definition::isHidden(), ClassDef::isImplicitTemplateInstance(), MemberDef::isOverride(), MemberDef::isRelated(), isSimple(), MemberDef::isStatic(), isTypeAClassFriend(), MemberDef::isTypedef(), MemberDef::isVariable(), DString::length(), m_allMemberNameInfoLinkedMap, m_arrowOperator, m_isAbstract, m_isSimple, m_memberLists, m_vhdlSummaryTitles, MemberDef::memberType(), MemberDef::memberTypeName(), Definition::name(), DefinitionMixin< ClassDefMutable >::name(), DString::npos, MemberDef::protection(), protectionLevelVisible(), MemberNameInfo::push_back(), removeAnonymousScopes(), DString::str(), templateArguments(), theTranslator, title(), toClassDefMutable(), Translator::trVhdlType(), MemberDef::typeString(), MemberDef::virtualness(), and warn.

Referenced by insertMember(), mergeCategory(), and mergeMembersFromBaseClasses().

◆ isAbstract()

bool ClassDefImpl::isAbstract ( ) const
overridevirtual

Returns true if there is at least one pure virtual member in this class.

Implements ClassDef.

Definition at line 5190 of file classdef.cpp.

5191{
5192 return m_isAbstract || m_spec.isAbstract();
5193}

References m_isAbstract, and m_spec.

Referenced by addClassAttributes().

◆ isAccessibleMember()

bool ClassDefImpl::isAccessibleMember ( const MemberDef * md) const
overridevirtual

returns true iff md is a member of this class or of the the public/protected members of a base class

Implements ClassDef.

Definition at line 4689 of file classdef.cpp.

4690{
4691 return md->getClassDef() && isBaseClass(md->getClassDef(),true,DString());
4692}
int isBaseClass(const ClassDef *bcd, bool followInstances, const DString &templSpec) const override
Returns true iff bcd is a direct or indirect base class of this class.
virtual const ClassDef * getClassDef() const =0

References MemberDef::getClassDef(), and isBaseClass().

◆ isBaseClass()

int ClassDefImpl::isBaseClass ( const ClassDef * bcd,
bool followInstances,
const DString & templSpec ) const
overridevirtual

Returns true iff bcd is a direct or indirect base class of this class.

This function will recursively traverse all branches of the inheritance tree.

Implements ClassDef.

Definition at line 3753 of file classdef.cpp.

3754{
3755 int distance=0;
3756 //printf("isBaseClass(cd=%s) looking for %s templSpec=%s\n",qPrint(name()),qPrint(bcd->name()),qPrint(templSpec));
3757 for (const auto &bclass : baseClasses())
3758 {
3759 const ClassDef *ccd = bclass.classDef;
3760 if (!followInstances && ccd->templateMaster())
3761 {
3762 ccd=ccd->templateMaster();
3763 }
3764 if (ccd==bcd && (templSpec.empty() || templSpec==bclass.templSpecifiers))
3765 {
3766 distance=1;
3767 break; // no shorter path possible
3768 }
3769 else
3770 {
3771 int d = ccd->isBaseClass(bcd,followInstances,templSpec);
3772 if (d>256)
3773 {
3774 err("Possible recursive class relation while inside {} and looking for base class {}\n",name(),bcd->name());
3775 return 0;
3776 }
3777 else if (d>0) // path found
3778 {
3779 if (distance==0 || d+1<distance) // update if no path found yet or shorter path found
3780 {
3781 distance=d+1;
3782 }
3783 }
3784 }
3785 }
3786 return distance;
3787}
virtual int isBaseClass(const ClassDef *bcd, bool followInstances, const DString &templSpec=DString()) const =0
Returns true iff bcd is a direct or indirect base class of this class.
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
const BaseClassList & baseClasses() const override
Returns the list of base classes from which this class directly inherits.

References baseClasses(), DString::empty(), err, ClassDef::isBaseClass(), Definition::name(), DefinitionMixin< ClassDefMutable >::name(), and ClassDef::templateMaster().

Referenced by isAccessibleMember().

◆ isCSharp()

bool ClassDefImpl::isCSharp ( ) const
overridevirtual

Returns true if this class is implemented in C#.

Implements ClassDef.

Definition at line 5235 of file classdef.cpp.

5236{
5237 return getLanguage()==SrcLangExt::CSharp;
5238}

References DefinitionMixin< ClassDefMutable >::getLanguage().

◆ isEmbeddedInOuterScope()

bool ClassDefImpl::isEmbeddedInOuterScope ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5353 of file classdef.cpp.

5354{
5355 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
5356 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
5357
5358 Definition *container = getOuterScope();
5359
5360 bool containerLinkable =
5361 container &&
5362 (
5363 (container==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) || // global class in documented file
5364 container->isLinkableInProject() // class in documented scope
5365 );
5366
5367 if (isAnonymous())
5368 {
5369 return false; // don't inline an anonymous class
5370 }
5371
5372 // inline because of INLINE_GROUPED_CLASSES=YES ?
5373 bool b1 = (inlineGroupedClasses && !partOfGroups().empty()); // a grouped class
5374 // inline because of INLINE_SIMPLE_STRUCTS=YES ?
5375 bool b2 = (inlineSimpleClasses && m_isSimple && // a simple class
5376 (containerLinkable || // in a documented container
5377 !partOfGroups().empty() // or part of a group
5378 )
5379 );
5380 //printf("%s::isEmbeddedInOuterScope(): inlineGroupedClasses=%d "
5381 // "inlineSimpleClasses=%d partOfGroups()=%d m_isSimple=%d "
5382 // "getOuterScope()=%s b1=%d b2=%d\n",
5383 // qPrint(name()),inlineGroupedClasses,inlineSimpleClasses,
5384 // !partOfGroups().empty(),m_isSimple,getOuterScope()?qPrint(getOuterScope()->name()):"<none>",b1,b2);
5385 return b1 || b2; // either reason will do
5386}

References Config_getBool, getFileDef(), DefinitionMixin< ClassDefMutable >::getOuterScope(), Doxygen::globalScope, DefinitionMixin< ClassDefMutable >::isAnonymous(), Definition::isLinkableInProject(), m_isSimple, and DefinitionMixin< ClassDefMutable >::partOfGroups().

Referenced by anchor().

◆ isExtension()

bool ClassDefImpl::isExtension ( ) const
overridevirtual

Returns true if this class represents an Objective-C 2.0 extension (nameless category).

Implements ClassDef.

Definition at line 5470 of file classdef.cpp.

5471{
5472 DString n = name();
5473 size_t si = n.find('(');
5474 size_t ei = n.find(')');
5475 bool b = si!=DString::npos && ei!=DString::npos && ei>si && n.mid(si+1,ei-si-1).stripWhiteSpace().empty();
5476 return b;
5477}

References DString::empty(), DString::find(), DString::mid(), DefinitionMixin< ClassDefMutable >::name(), DString::npos, and DString::stripWhiteSpace().

Referenced by mergeCategory(), and visibleInParentsDeclList().

◆ isFinal()

bool ClassDefImpl::isFinal ( ) const
overridevirtual

Returns true if this class is marked as final.

Implements ClassDef.

Definition at line 5195 of file classdef.cpp.

5196{
5197 return m_spec.isFinal();
5198}

References m_spec.

Referenced by addClassAttributes().

◆ isFortran()

bool ClassDefImpl::isFortran ( ) const
overridevirtual

Returns true if this class is implemented in Fortran.

Implements ClassDef.

Definition at line 5230 of file classdef.cpp.

5231{
5232 return getLanguage()==SrcLangExt::Fortran;
5233}

References DefinitionMixin< ClassDefMutable >::getLanguage().

Referenced by writeTagFile().

◆ isForwardDeclared()

bool ClassDefImpl::isForwardDeclared ( ) const
overridevirtual

Returns true if this class represents a forward declaration of a template class.

Implements ClassDef.

Definition at line 5215 of file classdef.cpp.

5216{
5217 return m_spec.isForwardDecl();
5218}

References m_spec.

◆ isImplicitTemplateInstance()

bool ClassDefImpl::isImplicitTemplateInstance ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5150 of file classdef.cpp.

5151{
5153}

References m_implicitTemplateInstance.

◆ isInterface()

bool ClassDefImpl::isInterface ( ) const
overridevirtual

Returns true if this class represents an interface.

Implements ClassDef.

Definition at line 5220 of file classdef.cpp.

5221{
5222 return m_spec.isInterface();
5223}

References m_spec.

◆ isJavaEnum()

bool ClassDefImpl::isJavaEnum ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5416 of file classdef.cpp.

5417{
5418 return m_isJavaEnum;
5419}

References m_isJavaEnum.

Referenced by ClassDefImpl(), compoundTypeString(), generatedFromFiles(), and title().

◆ isLinkable()

bool ClassDefImpl::isLinkable ( ) const
overridevirtual

Returns true iff it is possible to link to this item. This can be a link to another project imported via a tag file.

Implements Definition.

Definition at line 3696 of file classdef.cpp.

3697{
3699 {
3700 return m_templateMaster->isLinkable();
3701 }
3702 else
3703 {
3704 return isReference() || isLinkableInProject();
3705 }
3706}
bool isReference() const override

References Definition::isLinkable(), isLinkableInProject(), isReference(), m_implicitTemplateInstance, and m_templateMaster.

Referenced by visibleInParentsDeclList(), and writeDeclarationLink().

◆ isLinkableInProject()

bool ClassDefImpl::isLinkableInProject ( ) const
overridevirtual

a link to this class is possible within this project

Implements Definition.

Definition at line 3664 of file classdef.cpp.

3665{
3666 bool extractLocal = Config_getBool(EXTRACT_LOCAL_CLASSES);
3667 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3668 bool hideUndoc = Config_getBool(HIDE_UNDOC_CLASSES);
3670 {
3672 }
3673 else
3674 {
3675 //printf("%s::isLinkableInProject() conditions: artificial=%d hidden=%d anonymous=%d protection=%d local=%d docs=%d static=%d ref=%d\n",
3676 // qPrint(name()),
3677 // !isArtificial(),
3678 // !isHidden(),
3679 // !isAnonymous(),
3680 // protectionLevelVisible(m_prot),
3681 // !m_isLocal || extractLocal,
3682 // hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc,
3683 // !m_isStatic || extractStatic,
3684 // !isReference());
3685 return
3686 !isArtificial() && !isHidden() && /* not hidden */
3687 !isAnonymous() && /* not anonymous */
3688 protectionLevelVisible(m_prot) && /* private/internal */
3689 (!m_isLocal || extractLocal) && /* local */
3690 (hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc) && /* documented */
3691 (!m_isStatic || extractStatic) && /* static */
3692 !isReference(); /* not an external reference */
3693 }
3694}
bool hasDocumentation() const override

References Config_getBool, hasDocumentation(), ArgumentList::hasTemplateDocumentation(), DefinitionMixin< ClassDefMutable >::isAnonymous(), DefinitionMixin< ClassDefMutable >::isArtificial(), DefinitionMixin< ClassDefMutable >::isHidden(), Definition::isLinkableInProject(), isReference(), m_implicitTemplateInstance, m_isLocal, m_isStatic, m_prot, m_tempArgs, m_templateMaster, and protectionLevelVisible().

Referenced by addListReferences(), addRequirementReferences(), getOutputFileBase(), isLinkable(), writeDeclarationLink(), and writeTagFile().

◆ isLocal()

bool ClassDefImpl::isLocal ( ) const
overridevirtual

Returns true if this is a local class definition, see EXTRACT_LOCAL_CLASSES.

Implements ClassDef.

Definition at line 5070 of file classdef.cpp.

5071{
5072 return m_isLocal;
5073}

References m_isLocal.

Referenced by visibleInParentsDeclList().

◆ isObjectiveC()

bool ClassDefImpl::isObjectiveC ( ) const
overridevirtual

Returns true if this class is implemented in Objective-C.

Implements ClassDef.

Definition at line 5225 of file classdef.cpp.

5226{
5227 return getLanguage()==SrcLangExt::ObjC;
5228}

References DefinitionMixin< ClassDefMutable >::getLanguage().

Referenced by writeTagFile().

◆ isPublished()

bool ClassDefImpl::isPublished ( ) const
overridevirtual

Returns true if this class is marked as published.

Implements ClassDef.

Definition at line 5210 of file classdef.cpp.

5211{
5212 return m_spec.isPublished();
5213}

References m_spec.

Referenced by addClassAttributes().

◆ isRef()

bool ClassDefImpl::isRef ( ) const
overridevirtual

Returns true if this class is a C# ref struct or a C++/CLI ref class.

Implements ClassDef.

Definition at line 5205 of file classdef.cpp.

5206{
5207 return m_spec.isRef();
5208}

References m_spec.

Referenced by addClassAttributes().

◆ isReference()

bool ClassDefImpl::isReference ( ) const
overridevirtual

Returns true if this definition is imported via a tag file.

Implements Definition.

Definition at line 4572 of file classdef.cpp.

4573{
4575 {
4576 return m_templateMaster->isReference();
4577 }
4578 else
4579 {
4581 }
4582}
virtual bool isReference() const =0
bool isReference() const override

References Definition::isReference(), DefinitionMixin< Base >::isReference(), m_implicitTemplateInstance, and m_templateMaster.

Referenced by isLinkable(), isLinkableInProject(), and isVisibleInHierarchy().

◆ isSealed()

bool ClassDefImpl::isSealed ( ) const
overridevirtual

Returns true if this class is marked as sealed.

Implements ClassDef.

Definition at line 5200 of file classdef.cpp.

5201{
5202 return m_spec.isSealed();
5203}

References m_spec.

Referenced by addClassAttributes().

◆ isSimple()

bool ClassDefImpl::isSimple ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5315 of file classdef.cpp.

5316{
5317 return m_isSimple;
5318}

References m_isSimple.

Referenced by internalInsertMember(), and writeInlineDocumentation().

◆ isSliceLocal()

bool ClassDefImpl::isSliceLocal ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5499 of file classdef.cpp.

5500{
5501 return m_spec.isLocal();
5502}

References m_spec.

Referenced by title(), and writeDeclarationLink().

◆ isSmartPointer()

const MemberDef * ClassDefImpl::isSmartPointer ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5320 of file classdef.cpp.

5321{
5322 return m_arrowOperator;
5323}

References m_arrowOperator.

◆ isSubClass()

bool ClassDefImpl::isSubClass ( ClassDef * bcd,
int level = 0 ) const
overridevirtual

Returns true iff bcd is a direct or indirect sub class of this class.

Implements ClassDef.

Definition at line 3791 of file classdef.cpp.

3792{
3793 bool found=false;
3794 if (level>256)
3795 {
3796 err("Possible recursive class relation while inside {} and looking for derived class {}\n",name(),cd->name());
3797 return false;
3798 }
3799 for (const auto &iscd : subClasses())
3800 {
3801 ClassDef *ccd=iscd.classDef;
3802 found = (ccd==cd) || ccd->isSubClass(cd,level+1);
3803 if (found) break;
3804 }
3805 return found;
3806}
virtual bool isSubClass(ClassDef *bcd, int level=0) const =0
Returns true iff bcd is a direct or indirect sub class of this class.
const BaseClassList & subClasses() const override
Returns the list of sub classes that directly derive from this class.

References err, ClassDef::isSubClass(), Definition::name(), DefinitionMixin< ClassDefMutable >::name(), and subClasses().

◆ isTemplate()

bool ClassDefImpl::isTemplate ( ) const
overridevirtual

Returns true if this class is a template.

Implements ClassDef.

Definition at line 5160 of file classdef.cpp.

5161{
5162 return !m_tempArgs.empty();
5163}
bool empty() const
Definition arguments.h:100

References ArgumentList::empty(), and m_tempArgs.

◆ isTemplateArgument()

bool ClassDefImpl::isTemplateArgument ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5185 of file classdef.cpp.

5186{
5187 return m_isTemplArg;
5188}

References m_isTemplArg.

◆ isUsedOnly()

bool ClassDefImpl::isUsedOnly ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5310 of file classdef.cpp.

5311{
5312 return m_usedOnly;
5313}

References m_usedOnly.

◆ isVisibleInHierarchy()

bool ClassDefImpl::isVisibleInHierarchy ( ) const
overridevirtual

the class is visible in a class diagram, or class hierarchy

Implements ClassDef.

Definition at line 3710 of file classdef.cpp.

3711{
3712 bool allExternals = Config_getBool(ALLEXTERNALS);
3713 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
3714 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3715
3716 //printf("%s: isArtificial=%d isAnonymous=%d protectionLevelVisible=%d hasDocumentation=%d templateInstance=%d static=%d\n",
3717 // qPrint(name()),
3718 // (allExternals && !isArtificial()) || hasNonReferenceSuperClass(),
3719 // !isAnonymous(),
3720 // protectionLevelVisible(m_prot),
3721 // (hasDocumentation() || !hideUndocClasses || (m_templateMaster && m_templateMaster->hasDocumentation()) || isReference()),
3722 // !m_implicitTemplateInstance || !m_inherits.empty() || !m_inheritedBy.empty(),
3723 // !m_isStatic || extractStatic);
3724
3725 return // show all classes or a subclass is visible
3726 ((allExternals && !isArtificial()) || hasNonReferenceSuperClass()) &&
3727 // and not an anonymous compound
3728 !isAnonymous() &&
3729 // and not privately inherited
3731 // documented or shown anyway or documentation is external
3732 (hasDocumentation() ||
3733 !hideUndocClasses ||
3735 isReference()
3736 ) &&
3737 // if this is an implicit template instance then it most be part of the inheritance hierarchy
3738 (!m_implicitTemplateInstance || !m_inherits.empty() || !m_inheritedBy.empty()) &&
3739 // is not part of an unnamed namespace or shown anyway
3740 (!m_isStatic || extractStatic);
3741}
bool hasNonReferenceSuperClass() const override
virtual bool hasDocumentation() const =0

References Config_getBool, hasDocumentation(), Definition::hasDocumentation(), hasNonReferenceSuperClass(), DefinitionMixin< ClassDefMutable >::isAnonymous(), DefinitionMixin< ClassDefMutable >::isArtificial(), isReference(), m_implicitTemplateInstance, m_inheritedBy, m_inherits, m_isStatic, m_prot, m_templateMaster, and protectionLevelVisible().

◆ makeTemplateArgument()

void ClassDefImpl::makeTemplateArgument ( bool b = true)
overridevirtual

Implements ClassDefMutable.

Definition at line 5295 of file classdef.cpp.

5296{
5297 m_isTemplArg = b;
5298}

References m_isTemplArg.

◆ memberNameInfoLinkedMap()

const MemberNameInfoLinkedMap & ClassDefImpl::memberNameInfoLinkedMap ( ) const
overridevirtual

Returns a dictionary of all members.

This includes any inherited members. Members are sorted alphabetically.

Implements ClassDef.

Definition at line 5105 of file classdef.cpp.

5106{
5108}

References m_allMemberNameInfoLinkedMap.

◆ mergeCategory()

void ClassDefImpl::mergeCategory ( ClassDef * cat)
overridevirtual

Merges the members of a Objective-C category into this class.

Implements ClassDefMutable.

Definition at line 4147 of file classdef.cpp.

4148{
4149 AUTO_TRACE();
4150 ClassDefMutable *category = toClassDefMutable(cat);
4151 if (category)
4152 {
4153 bool extractLocalMethods = Config_getBool(EXTRACT_LOCAL_METHODS);
4154 bool makePrivate = category->isLocal();
4155 // in case extract local methods is not enabled we don't add the methods
4156 // of the category in case it is defined in the .m file.
4157 if (makePrivate && !extractLocalMethods) return;
4158 bool isExtension = category->isExtension();
4159
4160 category->setCategoryOf(this);
4161 if (isExtension)
4162 {
4163 category->setArtificial(true);
4164
4165 // copy base classes/protocols from extension
4166 for (const auto &bcd : category->baseClasses())
4167 {
4168 insertBaseClass(bcd.classDef,bcd.usedName,bcd.prot,bcd.virt,bcd.templSpecifiers);
4169 // correct bcd.classDef so that they do no longer derive from
4170 // category, but from this class!
4171 BaseClassList scl = bcd.classDef->subClasses();
4172 for (auto &scd : scl)
4173 {
4174 if (scd.classDef==category)
4175 {
4176 scd.classDef=this;
4177 }
4178 }
4179 bcd.classDef->updateSubClasses(scl);
4180 }
4181 }
4182 // make methods private for categories defined in the .m file
4183 //printf("%s::mergeCategory makePrivate=%d\n",qPrint(name()),makePrivate);
4184
4185 const MemberNameInfoLinkedMap &srcMnd = category->memberNameInfoLinkedMap();
4186 MemberNameInfoLinkedMap &dstMnd = m_allMemberNameInfoLinkedMap;
4187
4188 for (auto &srcMni : srcMnd)
4189 {
4190 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4191 if (dstMni) // method is already defined in the class
4192 {
4193 AUTO_TRACE_ADD("Existing member {}",srcMni->memberName());
4194 const auto &dstMi = dstMni->front();
4195 const auto &srcMi = srcMni->front();
4196 if (srcMi && dstMi)
4197 {
4198 MemberDefMutable *smdm = toMemberDefMutable(srcMi->memberDef());
4199 MemberDefMutable *dmdm = toMemberDefMutable(dstMi->memberDef());
4200 if (smdm && dmdm)
4201 {
4203 dmdm->setCategory(category);
4204 dmdm->setCategoryRelation(smdm);
4205 smdm->setCategoryRelation(dmdm);
4206 }
4207 }
4208 }
4209 else // new method name
4210 {
4211 AUTO_TRACE_ADD("New member {}",srcMni->memberName());
4212 // create a deep copy of the list
4213 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
4214
4215 // copy the member(s) from the category to this class
4216 for (auto &mi : *srcMni)
4217 {
4218 //printf("Adding '%s'\n",qPrint(mi->memberDef->name()));
4219 Protection prot = mi->prot();
4220 //if (makePrivate) prot = Private;
4221 auto newMd = mi->memberDef()->deepCopy();
4222 if (newMd)
4223 {
4224 auto mmd = toMemberDefMutable(newMd.get());
4225 AUTO_TRACE_ADD("Copying member {}",mmd->name());
4226 if (mmd)
4227 {
4228 mmd->moveTo(this);
4229 }
4230
4231 auto newMi=std::make_unique<MemberInfo>(newMd.get(),prot,mi->virt(),mi->inherited(),mi->virtualBaseClass());
4232 newMi->setScopePath(mi->scopePath());
4233 newMi->setAmbigClass(mi->ambigClass());
4234 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
4235 newMni->push_back(std::move(newMi));
4236
4237 // also add the newly created member to the global members list
4238
4239 DString name = newMd->name();
4240 MemberName *mn = Doxygen::memberNameLinkedMap->add(name);
4241
4242 if (mmd)
4243 {
4244 mmd->setCategory(category);
4245 mmd->setCategoryRelation(mi->memberDef());
4246 }
4247 auto miMmd = toMemberDefMutable(mi->memberDef());
4248 if (miMmd) miMmd->setCategoryRelation(newMd.get());
4249
4250 if (mmd && (makePrivate || isExtension))
4251 {
4252 mmd->makeImplementationDetail();
4253 }
4254 internalInsertMember(newMd.get(),prot,false);
4255 mn->push_back(std::move(newMd));
4256 }
4257 }
4258 }
4259 }
4260 }
4261}
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual bool isLocal() const =0
Returns true if this is a local class definition, see EXTRACT_LOCAL_CLASSES.
virtual bool isExtension() const =0
Returns true if this class represents an Objective-C 2.0 extension (nameless category).
void insertBaseClass(ClassDef *, const DString &name, Protection p, Specifier s, const DString &t=DString()) override
bool isExtension() const override
Returns true if this class represents an Objective-C 2.0 extension (nameless category).
virtual void setCategoryOf(ClassDef *cd)=0
virtual void setCategory(ClassDef *)=0
virtual void setCategoryRelation(const MemberDef *)=0
std::vector< BaseClassDef > BaseClassList
Definition classdef.h:77
void combineDeclarationAndDefinition(MemberDefMutable *mdec, MemberDefMutable *mdef)
Protection
Definition types.h:32

References LinkedMap< T, Hash, KeyEqual, Map >::add(), AUTO_TRACE, AUTO_TRACE_ADD, ClassDef::baseClasses(), combineDeclarationAndDefinition(), Config_getBool, LinkedMap< T, Hash, KeyEqual, Map >::find(), MemberNameInfo::front(), insertBaseClass(), internalInsertMember(), ClassDef::isExtension(), isExtension(), ClassDef::isLocal(), m_allMemberNameInfoLinkedMap, ClassDef::memberNameInfoLinkedMap(), Doxygen::memberNameLinkedMap, DefinitionMixin< ClassDefMutable >::name(), MemberName::push_back(), MemberNameInfo::push_back(), DefinitionMutable::setArtificial(), MemberDefMutable::setCategory(), ClassDefMutable::setCategoryOf(), MemberDefMutable::setCategoryRelation(), toClassDefMutable(), and toMemberDefMutable().

◆ mergeMembers()

void ClassDefImpl::mergeMembers ( )
overridevirtual

recursively merges the 'all members' lists of a class base with that of this class. Must only be called for classes without subclasses!

Implements ClassDefMutable.

Definition at line 4106 of file classdef.cpp.

4107{
4108 if (m_membersMerged) return;
4109 if (getLanguage()==SrcLangExt::Python)
4110 {
4111 for (const auto &bcd : baseClasses())
4112 {
4113 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4115 }
4116 }
4117
4118 //printf("> %s::mergeMembers()\n",qPrint(name()));
4119
4120 m_membersMerged=true;
4121
4122 // first merge the members of the base class recursively
4123 for (const auto &bcd : baseClasses())
4124 {
4125 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4126 if (bClass)
4127 {
4128 // merge the members in the base class of this inheritance branch first
4129 bClass->mergeMembers();
4130 }
4131 }
4132
4133 // first merge the member that are not inherited via a virtual base class
4134 // (as this can end up reimplemented via multiple paths, see #10717 for examples)
4136 // then process the member that are inherited via a virtual base class to add the
4137 // ones that are not reimplemented via any path
4139
4140 //printf("< %s::mergeMembers()\n",qPrint(name()));
4141}
void mergeMembersFromBaseClasses(bool mergeVirtualBaseClass)
virtual void mergeMembers()=0

References baseClasses(), DefinitionMixin< ClassDefMutable >::getLanguage(), hideDerivedVariablesInPython(), m_membersMerged, ClassDefMutable::mergeMembers(), mergeMembersFromBaseClasses(), and toClassDefMutable().

◆ mergeMembersFromBaseClasses()

void ClassDefImpl::mergeMembersFromBaseClasses ( bool mergeVirtualBaseClass)
private

Definition at line 3817 of file classdef.cpp.

3818{
3819 SrcLangExt lang = getLanguage();
3820 DString sep=getLanguageSpecificSeparator(lang,true);
3821 size_t sepLen = sep.length();
3822 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
3823 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
3824
3825 auto insertMember = [&](const ClassDef *cd,MemberDef *md,Protection prot)
3826 {
3827 if (inlineInheritedMembers && !isStandardFunc(md))
3828 {
3829 //printf(" %s::insertMember(%s)\n",qPrint(name()),qPrint(srcMd->name()));
3830 internalInsertMember(md,prot,false);
3831 if (!cd->isLinkable()) // if the base is not linkable then move the member to this class
3832 {
3833 MemberDefMutable *mdm = toMemberDefMutable(md);
3834 mdm->moveTo(this);
3835 mdm->setExplicitInherited(true);
3836 }
3837 }
3838 };
3839
3840 //printf(" mergeMembers for %s mergeVirtualBaseClass=%d\n",qPrint(name()),mergeVirtualBaseClass);
3841 // the merge the base members with this class' members
3842 for (const auto &bcd : baseClasses())
3843 {
3844 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
3845 if (bClass)
3846 {
3847 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
3848 MemberNameInfoLinkedMap &dstMnd = m_allMemberNameInfoLinkedMap;
3849
3850 for (auto &srcMni : srcMnd)
3851 {
3852 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
3853 if (dstMni)
3854 // a member with that name is already in the class.
3855 // the member may hide or reimplement the one in the sub class
3856 // or there may be another path to the base class that is already
3857 // visited via another branch in the class hierarchy.
3858 {
3859 //printf(" %s hides member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
3860 for (auto &srcMi : *srcMni)
3861 {
3862 MemberDef *srcMd = srcMi->memberDef();
3863 bool found=false;
3864 bool ambiguous=false;
3865 bool hidden=false;
3866 const ClassDef *srcCd = srcMd->getClassDef();
3867 for (auto &dstMi : *dstMni)
3868 {
3869 const MemberDef *dstMd = dstMi->memberDef();
3870 if (srcMd!=dstMd) // different members
3871 {
3872 const ClassDef *dstCd = dstMd->getClassDef();
3873 //printf(" Is %s a base class of %s?\n",qPrint(srcCd->name()),qPrint(dstCd->name()));
3874 if (srcCd==dstCd || dstCd->isBaseClass(srcCd,true))
3875 // member is in the same or a base class
3876 {
3877 const ArgumentList &srcAl = srcMd->argumentList();
3878 const ArgumentList &dstAl = dstMd->argumentList();
3879 found=matchArguments2(
3880 srcMd->getOuterScope(),srcMd->getFileDef(),srcMd->typeString(),&srcAl,
3881 dstMd->getOuterScope(),dstMd->getFileDef(),dstMd->typeString(),&dstAl,
3882 true,lang
3883 );
3884 //printf(" Yes, matching (%s<->%s): %d\n",
3885 // qPrint(argListToString(srcMd->argumentList())),
3886 // qPrint(argListToString(dstMd->argumentList())),
3887 // found);
3888 hidden = hidden || !found;
3889 }
3890 else // member is in a non base class => multiple inheritance
3891 // using the same base class.
3892 {
3893 //printf(" $$ Existing member %s %s add scope %s\n",
3894 // qPrint(dstMi->ambiguityResolutionScope()),
3895 // qPrint(dstMd->name()),
3896 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3897
3898 size_t scopeSepPos = dstMi->scopePath().find(sep);
3899 DString scope = dstMi->scopePath().left(scopeSepPos!=DString::npos ? scopeSepPos+sepLen : 0);
3900 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3901 {
3902 dstMi->setAmbiguityResolutionScope(scope+dstMi->ambiguityResolutionScope());
3903 }
3904 ambiguous=true;
3905 }
3906 }
3907 else // same members
3908 {
3909 // do not add if base class is virtual or
3910 // if scope paths are equal or
3911 // if base class is an interface (and thus implicitly virtual).
3912 //printf(" same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt(),dstMi->virt());
3913 if ((srcMi->virt()!=Specifier::Normal && dstMi->virt()!=Specifier::Normal) ||
3914 bClass->name()+sep+srcMi->scopePath() == dstMi->scopePath() ||
3916 )
3917 {
3918 found=true;
3919 }
3920 else // member can be reached via multiple paths in the
3921 // inheritance tree
3922 {
3923 //printf(" $$ Existing member %s %s add scope %s\n",
3924 // qPrint(dstMi->ambiguityResolutionScope()),
3925 // qPrint(dstMd->name()),
3926 // qPrint(dstMi->scopePath().left(dstMi->scopePath().find("::")+2)));
3927
3928 size_t scopeSepPos = dstMi->scopePath().find(sep);
3929 DString scope = dstMi->scopePath().left(scopeSepPos!=DString::npos ? scopeSepPos+sepLen : 0);
3930 if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
3931 {
3932 dstMi->setAmbiguityResolutionScope(dstMi->ambiguityResolutionScope()+scope);
3933 }
3934 ambiguous=true;
3935 }
3936 }
3937 if (found) break;
3938 }
3939 //printf(" member %s::%s hidden %d ambiguous %d srcMi->ambigClass=%p found=%d\n",
3940 // qPrint(srcCd->name()),qPrint(srcMd->name()),hidden,ambiguous,
3941 // (void*)srcMi->ambigClass(),found);
3942
3943 // TODO: fix the case where a member is hidden by inheritance
3944 // of a member with the same name but with another prototype,
3945 // while there is more than one path to the member in the
3946 // base class due to multiple inheritance. In this case
3947 // it seems that the member is not reachable by prefixing a
3948 // scope name either (according to my compiler). Currently,
3949 // this case is shown anyway.
3950 if (!found && srcMd->protection()!=Protection::Private && !srcMd->isFriend() &&
3951 srcMi->virtualBaseClass()==mergeVirtualBaseClass && lang!=SrcLangExt::Python)
3952 {
3953 Protection prot = srcMd->protection();
3954 if (bcd.prot==Protection::Protected && prot==Protection::Public)
3955 {
3956 prot = bcd.prot;
3957 }
3958 else if (bcd.prot==Protection::Private)
3959 {
3960 prot = bcd.prot;
3961 }
3962
3963 insertMember(bClass,srcMd,prot);
3964
3965 Specifier virt=srcMi->virt();
3966 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
3967 bool virtualBaseClass = bcd.virt!=Specifier::Normal;
3968
3969 auto newMi = std::make_unique<MemberInfo>(srcMd,prot,virt,true,virtualBaseClass);
3970 newMi->setScopePath(bClass->name()+sep+srcMi->scopePath());
3971 if (ambiguous)
3972 {
3973 //printf("$$ New member %s %s add scope %s::\n",
3974 // qPrint(srcMi->ambiguityResolutionScope),
3975 // qPrint(srcMd->name()),
3976 // qPrint(bClass->name()));
3977
3978 DString scope=bClass->name()+sep;
3979 if (scope!=srcMi->ambiguityResolutionScope().left(scope.length()))
3980 {
3981 newMi->setAmbiguityResolutionScope(scope+srcMi->ambiguityResolutionScope());
3982 }
3983 }
3984 if (hidden)
3985 {
3986 if (srcMi->ambigClass()==nullptr)
3987 {
3988 newMi->setAmbigClass(bClass);
3989 newMi->setAmbiguityResolutionScope(bClass->name()+sep);
3990 }
3991 else
3992 {
3993 newMi->setAmbigClass(srcMi->ambigClass());
3994 newMi->setAmbiguityResolutionScope(srcMi->ambigClass()->name()+sep);
3995 }
3996 }
3997 dstMni->push_back(std::move(newMi));
3998 }
3999 }
4000 }
4001 else // base class has a member that is not in the sub class => copy
4002 {
4003 //printf(" %s adds member name %s\n",qPrint(bClass->name()),qPrint(srcMni->memberName()));
4004 // create a deep copy of the list (only the MemberInfo's will be
4005 // copied, not the actual MemberDef's)
4006 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
4007
4008 // copy the member(s) from the base to the sub class
4009 for (auto &mi : *srcMni)
4010 {
4011 if (mi->virtualBaseClass()==mergeVirtualBaseClass && !mi->memberDef()->isFriend()) // don't inherit friends
4012 {
4013 Protection prot = mi->prot();
4014 if (bcd.prot==Protection::Protected)
4015 {
4016 if (prot==Protection::Public) prot=Protection::Protected;
4017 }
4018 else if (bcd.prot==Protection::Private)
4019 {
4020 prot=Protection::Private;
4021 }
4022 Specifier virt=mi->virt();
4023 bool virtualBaseClass = bcd.virt!=Specifier::Normal || mi->virtualBaseClass();
4024 if (virt==Specifier::Normal && bcd.virt!=Specifier::Normal) virt=bcd.virt;
4025 //printf(" %s::%s: [mi.prot=%d, bcd.prot=%d => prot=%d], [mi.virt=%d, bcd.virt=%d => virt=%d] virtualBase=%d\n",
4026 // qPrint(name()),qPrint(mi->memberDef()->name()),
4027 // mi->prot(),bcd.prot,prot,
4028 // mi->virt(),bcd.virt,virt,
4029 // virtualBaseClass
4030 // );
4031
4032 if (prot!=Protection::Private || extractPrivate)
4033 {
4034 insertMember(bClass,mi->memberDef(),prot);
4035
4036 //printf("Adding!\n");
4037 std::unique_ptr<MemberInfo> newMi = std::make_unique<MemberInfo>(mi->memberDef(),prot,virt,true,virtualBaseClass);
4038 newMi->setScopePath(bClass->name()+sep+mi->scopePath());
4039 newMi->setAmbigClass(mi->ambigClass());
4040 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
4041 newMni->push_back(std::move(newMi));
4042 }
4043 }
4044 }
4045 }
4046 }
4047 }
4048 }
4049}
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e. class/struct/union/...
DString left(size_t len) const
Definition dstring.h:306
virtual void moveTo(Definition *)=0
virtual void setExplicitInherited(bool b)=0
static bool isStandardFunc(const MemberDef *md)
Specifier
Definition types.h:80
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition util.cpp:4765

References LinkedMap< T, Hash, KeyEqual, Map >::add(), MemberDef::argumentList(), baseClasses(), ClassDef::compoundType(), Config_getBool, LinkedMap< T, Hash, KeyEqual, Map >::find(), MemberDef::getClassDef(), MemberDef::getFileDef(), DefinitionMixin< ClassDefMutable >::getLanguage(), getLanguageSpecificSeparator(), Definition::getOuterScope(), insertMember(), ClassDef::Interface, internalInsertMember(), ClassDef::isBaseClass(), MemberDef::isFriend(), Definition::isLinkable(), isStandardFunc(), DString::left(), DString::length(), m_allMemberNameInfoLinkedMap, matchArguments2(), ClassDef::memberNameInfoLinkedMap(), MemberDef::moveTo(), Definition::name(), DString::npos, MemberDef::protection(), MemberNameInfo::push_back(), MemberDefMutable::setExplicitInherited(), toClassDefMutable(), toMemberDefMutable(), and MemberDef::typeString().

Referenced by mergeMembers().

◆ moveTo()

void ClassDefImpl::moveTo ( Definition * scope)
overridevirtual

Implements ClassDef.

Definition at line 1004 of file classdef.cpp.

1005{
1006 //printf("%s::moveTo(%s)\n",qPrint(name()),qPrint(scope->name()));
1007 setOuterScope(scope);
1009 {
1010 m_fileDef = toFileDef(scope);
1011 }
1012 else if (scope->definitionType()==Definition::TypeModule)
1013 {
1014 m_moduleDef = toModuleDef(scope);
1015 }
1016}
void setOuterScope(Definition *def) override
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:2054
ModuleDef * toModuleDef(Definition *d)

References Definition::definitionType(), m_fileDef, m_moduleDef, DefinitionMixin< ClassDefMutable >::setOuterScope(), toFileDef(), toModuleDef(), Definition::TypeFile, and Definition::TypeModule.

◆ overrideCollaborationGraph()

void ClassDefImpl::overrideCollaborationGraph ( bool e)
overridevirtual

Implements ClassDefMutable.

Definition at line 5547 of file classdef.cpp.

5548{
5550}

References m_hasCollaborationGraph.

◆ overrideInheritanceGraph()

void ClassDefImpl::overrideInheritanceGraph ( CLASS_GRAPH_t e)
overridevirtual

Implements ClassDefMutable.

Definition at line 5519 of file classdef.cpp.

5520{
5522}

References m_typeInheritanceGraph.

◆ protection()

Protection ClassDefImpl::protection ( ) const
overridevirtual

Return the protection level (Public,Protected,Private) in which this compound was found.

Implements ClassDef.

Definition at line 5120 of file classdef.cpp.

5121{
5122 return m_prot;
5123}

References m_prot.

Referenced by visibleInParentsDeclList(), and writeDeclarationLink().

◆ qualifiedNameWithTemplateParameters()

DString ClassDefImpl::qualifiedNameWithTemplateParameters ( const ArgumentLists * actualParams = nullptr,
uint32_t * actualParamIndex = nullptr ) const
overridevirtual

Implements ClassDef.

Definition at line 4600 of file classdef.cpp.

4602{
4603 return makeQualifiedNameWithTemplateParameters(this,actualParams,actualParamIndex);
4604}
static DString makeQualifiedNameWithTemplateParameters(const ClassDef *cd, const ArgumentLists *actualParams, uint32_t *actualParamIndex)
Definition classdef.cpp:60

References makeQualifiedNameWithTemplateParameters().

◆ reclassifyMember()

void ClassDefImpl::reclassifyMember ( MemberDefMutable * md,
MemberType t )
overridevirtual

Implements ClassDefMutable.

Definition at line 5325 of file classdef.cpp.

5326{
5327 md->setMemberType(t);
5328 for (auto &ml : m_memberLists)
5329 {
5330 ml->remove(md);
5331 }
5332 insertMember(md);
5333}
virtual void setMemberType(MemberType t)=0

References insertMember(), m_memberLists, and MemberDefMutable::setMemberType().

◆ removeMemberFromLists()

void ClassDefImpl::removeMemberFromLists ( MemberDef * md)
overridevirtual

Implements ClassDefMutable.

Definition at line 5408 of file classdef.cpp.

5409{
5410 for (auto &ml : m_memberLists)
5411 {
5412 ml->remove(md);
5413 }
5414}

References m_memberLists.

Referenced by hideDerivedVariablesInPython().

◆ requiresClause()

DString ClassDefImpl::requiresClause ( ) const
overridevirtual

Implements ClassDef.

Definition at line 3616 of file classdef.cpp.

3617{
3618 return m_requiresClause;
3619}

References m_requiresClause.

◆ setAnonymousEnumType()

void ClassDefImpl::setAnonymousEnumType ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 4783 of file classdef.cpp.

4784{
4785 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4786 {
4787 if (lde->kind()==LayoutDocEntry::MemberDecl)
4788 {
4789 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4790 if (lmd)
4791 {
4792 MemberList * ml = getMemberList(lmd->type);
4793 if (ml)
4794 {
4796 }
4797 }
4798 }
4799 else if (lde->kind()==LayoutDocEntry::MemberGroups)
4800 {
4801 for (const auto &mg : m_memberGroups)
4802 {
4803 mg->setAnonymousEnumType();
4804 }
4805 }
4806 }
4807}
void setAnonymousEnumType()

References getMemberList(), LayoutDocManager::instance(), m_memberGroups, MemberList::setAnonymousEnumType(), and LayoutDocEntryMemberDecl::type.

◆ setCategoryOf()

void ClassDefImpl::setCategoryOf ( ClassDef * cd)
overridevirtual

Implements ClassDefMutable.

Definition at line 5300 of file classdef.cpp.

5301{
5302 m_categoryOf = cd;
5303}

References m_categoryOf.

◆ setClassName()

void ClassDefImpl::setClassName ( const DString & name)
overridevirtual

Implements ClassDefMutable.

Definition at line 4617 of file classdef.cpp.

4618{
4619 m_className = name;
4620}

References m_className, and DefinitionMixin< ClassDefMutable >::name().

◆ setClassSpecifier()

void ClassDefImpl::setClassSpecifier ( TypeSpecifier spec)
overridevirtual

Implements ClassDefMutable.

Definition at line 5421 of file classdef.cpp.

5422{
5423 m_spec = spec;
5424}

References m_spec.

◆ setCompoundType()

void ClassDefImpl::setCompoundType ( CompoundType t)
overridevirtual

Implements ClassDefMutable.

Definition at line 5284 of file classdef.cpp.

5285{
5286 m_compType = t;
5287}

References m_compType.

◆ setFileDef()

void ClassDefImpl::setFileDef ( FileDef * fd)
overridevirtual

Implements ClassDefMutable.

Definition at line 5255 of file classdef.cpp.

5256{
5257 m_fileDef = fd;
5258}

References m_fileDef.

◆ setGroupDefForAllMembers()

void ClassDefImpl::setGroupDefForAllMembers ( GroupDef * g,
Grouping::GroupPri_t pri,
const DString & fileName,
int startLine,
bool hasDocs )
overridevirtual

Implements ClassDefMutable.

Definition at line 4390 of file classdef.cpp.

4391{
4392 gd->addClass(this);
4393 //printf("ClassDefImpl::setGroupDefForAllMembers(%s)\n",qPrint(gd->name()));
4394 for (auto &mni : m_allMemberNameInfoLinkedMap)
4395 {
4396 for (auto &mi : *mni)
4397 {
4398 MemberDefMutable *md = toMemberDefMutable(mi->memberDef());
4399 if (md)
4400 {
4401 md->setGroupDef(gd,pri,fileName,startLine,hasDocs);
4402 gd->insertMember(md,true);
4403 ClassDefMutable *innerClass = toClassDefMutable(const_cast<ClassDef*>(md->getClassDefOfAnonymousType()));
4404 if (innerClass) innerClass->setGroupDefForAllMembers(gd,pri,fileName,startLine,hasDocs);
4405 }
4406 }
4407 }
4408}
virtual void setGroupDefForAllMembers(GroupDef *g, Grouping::GroupPri_t pri, const DString &fileName, int startLine, bool hasDocs)=0
virtual const ClassDef * getClassDefOfAnonymousType() const =0
virtual void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const DString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr)=0

References GroupDef::addClass(), MemberDef::getClassDefOfAnonymousType(), GroupDef::insertMember(), m_allMemberNameInfoLinkedMap, MemberDefMutable::setGroupDef(), ClassDefMutable::setGroupDefForAllMembers(), toClassDefMutable(), and toMemberDefMutable().

◆ setHasNamedVariable()

void ClassDefImpl::setHasNamedVariable ( bool b)
overridevirtual

Implements ClassDefMutable.

Definition at line 5403 of file classdef.cpp.

5404{
5406}

References m_hasNamedVariable.

◆ setImplicitTemplateInstance()

void ClassDefImpl::setImplicitTemplateInstance ( bool b)
overridevirtual

Implements ClassDefMutable.

Definition at line 5155 of file classdef.cpp.

5156{
5158}

References m_implicitTemplateInstance.

◆ setIncludeFile()

void ClassDefImpl::setIncludeFile ( FileDef * fd,
const DString & incName,
bool local,
bool force )
overridevirtual

Implements ClassDefMutable.

Definition at line 1478 of file classdef.cpp.

1480{
1481 //printf("ClassDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,includeName,local,force);
1482 if (!m_incInfo) m_incInfo = std::make_unique<IncludeInfo>();
1483 if ((!includeName.empty() && m_incInfo->includeName.empty()) ||
1484 (fd!=nullptr && m_incInfo->fileDef==nullptr)
1485 )
1486 {
1487 //printf("Setting file info\n");
1488 m_incInfo->fileDef = fd;
1489 m_incInfo->includeName = includeName;
1491 }
1492 if (force && !includeName.empty())
1493 {
1494 m_incInfo->includeName = includeName;
1496 }
1497}
@ IncludeLocal
Definition filedef.h:47
@ IncludeSystem
Definition filedef.h:46

References DString::empty(), IncludeLocal, IncludeSystem, and m_incInfo.

◆ setIsStatic()

void ClassDefImpl::setIsStatic ( bool b)
overridevirtual

Implements ClassDefMutable.

Definition at line 5279 of file classdef.cpp.

5280{
5281 m_isStatic=b;
5282}

References m_isStatic.

◆ setMetaData()

void ClassDefImpl::setMetaData ( const DString & md)
overridevirtual

Implements ClassDefMutable.

Definition at line 5504 of file classdef.cpp.

5505{
5506 m_metaData = md;
5507}

References m_metaData.

◆ setModuleDef()

void ClassDefImpl::setModuleDef ( ModuleDef * mod)
overridevirtual

Implements ClassDefMutable.

Definition at line 5260 of file classdef.cpp.

5261{
5262 m_moduleDef = mod;
5263}

References m_moduleDef.

◆ setPrimaryConstructorParams()

void ClassDefImpl::setPrimaryConstructorParams ( const ArgumentList & list)
overridevirtual

Implements ClassDefMutable.

Definition at line 3626 of file classdef.cpp.

3627{
3629}
ArgumentList m_primaryConstructorParams
Definition classdef.cpp:581

References m_primaryConstructorParams.

◆ setProtection()

void ClassDefImpl::setProtection ( Protection p)
overridevirtual

Implements ClassDefMutable.

Definition at line 5270 of file classdef.cpp.

5271{
5272 m_prot=p;
5273 if (getLanguage()==SrcLangExt::VHDL && VhdlDocGen::convert(p)==VhdlDocGen::ARCHITECTURECLASS)
5274 {
5275 m_className = name();
5276 }
5277}
@ ARCHITECTURECLASS
Definition vhdldocgen.h:74
static VhdlClasses convert(Protection prot)
Definition vhdldocgen.h:77

References VhdlDocGen::ARCHITECTURECLASS, VhdlDocGen::convert(), DefinitionMixin< ClassDefMutable >::getLanguage(), m_className, m_prot, and DefinitionMixin< ClassDefMutable >::name().

◆ setRequiresClause()

void ClassDefImpl::setRequiresClause ( const DString & req)
overridevirtual

Implements ClassDefMutable.

Definition at line 3621 of file classdef.cpp.

3622{
3623 m_requiresClause = req;
3624}

References m_requiresClause.

◆ setSubGrouping()

void ClassDefImpl::setSubGrouping ( bool enabled)
overridevirtual

Implements ClassDefMutable.

Definition at line 5265 of file classdef.cpp.

5266{
5267 m_subGrouping = enabled;
5268}

References m_subGrouping.

◆ setTaglessParent()

void ClassDefImpl::setTaglessParent ( const ClassDef * cd)
overridevirtual

Implements ClassDefMutable.

Definition at line 5393 of file classdef.cpp.

5394{
5395 m_taglessParent = cd;
5396}

References m_taglessParent.

◆ setTemplateArguments()

void ClassDefImpl::setTemplateArguments ( const ArgumentList & al)
overridevirtual

Implements ClassDefMutable.

Definition at line 3568 of file classdef.cpp.

3569{
3570 m_tempArgs = al;
3571}

References m_tempArgs.

◆ setTemplateBaseClassNames()

void ClassDefImpl::setTemplateBaseClassNames ( const TemplateNameMap & templateNames)
overridevirtual

Implements ClassDefMutable.

Definition at line 4498 of file classdef.cpp.

4499{
4500 m_templBaseClassNames = templateNames;
4501}

References m_templBaseClassNames.

◆ setTemplateMaster()

void ClassDefImpl::setTemplateMaster ( const ClassDef * tm)
overridevirtual

Implements ClassDefMutable.

Definition at line 5289 of file classdef.cpp.

5290{
5291 ASSERT(tm!=this);
5293}
#define ASSERT(x)
Definition message.h:142

References ASSERT, and m_templateMaster.

◆ setTypeConstraints()

void ClassDefImpl::setTypeConstraints ( const ArgumentList & al)
overridevirtual

Implements ClassDefMutable.

Definition at line 3563 of file classdef.cpp.

3564{
3565 m_typeConstraints = al;
3566}

References m_typeConstraints.

◆ setUsedOnly()

void ClassDefImpl::setUsedOnly ( bool b)
overridevirtual

Implements ClassDefMutable.

Definition at line 5305 of file classdef.cpp.

5306{
5307 m_usedOnly = b;
5308}

References m_usedOnly.

◆ showUsedFiles()

void ClassDefImpl::showUsedFiles ( OutputList & ol) const
private

Definition at line 1778 of file classdef.cpp.

1779{
1780 ol.pushGeneratorState();
1782
1783
1784 ol.writeRuler();
1785 ol.pushGeneratorState();
1787 ol.startParagraph();
1789 ol.endParagraph();
1790 ol.popGeneratorState();
1794
1795 bool first=true;
1796 for (const auto &fd : m_files)
1797 {
1798 if (first)
1799 {
1800 first=false;
1801 ol.startItemList();
1802 }
1803
1804 ol.startItemListItem();
1805 DString path=fd->getPath();
1806 if (Config_getBool(FULL_PATH_NAMES))
1807 {
1808 ol.docify(stripFromPath(path));
1809 }
1810
1811 DString fname = fd->name();
1812 if (!fd->getVersion().empty()) // append version if available
1813 {
1814 fname += " (" + fd->getVersion() + ")";
1815 }
1816
1817 // for HTML
1818 ol.pushGeneratorState();
1820 if (fd->generateSourceFile())
1821 {
1822 ol.writeObjectLink(DString(),fd->getSourceFileBase(),DString(),fname);
1823 }
1824 else if (fd->isLinkable())
1825 {
1826 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),DString(),fname);
1827 }
1828 else
1829 {
1830 ol.startBold();
1831 ol.docify(fname);
1832 ol.endBold();
1833 }
1834 ol.popGeneratorState();
1835
1836 // for other output formats
1837 ol.pushGeneratorState();
1839 if (fd->isLinkable())
1840 {
1841 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),DString(),fname);
1842 }
1843 else
1844 {
1845 ol.docify(fname);
1846 }
1847 ol.popGeneratorState();
1848
1849 ol.endItemListItem();
1850 }
1851 if (!first) ol.endItemList();
1852
1853 ol.popGeneratorState();
1854}
DString generatedFromFiles() const override
void startItemList()
Definition outputlist.h:425
void disable(OutputType o)
void startParagraph(const DString &classDef=DString())
Definition outputlist.h:403
void writeObjectLink(const DString &ref, const DString &file, const DString &anchor, const DString &name)
Definition outputlist.h:435
void writeRuler()
Definition outputlist.h:517
void docify(const DString &s)
Definition outputlist.h:433
void endParagraph()
Definition outputlist.h:405
void startItemListItem()
Definition outputlist.h:453
void endItemListItem()
Definition outputlist.h:455
void startBold()
Definition outputlist.h:557
void endBold()
Definition outputlist.h:559
void endItemList()
Definition outputlist.h:427
DString stripFromPath(const DString &path)
Definition util.cpp:219

References Config_getBool, OutputList::disable(), OutputList::disableAllBut(), Docbook, OutputList::docify(), OutputList::enable(), OutputList::endBold(), OutputList::endItemList(), OutputList::endItemListItem(), OutputList::endParagraph(), generatedFromFiles(), Html, m_files, Man, OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startBold(), OutputList::startItemList(), OutputList::startItemListItem(), OutputList::startParagraph(), stripFromPath(), OutputList::writeObjectLink(), and OutputList::writeRuler().

Referenced by writeDocumentationContents().

◆ sortAllMembersList()

void ClassDefImpl::sortAllMembersList ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 5110 of file classdef.cpp.

5111{
5112 std::stable_sort(m_allMemberNameInfoLinkedMap.begin(),
5114 [](const auto &m1,const auto &m2)
5115 {
5116 return dstricmp_sort(m1->memberName(),m2->memberName())<0;
5117 });
5118}
iterator begin()
Definition linkedmap.h:201
iterator end()
Definition linkedmap.h:202

References LinkedMap< T, Hash, KeyEqual, Map >::begin(), LinkedMap< T, Hash, KeyEqual, Map >::end(), and m_allMemberNameInfoLinkedMap.

◆ sortMemberLists()

void ClassDefImpl::sortMemberLists ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 4726 of file classdef.cpp.

4727{
4728 for (auto &ml : m_memberLists)
4729 {
4730 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
4731 }
4732 if (Config_getBool(SORT_BRIEF_DOCS))
4733 {
4734 std::stable_sort(m_innerClasses.begin(),
4736 [](const auto &c1,const auto &c2)
4737 {
4738 return Config_getBool(SORT_BY_SCOPE_NAME) ?
4739 dstricmp_sort(c1->name(), c2->name() )<0 :
4740 dstricmp_sort(c1->className(), c2->className())<0 ;
4741 });
4742 }
4743}
iterator end()
Definition linkedmap.h:367
iterator begin()
Definition linkedmap.h:366

References LinkedRefMap< T, Hash, KeyEqual, Map >::begin(), Config_getBool, LinkedRefMap< T, Hash, KeyEqual, Map >::end(), m_innerClasses, and m_memberLists.

◆ startMemberDeclarations()

void ClassDefImpl::startMemberDeclarations ( OutputList & ol) const
private

Definition at line 2271 of file classdef.cpp.

2272{
2273 //printf("%s: ClassDefImpl::startMemberDeclarations()\n",qPrint(name()));
2275}
void startMemberSections()
Definition outputlist.h:457

References OutputList::startMemberSections().

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ startMemberDocumentation()

void ClassDefImpl::startMemberDocumentation ( OutputList & ol) const
private

Definition at line 2251 of file classdef.cpp.

2252{
2253 //printf("%s: ClassDefImpl::startMemberDocumentation()\n",qPrint(name()));
2254 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2255 {
2258 }
2259}

References Config_getBool, OutputList::disable(), Html, and Doxygen::suppressDocWarnings.

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ subClasses()

const BaseClassList & ClassDefImpl::subClasses ( ) const
overridevirtual

Returns the list of sub classes that directly derive from this class.

Implements ClassDef.

Definition at line 5095 of file classdef.cpp.

5096{
5097 return m_inheritedBy;
5098}

References m_inheritedBy.

Referenced by isSubClass().

◆ subGrouping()

bool ClassDefImpl::subGrouping ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5494 of file classdef.cpp.

5495{
5496 return m_subGrouping;
5497}

References m_subGrouping.

◆ taglessParent()

const ClassDef * ClassDefImpl::taglessParent ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5388 of file classdef.cpp.

5389{
5390 return m_taglessParent;
5391}

References m_taglessParent.

◆ templateArguments()

const ArgumentList & ClassDefImpl::templateArguments ( ) const
overridevirtual

Returns the template arguments of this class.

Implements ClassDef.

Definition at line 5125 of file classdef.cpp.

5126{
5127 return m_tempArgs;
5128}

References m_tempArgs.

Referenced by addMembersToTemplateInstance(), addMemberToTemplateInstance(), className(), getTemplateParameterLists(), and internalInsertMember().

◆ templateMaster()

const ClassDef * ClassDefImpl::templateMaster ( ) const
overridevirtual

Returns the template master of which this class is an instance.

Returns 0 if not applicable.

Implements ClassDef.

Definition at line 5145 of file classdef.cpp.

5146{
5147 return m_templateMaster;
5148}

References m_templateMaster.

◆ templateTypeConstraints()

const ConstraintClassList & ClassDefImpl::templateTypeConstraints ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5180 of file classdef.cpp.

5181{
5182 return m_constraintClassList;
5183}

References m_constraintClassList.

◆ title()

DString ClassDefImpl::title ( ) const
overridevirtual

Implements ClassDef.

Definition at line 2964 of file classdef.cpp.

2965{
2966 DString pageTitle;
2967 SrcLangExt lang = getLanguage();
2968
2969 auto getReferenceTitle = [this](std::function<DString()> translateFunc) -> DString
2970 {
2971 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
2972 };
2973
2974 if (lang==SrcLangExt::Fortran)
2975 {
2976 pageTitle = getReferenceTitle([this](){
2978 });
2979 }
2980 else if (lang==SrcLangExt::Slice)
2981 {
2982 pageTitle = getReferenceTitle([this](){
2984 });
2985 }
2986 else if (lang==SrcLangExt::VHDL)
2987 {
2988 pageTitle = getReferenceTitle([this](){
2990 });
2991 }
2992 else if ((lang==SrcLangExt::CSharp || lang==SrcLangExt::Java) && !m_primaryConstructorParams.empty())
2993 {
2994 pageTitle = getReferenceTitle([this](){
2996 m_compType,
2997 !m_tempArgs.empty());
2998 });
2999 }
3000 else if (isJavaEnum())
3001 {
3002 pageTitle = getReferenceTitle([this](){
3004 });
3005 }
3006 else if (m_compType==Service)
3007 {
3008 pageTitle = getReferenceTitle([this](){
3010 });
3011 }
3012 else if (m_compType==Singleton)
3013 {
3014 pageTitle = getReferenceTitle([this](){
3016 });
3017 }
3018 else
3019 {
3020 pageTitle = getReferenceTitle([this](){
3022 m_compType == Interface && getLanguage()==SrcLangExt::ObjC ? Class : m_compType,
3023 !m_tempArgs.empty());
3024 });
3025 }
3026 return pageTitle;
3027}
bool isSliceLocal() const override
virtual DString trCompoundReference(const DString &clName, ClassDef::CompoundType compType, bool isTemplate)=0
virtual DString trCompoundReferenceSlice(const DString &clName, ClassDef::CompoundType compType, bool isLocal)=0
virtual DString trServiceReference(const DString &sName)=0
virtual DString trCustomReference(const DString &name)=0
virtual DString trSingletonReference(const DString &sName)=0
virtual DString trCompoundReferenceFortran(const DString &clName, ClassDef::CompoundType compType, bool isTemplate)=0
virtual DString trEnumReference(const DString &name)=0
static DString getClassTitle(const ClassDef *)
DString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
Definition util.cpp:864

References argListToString(), ClassDef::Class, Config_getBool, displayName(), ArgumentList::empty(), VhdlDocGen::getClassTitle(), DefinitionMixin< ClassDefMutable >::getLanguage(), ClassDef::Interface, isJavaEnum(), isSliceLocal(), m_compType, m_primaryConstructorParams, m_tempArgs, ClassDef::Service, ClassDef::Singleton, theTranslator, Translator::trCompoundReference(), Translator::trCompoundReferenceFortran(), Translator::trCompoundReferenceSlice(), Translator::trCustomReference(), Translator::trEnumReference(), Translator::trServiceReference(), and Translator::trSingletonReference().

Referenced by addUsedInterfaceClasses(), getTitleForMemberListType(), internalInsertMember(), writeDetailedDescription(), writeDocumentation(), writeInheritedMemberDeclarations(), writeMemberDeclarations(), writeMemberDocumentation(), and writeNestedClasses().

◆ typeConstraints()

const ArgumentList & ClassDefImpl::typeConstraints ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5484 of file classdef.cpp.

5485{
5486 return m_typeConstraints;
5487}

References m_typeConstraints.

Referenced by hasDetailedDescription().

◆ updateBaseClasses()

void ClassDefImpl::updateBaseClasses ( const BaseClassList & bcd)
overridevirtual

Update the list of base classes to the one passed.

Implements ClassDef.

Definition at line 5090 of file classdef.cpp.

5091{
5092 m_inherits = bcd;
5093}

References m_inherits.

◆ updateSubClasses()

void ClassDefImpl::updateSubClasses ( const BaseClassList & bcd)
overridevirtual

Update the list of sub classes to the one passed.

Implements ClassDef.

Definition at line 5100 of file classdef.cpp.

5101{
5102 m_inheritedBy = bcd;
5103}

References m_inheritedBy.

◆ usedByImplementationClasses()

const UsesClassList & ClassDefImpl::usedByImplementationClasses ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5175 of file classdef.cpp.

5176{
5177 return m_usedByImplClassList;
5178}

References m_usedByImplClassList.

◆ usedFiles()

const FileList & ClassDefImpl::usedFiles ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5479 of file classdef.cpp.

5480{
5481 return m_files;
5482}

References m_files.

◆ usedImplementationClasses()

const UsesClassList & ClassDefImpl::usedImplementationClasses ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5170 of file classdef.cpp.

5171{
5172 return m_usesImplClassList;
5173}

References m_usesImplClassList.

◆ visibleInParentsDeclList()

bool ClassDefImpl::visibleInParentsDeclList ( ) const
overridevirtual

show this class in the declaration section of its parent?

Implements ClassDef.

Definition at line 2648 of file classdef.cpp.

2649{
2650 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2651 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
2652 bool extractLocalClasses = Config_getBool(EXTRACT_LOCAL_CLASSES);
2653 bool linkable = isLinkable();
2654 return (!isAnonymous() && !isExtension() &&
2655 (protection()!=Protection::Private || extractPrivate) &&
2656 (linkable || (!hideUndocClasses && (!isLocal() || extractLocalClasses)))
2657 );
2658}
bool isLocal() const override
Returns true if this is a local class definition, see EXTRACT_LOCAL_CLASSES.
bool isLinkable() const override
Protection protection() const override
Return the protection level (Public,Protected,Private) in which this compound was found.

References Config_getBool, DefinitionMixin< ClassDefMutable >::isAnonymous(), isExtension(), isLinkable(), isLocal(), and protection().

Referenced by writeDeclarationLink().

◆ writeAdditionalInheritedMembers()

void ClassDefImpl::writeAdditionalInheritedMembers ( OutputList & ol) const
private

Definition at line 4899 of file classdef.cpp.

4900{
4901 //printf("**** writeAdditionalInheritedMembers()\n");
4902 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4903 {
4904 if (lde->kind()==LayoutDocEntry::MemberDecl)
4905 {
4906 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4907 if (lmd && lmd->type!=MemberListType::Friends())
4908 {
4909 ClassDefSet visited;
4910 writeInheritedMemberDeclarations(ol,visited,lmd->type,MemberListType::Invalid(),lmd->title(getLanguage()),this,true,false);
4911 }
4912 }
4913 }
4914}
void writeInheritedMemberDeclarations(OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, MemberListType lt2, const DString &title, const ClassDef *inheritedFrom, bool invert, bool showAlways) const

References DefinitionMixin< ClassDefMutable >::getLanguage(), LayoutDocManager::instance(), MemberListType::Invalid(), LayoutDocEntryMemberDecl::title(), LayoutDocEntryMemberDecl::type, and writeInheritedMemberDeclarations().

Referenced by endMemberDeclarations().

◆ writeAuthorSection()

void ClassDefImpl::writeAuthorSection ( OutputList & ol) const
private

Definition at line 2291 of file classdef.cpp.

2292{
2293 ol.pushGeneratorState();
2295 ol.writeString("\n");
2296 ol.startGroupHeader();
2297 ol.parseText(theTranslator->trAuthor(true,true));
2298 ol.endGroupHeader();
2300 ol.popGeneratorState();
2301}
void writeString(const DString &text)
Definition outputlist.h:407
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:451
void startGroupHeader(const DString &id=DString(), int extraLevels=0)
Definition outputlist.h:449
virtual DString trAuthor(bool first_capital, bool singular)=0
virtual DString trGeneratedAutomatically(const DString &s)=0
#define Config_getString(name)
Definition config.h:32

References Config_getString, OutputList::disableAllBut(), OutputList::endGroupHeader(), Man, OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startGroupHeader(), theTranslator, Translator::trAuthor(), Translator::trGeneratedAutomatically(), and OutputList::writeString().

Referenced by writeDocumentationContents().

◆ writeBriefDescription()

void ClassDefImpl::writeBriefDescription ( OutputList & ol,
bool exampleFlag ) const
private

Definition at line 1600 of file classdef.cpp.

1601{
1602 if (hasBriefDescription())
1603 {
1604 ol.startParagraph();
1605 ol.pushGeneratorState();
1607 ol.writeString(" - ");
1608 ol.popGeneratorState();
1610 briefLine(),
1611 this,
1612 nullptr,
1614 DocOptions()
1615 .setIndexWords(true)
1616 .setSingleLine(true));
1617 ol.pushGeneratorState();
1619 ol.writeString(" \n");
1621 ol.popGeneratorState();
1622
1623 if (hasDetailedDescription() || exampleFlag)
1624 {
1625 writeMoreLink(ol,anchor());
1626 }
1627
1628 ol.endParagraph();
1629 }
1630 ol.writeSynopsis();
1631}
void writeMoreLink(OutputList &ol, const DString &anchor) const
bool hasDetailedDescription() const override
returns true if this class has a non-empty detailed description
bool hasBriefDescription() const override
void writeSynopsis()
Definition outputlist.h:588
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)

References anchor(), DefinitionMixin< ClassDefMutable >::briefDescription(), DefinitionMixin< ClassDefMutable >::briefFile(), DefinitionMixin< ClassDefMutable >::briefLine(), OutputList::disable(), OutputList::disableAllBut(), OutputList::enable(), OutputList::endParagraph(), OutputList::generateDoc(), DefinitionMixin< ClassDefMutable >::hasBriefDescription(), hasDetailedDescription(), Man, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), RTF, OutputList::startParagraph(), writeMoreLink(), OutputList::writeString(), and OutputList::writeSynopsis().

Referenced by writeDocumentationContents().

◆ writeCollaborationGraph()

void ClassDefImpl::writeCollaborationGraph ( OutputList & ol) const
private

Definition at line 2018 of file classdef.cpp.

2019{
2020 if (Config_getBool(HAVE_DOT) && m_hasCollaborationGraph /*&& Config_getBool(COLLABORATION_GRAPH)*/)
2021 {
2022 DotClassGraph usageImplGraph(this,GraphType::Collaboration);
2023 if (usageImplGraph.isTooBig())
2024 {
2025 warn_uncond("Collaboration graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
2026 name(), usageImplGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
2027 }
2028 else if (!usageImplGraph.isTrivial())
2029 {
2030 ol.pushGeneratorState();
2032 ol.startDotGraph();
2034 ol.endDotGraph(usageImplGraph);
2035 ol.popGeneratorState();
2036 }
2037 }
2038}
void endDotGraph(DotClassGraph &g)
Definition outputlist.h:646
void startDotGraph()
Definition outputlist.h:644
virtual DString trCollaborationDiagram(const DString &clName)=0
#define Config_getInt(name)
Definition config.h:34
@ Collaboration
Definition dotgraph.h:31
#define warn_uncond(fmt,...)
Definition message.h:122

References Collaboration, Config_getBool, Config_getInt, OutputList::disable(), displayName(), OutputList::endDotGraph(), DotClassGraph::isTooBig(), DotClassGraph::isTrivial(), m_hasCollaborationGraph, Man, DefinitionMixin< ClassDefMutable >::name(), DotClassGraph::numNodes(), OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startDotGraph(), theTranslator, Translator::trCollaborationDiagram(), and warn_uncond.

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ writeDeclaration()

void ClassDefImpl::writeDeclaration ( OutputList & ol,
bool inGroup,
int indentLevel,
const ClassDef * inheritedFrom,
const DString & inheritId ) const
overridevirtual

called from MemberDef::writeDeclaration() to (recursively) write the definition of an anonymous struct, union or class.

Implements ClassDef.

Definition at line 3634 of file classdef.cpp.

3636{
3637 //printf("ClassName='%s' inGroup=%d\n",qPrint(name()),inGroup);
3638
3640 ol.docify(" {");
3642 ol.endMemberDeclaration(DString(),inheritId);
3643
3644 // write user defined member groups
3645 for (const auto &mg : m_memberGroups)
3646 {
3647 mg->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
3648 }
3649
3650 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3651 {
3652 if (lde->kind()==LayoutDocEntry::MemberDecl)
3653 {
3654 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
3655 if (lmd)
3656 {
3657 writePlainMemberDeclaration(ol,lmd->type,inGroup,indentLevel,inheritedFrom,inheritId);
3658 }
3659 }
3660 }
3661}
void writePlainMemberDeclaration(OutputList &ol, MemberListType lt, bool inGroup, int indentLevel, const ClassDef *inheritedFrom, const DString &inheritId) const
DString compoundTypeString() const override
Returns the type of compound as a string.
void endMemberDeclaration(const DString &anchor, const DString &inheritId)
Definition outputlist.h:567
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:491

References OutputGenerator::AnonymousStart, compoundTypeString(), OutputList::docify(), OutputList::endMemberDeclaration(), OutputList::endMemberItem(), LayoutDocManager::instance(), m_memberGroups, LayoutDocEntryMemberDecl::type, and writePlainMemberDeclaration().

◆ writeDeclarationLink()

void ClassDefImpl::writeDeclarationLink ( OutputList & ol,
bool & found,
const DString & header,
bool localNames ) const
overridevirtual

Implements ClassDef.

Definition at line 2660 of file classdef.cpp.

2661{
2662 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2663 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2664 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2665 SrcLangExt lang = getLanguage();
2667 {
2668 if (!found) // first class
2669 {
2670 if (sliceOpt)
2671 {
2672 if (compoundType()==Interface)
2673 {
2674 ol.startMemberHeader("interfaces");
2675 }
2676 else if (compoundType()==Struct)
2677 {
2678 ol.startMemberHeader("structs");
2679 }
2680 else if (compoundType()==Record)
2681 {
2682 ol.startMemberHeader("records");
2683 }
2684 else if (compoundType()==Exception)
2685 {
2686 ol.startMemberHeader("exceptions");
2687 }
2688 else // compoundType==Class
2689 {
2690 ol.startMemberHeader("nested-classes");
2691 }
2692 }
2693 else // non-Slice optimization: single header for class/struct/..
2694 {
2695 ol.startMemberHeader("nested-classes");
2696 }
2697 if (!header.empty())
2698 {
2699 ol.parseText(header);
2700 }
2701 else if (lang==SrcLangExt::VHDL)
2702 {
2704 }
2705 else
2706 {
2707 ol.parseText(lang==SrcLangExt::Fortran ?
2710 }
2711 ol.endMemberHeader();
2712 ol.startMemberList();
2713 found=true;
2714 }
2716 DString ctype = compoundTypeString();
2717 DString cname = displayName(!localNames);
2718 DString anc = anchor();
2719 if (anc.empty()) anc = cname; else anc.prepend(cname+"_");
2721
2722 if (lang!=SrcLangExt::VHDL) // for VHDL we swap the name and the type
2723 {
2724 if (isSliceLocal())
2725 {
2726 ol.writeString("local ");
2727 }
2728 ol.writeString(ctype);
2729 ol.writeString(" ");
2730 ol.insertMemberAlign();
2731 }
2732 if (isLinkable())
2733 {
2736 anchor(),
2737 cname
2738 );
2739 }
2740 else
2741 {
2742 ol.startBold();
2743 ol.docify(cname);
2744 ol.endBold();
2745 }
2746 if (lang==SrcLangExt::VHDL) // now write the type
2747 {
2748 ol.writeString(" ");
2749 ol.insertMemberAlign();
2751 }
2753
2754 // add the brief description if available
2755 if (!briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
2756 {
2757 auto parser { createDocParser() };
2758 auto ast { validatingParseDoc(*parser.get(),
2759 briefFile(),
2760 briefLine(),
2761 this,
2762 nullptr,
2764 DocOptions()
2765 .setSingleLine(true))
2766 };
2767 if (!ast->empty())
2768 {
2770 ol.writeDoc(ast.get(),this,nullptr);
2771 if (isLinkableInProject())
2772 {
2773 writeMoreLink(ol,anchor());
2774 }
2776 }
2777 }
2778 ol.endMemberDeclaration(anchor(),DString());
2779 }
2780}
DString getReference() const override
bool visibleInParentsDeclList() const override
show this class in the declaration section of its parent?
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:379
void startMemberDeclaration()
Definition outputlist.h:565
void endMemberDescription()
Definition outputlist.h:563
void insertMemberAlign(bool templ=false)
Definition outputlist.h:513
void startMemberList()
Definition outputlist.h:477
void startMemberItem(const DString &anchor, OutputGenerator::MemberItemType type, const DString &id=DString())
Definition outputlist.h:489
void startMemberDescription(const DString &anchor, const DString &inheritId=DString(), bool typ=false)
Definition outputlist.h:561
virtual DString trCompounds()=0
virtual DString trDataTypes()=0
static DString getProtectionName(int prot)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:59
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &input, const DocOptions &options)

References anchor(), ARCHITECTURE, DefinitionMixin< ClassDefMutable >::briefDescription(), DefinitionMixin< ClassDefMutable >::briefFile(), DefinitionMixin< ClassDefMutable >::briefLine(), compoundType(), compoundTypeString(), Config_getBool, VhdlDocGen::convert(), createDocParser(), displayName(), OutputList::docify(), DString::empty(), OutputList::endBold(), OutputList::endMemberDeclaration(), OutputList::endMemberDescription(), OutputList::endMemberHeader(), OutputList::endMemberItem(), ClassDef::Exception, DefinitionMixin< ClassDefMutable >::getLanguage(), getOutputFileBase(), VhdlDocGen::getProtectionName(), getReference(), OutputList::insertMemberAlign(), ClassDef::Interface, isLinkable(), isLinkableInProject(), isSliceLocal(), OutputGenerator::Normal, OutputList::parseText(), DString::prepend(), protection(), ClassDef::Record, OutputList::startBold(), OutputList::startMemberDeclaration(), OutputList::startMemberDescription(), OutputList::startMemberHeader(), OutputList::startMemberItem(), OutputList::startMemberList(), ClassDef::Struct, theTranslator, Translator::trCompounds(), Translator::trDataTypes(), Translator::trVhdlType(), validatingParseDoc(), visibleInParentsDeclList(), OutputList::writeDoc(), writeMoreLink(), OutputList::writeObjectLink(), and OutputList::writeString().

◆ writeDetailedDescription()

void ClassDefImpl::writeDetailedDescription ( OutputList & ol,
const DString & pageType,
bool exampleFlag,
const DString & title,
const DString & anchor = DString() ) const
private

Definition at line 1710 of file classdef.cpp.

1712{
1713 if (hasDetailedDescription() || exampleFlag)
1714 {
1715 ol.pushGeneratorState();
1717 ol.writeRuler();
1718 ol.popGeneratorState();
1719
1720 ol.pushGeneratorState();
1722 ol.writeAnchor(DString(),anchor.empty() ? DString("details") : anchor);
1723 ol.popGeneratorState();
1724
1725 if (!anchor.empty())
1726 {
1727 ol.pushGeneratorState();
1731 ol.popGeneratorState();
1732 }
1733
1734 ol.startGroupHeader("details");
1735 ol.parseText(title);
1736 ol.endGroupHeader();
1737
1739 }
1740 else
1741 {
1742 //writeTemplateSpec(ol,this,pageType);
1743 }
1744}
void writeDetailedDocumentationBody(OutputList &ol) const
void writeAnchor(const DString &fileName, const DString &name)
Definition outputlist.h:519

References anchor(), OutputList::disable(), OutputList::disableAllBut(), DString::empty(), OutputList::endGroupHeader(), getOutputFileBase(), hasDetailedDescription(), Html, Man, OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startGroupHeader(), title(), OutputList::writeAnchor(), writeDetailedDocumentationBody(), and OutputList::writeRuler().

Referenced by writeDocumentationContents().

◆ writeDetailedDocumentationBody()

void ClassDefImpl::writeDetailedDocumentationBody ( OutputList & ol) const
private

Definition at line 1633 of file classdef.cpp.

1634{
1635 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1636
1637 ol.startTextBlock();
1638
1639 if (getLanguage()==SrcLangExt::Cpp)
1640 {
1641 writeTemplateSpec(ol,this,compoundTypeString(),SrcLangExt::Cpp);
1642 }
1643
1644 // repeat brief description
1645 if (!briefDescription().empty() && repeatBrief)
1646 {
1648 briefLine(),
1649 this,
1650 nullptr,
1652 DocOptions());
1653 }
1654 if (!briefDescription().empty() && repeatBrief &&
1655 !documentation().empty())
1656 {
1657 ol.pushGeneratorState();
1659 ol.writeString("\n\n");
1660 ol.popGeneratorState();
1661 }
1662 // write documentation
1663 if (!documentation().empty())
1664 {
1665 ol.generateDoc(docFile(),
1666 docLine(),
1667 this,
1668 nullptr,
1669 documentation(),
1670 DocOptions()
1671 .setIndexWords(true));
1672 }
1673 // write type constraints
1675
1676 ol.generateDoc(
1677 docFile(),docLine(),
1678 this,
1679 nullptr, // memberDef
1681 DocOptions()
1682 .setIndexWords(true));
1683
1684 // write examples
1685 if (hasExamples())
1686 {
1687 ol.startExamples();
1688 ol.startDescForItem();
1690 ol.endDescForItem();
1691 ol.endExamples();
1692 }
1693 writeSourceDef(ol);
1695 ol.endTextBlock();
1696}
void writeTemplateSpec(OutputList &ol, const Definition *d, const DString &type, SrcLangExt lang) const
bool hasExamples() const override
void writeSourceDef(OutputList &ol) const override
void writeRequirementRefs(OutputList &ol) const override
void endTextBlock(bool paraBreak=false)
Definition outputlist.h:668
void endDescForItem()
Definition outputlist.h:545
void endExamples()
Definition outputlist.h:576
void startExamples()
Definition outputlist.h:574
void startDescForItem()
Definition outputlist.h:543
void startTextBlock(bool dense=false)
Definition outputlist.h:666
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
Definition util.cpp:4415
DString inlineTemplateArgListToDoc(const ArgumentList &al)
Definition util.cpp:837
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:809

References DefinitionMixin< ClassDefMutable >::briefDescription(), DefinitionMixin< ClassDefMutable >::briefFile(), DefinitionMixin< ClassDefMutable >::briefLine(), compoundTypeString(), Config_getBool, OutputList::disable(), DefinitionMixin< ClassDefMutable >::docFile(), DefinitionMixin< ClassDefMutable >::docLine(), DefinitionMixin< ClassDefMutable >::documentation(), OutputList::endDescForItem(), OutputList::endExamples(), OutputList::endTextBlock(), OutputList::generateDoc(), DefinitionMixin< ClassDefMutable >::getLanguage(), hasExamples(), DefinitionMixin< ClassDefMutable >::hasRequirementRefs(), Html, inlineTemplateArgListToDoc(), m_examples, m_tempArgs, m_typeConstraints, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startDescForItem(), OutputList::startExamples(), OutputList::startTextBlock(), writeExamples(), DefinitionMixin< ClassDefMutable >::writeRequirementRefs(), DefinitionMixin< ClassDefMutable >::writeSourceDef(), OutputList::writeString(), writeTemplateSpec(), and writeTypeConstraints().

Referenced by writeDetailedDescription(), and writeInlineDocumentation().

◆ writeDocumentation()

void ClassDefImpl::writeDocumentation ( OutputList & ol) const
overridevirtual

Implements ClassDef.

Definition at line 3030 of file classdef.cpp.

3031{
3032 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3033 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3034 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3035 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3036 DString pageTitle = title();
3037
3039 if (sliceOpt)
3040 {
3041 if (compoundType()==Interface)
3042 {
3044 }
3045 else if (compoundType()==Struct)
3046 {
3048 }
3049 else if (compoundType()==Record)
3050 {
3052 }
3053 else if (compoundType()==Exception)
3054 {
3056 }
3057 else
3058 {
3060 }
3061 }
3062 else
3063 {
3065 }
3066
3067 AUTO_TRACE("name='{}' getOutputFileBase='{}'",name(),getOutputFileBase());
3068 bool hasAllMembersLink=false;
3069 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3070 {
3071 if (lde->kind()==LayoutDocEntry::ClassAllMembersLink)
3072 {
3073 hasAllMembersLink = true;
3074 break;
3075 }
3076 }
3077 DString memListFile;
3078 if (hasAllMembersLink && !m_allMemberNameInfoLinkedMap.empty() && !Config_getBool(OPTIMIZE_OUTPUT_FOR_C))
3079 {
3080 memListFile = getMemberListFileName();
3081 }
3082 startFile(ol,getOutputFileBase(),false,name(),pageTitle,hli,!generateTreeView,DString(),0,memListFile);
3083 if (!generateTreeView)
3084 {
3086 {
3088 }
3089 ol.endQuickIndices();
3090 }
3091
3092 startTitle(ol,getOutputFileBase(),this);
3093 ol.parseText(pageTitle);
3095 addGroupListToTitle(ol,this);
3097 writeDocumentationContents(ol,pageTitle);
3098
3099 endFileWithNavPath(ol,this);
3100
3101 if (Config_getBool(SEPARATE_MEMBER_PAGES))
3102 {
3103 writeMemberPages(ol);
3104 }
3105}
DString getMemberListFileName() const override
void addClassAttributes(OutputList &ol) const
void writeMemberPages(OutputList &ol) const override
void writeDocumentationContents(OutputList &ol, const DString &pageTitle) const
void writeNavigationPath(OutputList &ol) const override
bool empty() const
Definition linkedmap.h:209
void endQuickIndices()
Definition outputlist.h:600
void endTitle(OutputList &ol, const DString &fileName, const DString &name)
Definition index.cpp:404
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:458
void startTitle(OutputList &ol, const DString &fileName, const DefinitionMutable *def)
Definition index.cpp:394
void startFile(OutputList &ol, const DString &name, bool isSource, const DString &manName, const DString &title, HighlightedItem hli, bool additionalIndices, const DString &altSidebarName, int hierarchyLevel, const DString &allMembersFile)
Definition index.cpp:411
HighlightedItem
Definition index.h:58
@ InterfaceVisible
Definition index.h:90
@ ExceptionVisible
Definition index.h:93
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:4053

References addClassAttributes(), addGroupListToTitle(), AUTO_TRACE, ClassVisible, compoundType(), Config_getBool, displayName(), LinkedMap< T, Hash, KeyEqual, Map >::empty(), endFileWithNavPath(), OutputList::endQuickIndices(), endTitle(), ClassDef::Exception, ExceptionVisible, getMemberListFileName(), DefinitionMixin< ClassDefMutable >::getOuterScope(), getOutputFileBase(), Doxygen::globalScope, LayoutDocManager::instance(), ClassDef::Interface, InterfaceVisible, m_allMemberNameInfoLinkedMap, DefinitionMixin< ClassDefMutable >::name(), None, OutputList::parseText(), ClassDef::Record, RecordVisible, startFile(), startTitle(), ClassDef::Struct, StructVisible, title(), writeDocumentationContents(), writeMemberPages(), and DefinitionMixin< ClassDefMutable >::writeNavigationPath().

◆ writeDocumentationContents()

void ClassDefImpl::writeDocumentationContents ( OutputList & ol,
const DString & pageTitle ) const
private

Definition at line 2817 of file classdef.cpp.

2818{
2819 ol.startContents();
2820
2821 DString pageType = " ";
2822 pageType += compoundTypeString();
2823
2824 bool exampleFlag=hasExamples();
2825
2826 //---------------------------------------- start flexible part -------------------------------
2827
2828 SrcLangExt lang = getLanguage();
2829
2830 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2831 {
2832 switch (lde->kind())
2833 {
2834 case LayoutDocEntry::BriefDesc:
2835 writeBriefDescription(ol,exampleFlag);
2836 break;
2837 case LayoutDocEntry::Includes:
2838 if (lang==SrcLangExt::Slice)
2839 {
2841 }
2842 else
2843 {
2845 }
2846 break;
2847 case LayoutDocEntry::ClassInheritanceGraph:
2849 break;
2850 case LayoutDocEntry::ClassCollaborationGraph:
2852 break;
2853 case LayoutDocEntry::ClassAllMembersLink:
2854 //writeAllMembersLink(ol); // this is now part of the summary links
2855 break;
2856 case LayoutDocEntry::MemberDeclStart:
2858 break;
2859 case LayoutDocEntry::MemberGroups:
2861 break;
2862 case LayoutDocEntry::MemberDecl:
2863 {
2864 ClassDefSet visitedClasses;
2865 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2866 if (lmd)
2867 {
2868 writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang));
2869 }
2870 }
2871 break;
2872 case LayoutDocEntry::ClassNestedClasses:
2873 {
2874 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2875 if (ls)
2876 {
2877 writeNestedClasses(ol,ls->title(lang));
2878 }
2879 }
2880 break;
2881 case LayoutDocEntry::MemberDeclEnd:
2883 break;
2884 case LayoutDocEntry::DetailedDesc:
2885 {
2886 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2887 if (ls)
2888 {
2889 writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang));
2890 }
2891 }
2892 break;
2893 case LayoutDocEntry::MemberDefStart:
2895 break;
2896 case LayoutDocEntry::ClassInlineClasses:
2898 break;
2899 case LayoutDocEntry::MemberDef:
2900 {
2901 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2902 if (lmd)
2903 {
2904 writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
2905 }
2906 }
2907 break;
2908 case LayoutDocEntry::MemberDefEnd:
2910 break;
2911 case LayoutDocEntry::ClassUsedFiles:
2912 showUsedFiles(ol);
2913 break;
2914 case LayoutDocEntry::AuthorSection:
2916 break;
2917 case LayoutDocEntry::NamespaceNestedNamespaces:
2918 case LayoutDocEntry::NamespaceNestedConstantGroups:
2919 case LayoutDocEntry::NamespaceClasses:
2920 case LayoutDocEntry::NamespaceConcepts:
2921 case LayoutDocEntry::NamespaceInterfaces:
2922 case LayoutDocEntry::NamespaceStructs:
2923 case LayoutDocEntry::NamespaceRecords:
2924 case LayoutDocEntry::NamespaceExceptions:
2925 case LayoutDocEntry::NamespaceInlineClasses:
2926 case LayoutDocEntry::ConceptDefinition:
2927 case LayoutDocEntry::FileClasses:
2928 case LayoutDocEntry::FileConcepts:
2929 case LayoutDocEntry::FileInterfaces:
2930 case LayoutDocEntry::FileStructs:
2931 case LayoutDocEntry::FileRecords:
2932 case LayoutDocEntry::FileExceptions:
2933 case LayoutDocEntry::FileNamespaces:
2934 case LayoutDocEntry::FileConstantGroups:
2935 case LayoutDocEntry::FileIncludeGraph:
2936 case LayoutDocEntry::FileIncludedByGraph:
2937 case LayoutDocEntry::FileSourceLink:
2938 case LayoutDocEntry::FileInlineClasses:
2939 case LayoutDocEntry::GroupClasses:
2940 case LayoutDocEntry::GroupConcepts:
2941 case LayoutDocEntry::GroupModules:
2942 case LayoutDocEntry::GroupInlineClasses:
2943 case LayoutDocEntry::GroupNamespaces:
2944 case LayoutDocEntry::GroupDirs:
2945 case LayoutDocEntry::GroupNestedGroups:
2946 case LayoutDocEntry::GroupFiles:
2947 case LayoutDocEntry::GroupGraph:
2948 case LayoutDocEntry::GroupPageDocs:
2949 case LayoutDocEntry::ModuleExports:
2950 case LayoutDocEntry::ModuleClasses:
2951 case LayoutDocEntry::ModuleConcepts:
2952 case LayoutDocEntry::ModuleUsedFiles:
2953 case LayoutDocEntry::DirSubDirs:
2954 case LayoutDocEntry::DirFiles:
2955 case LayoutDocEntry::DirGraph:
2956 err("Internal inconsistency: member '{}' should not be part of LayoutDocManager::Class entry list\n",lde->entryToString());
2957 break;
2958 }
2959 }
2960
2961 ol.endContents();
2962}
void writeIncludeFilesForSlice(OutputList &ol) const
void writeInheritanceGraph(OutputList &ol) const
void writeBriefDescription(OutputList &ol, bool exampleFlag) const
void writeInlineClasses(OutputList &ol) const
void endMemberDeclarations(OutputList &ol) const
void writeNestedClasses(OutputList &ol, const DString &title) const
void writeCollaborationGraph(OutputList &ol) const
void writeAuthorSection(OutputList &ol) const
void endMemberDocumentation(OutputList &ol) const
void writeMemberDeclarations(OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, const DString &title, const DString &subTitle=DString(), bool showInline=false, const ClassDef *inheritedFrom=nullptr, MemberListType lt2=MemberListType::Invalid(), bool invert=false, bool showAlways=false) const override
void writeIncludeFiles(OutputList &ol) const
void startMemberDeclarations(OutputList &ol) const
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const DString &title, bool showInline=false) const
void showUsedFiles(OutputList &ol) const
void writeMemberGroups(OutputList &ol, bool showInline=false) const
void writeDetailedDescription(OutputList &ol, const DString &pageType, bool exampleFlag, const DString &title, const DString &anchor=DString()) const
void startMemberDocumentation(OutputList &ol) const
void endContents()
Definition outputlist.h:616
void startContents()
Definition outputlist.h:614
MemberListType type
Definition layout.h:137
DString title(SrcLangExt lang) const
Definition layout.cpp:1839
DString title(SrcLangExt lang) const
Definition layout.cpp:1820

References compoundTypeString(), OutputList::endContents(), endMemberDeclarations(), endMemberDocumentation(), err, DefinitionMixin< ClassDefMutable >::getLanguage(), hasExamples(), LayoutDocManager::instance(), showUsedFiles(), OutputList::startContents(), startMemberDeclarations(), startMemberDocumentation(), LayoutDocEntryMemberDecl::subtitle(), LayoutDocEntryMemberDecl::title(), LayoutDocEntryMemberDef::title(), LayoutDocEntrySection::title(), LayoutDocEntryMemberDecl::type, LayoutDocEntryMemberDef::type, writeAuthorSection(), writeBriefDescription(), writeCollaborationGraph(), writeDetailedDescription(), writeIncludeFiles(), writeIncludeFilesForSlice(), writeInheritanceGraph(), writeInlineClasses(), writeMemberDeclarations(), writeMemberDocumentation(), writeMemberGroups(), and writeNestedClasses().

Referenced by writeDocumentation().

◆ writeDocumentationForInnerClasses()

void ClassDefImpl::writeDocumentationForInnerClasses ( OutputList & ol) const
overridevirtual

Implements ClassDef.

Definition at line 3172 of file classdef.cpp.

3173{
3174 // write inner classes after the parent, so the tag files contain
3175 // the definition in proper order!
3176 for (const auto &innerCd : m_innerClasses)
3177 {
3178 if (
3179 innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
3180 protectionLevelVisible(innerCd->protection()) &&
3181 !innerCd->isEmbeddedInOuterScope()
3182 )
3183 {
3184 msg("Generating docs for nested compound {}...\n",innerCd->displayName());
3185 innerCd->writeDocumentation(ol);
3186 innerCd->writeMemberList(ol);
3187 }
3188 innerCd->writeDocumentationForInnerClasses(ol);
3189 }
3190}
#define msg(fmt,...)
Definition message.h:94

References m_innerClasses, msg, and protectionLevelVisible().

◆ writeIncludeFiles()

void ClassDefImpl::writeIncludeFiles ( OutputList & ol) const
private

Definition at line 2186 of file classdef.cpp.

2187{
2188 if (m_incInfo /*&& Config_getBool(SHOW_HEADERFILE)*/)
2189 {
2190 SrcLangExt lang = getLanguage();
2191 DString nm=m_incInfo->includeName.empty() ?
2192 (m_incInfo->fileDef ?
2193 m_incInfo->fileDef->docName() : DString()
2194 ) :
2195 m_incInfo->includeName;
2196 if (!nm.empty())
2197 {
2198 ol.startParagraph();
2199 ol.startTypewriter();
2200 ol.docify(::includeStatement(lang,m_incInfo->kind));
2201 ol.docify(::includeOpen(lang,m_incInfo->kind));
2202 ol.pushGeneratorState();
2204 ol.docify(nm);
2207 if (m_incInfo->fileDef)
2208 {
2209 ol.writeObjectLink(DString(),m_incInfo->fileDef->includeName(),DString(),nm);
2210 }
2211 else
2212 {
2213 ol.docify(nm);
2214 }
2215 ol.popGeneratorState();
2216 ol.docify(::includeClose(lang,m_incInfo->kind));
2217 ol.endTypewriter();
2218 ol.endParagraph();
2219 }
2220 }
2221}
void startTypewriter()
Definition outputlist.h:445
void endTypewriter()
Definition outputlist.h:447
DString includeClose(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:82
DString includeOpen(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:69
DString includeStatement(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:52

References OutputList::disable(), OutputList::disableAllBut(), OutputList::docify(), DString::empty(), OutputList::enable(), OutputList::endParagraph(), OutputList::endTypewriter(), DefinitionMixin< ClassDefMutable >::getLanguage(), Html, includeClose(), includeOpen(), includeStatement(), m_incInfo, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startParagraph(), OutputList::startTypewriter(), and OutputList::writeObjectLink().

Referenced by writeDocumentationContents().

◆ writeIncludeFilesForSlice()

void ClassDefImpl::writeIncludeFilesForSlice ( OutputList & ol) const
private

Definition at line 2041 of file classdef.cpp.

2042{
2043 if (m_incInfo)
2044 {
2045 DString nm;
2046 StringVector paths = Config_getList(STRIP_FROM_PATH);
2047 if (!paths.empty() && m_incInfo->fileDef)
2048 {
2049 DString abs = m_incInfo->fileDef->absFilePath();
2050 DString potential;
2051 size_t length = 0;
2052 for (const auto &s : paths)
2053 {
2054 FileInfo info(s);
2055 if (info.exists())
2056 {
2057 DString prefix = info.absFilePath();
2058 if (prefix.at(prefix.length() - 1) != '/')
2059 {
2060 prefix += '/';
2061 }
2062
2063 if (prefix.length() > length &&
2064 dstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare
2065 {
2066 length = prefix.length();
2067 potential = abs.mid(prefix.length());
2068 }
2069 }
2070 }
2071
2072 if (length > 0)
2073 {
2074 nm = potential;
2075 }
2076 }
2077
2078 if (nm.empty())
2079 {
2080 nm = m_incInfo->includeName;
2081 }
2082
2083 ol.startParagraph();
2084 ol.docify(theTranslator->trDefinedIn()+" ");
2085 ol.startTypewriter();
2086 ol.docify("<");
2087 if (m_incInfo->fileDef)
2088 {
2089 ol.writeObjectLink(DString(),m_incInfo->fileDef->includeName(),DString(),nm);
2090 }
2091 else
2092 {
2093 ol.docify(nm);
2094 }
2095 ol.docify(">");
2096 ol.endTypewriter();
2097 ol.endParagraph();
2098 }
2099
2100 // Write a summary of the Slice definition including metadata.
2101 ol.startParagraph();
2102 ol.startTypewriter();
2103 if (!m_metaData.empty())
2104 {
2105 ol.docify(m_metaData);
2106 ol.lineBreak();
2107 }
2108 if (m_spec.isLocal())
2109 {
2110 ol.docify("local ");
2111 }
2112 if (m_spec.isInterface())
2113 {
2114 ol.docify("interface ");
2115 }
2116 else if (m_spec.isStruct())
2117 {
2118 ol.docify("struct ");
2119 }
2120 else if (m_spec.isRecord())
2121 {
2122 ol.docify("record ");
2123 }
2124 else if (m_spec.isException())
2125 {
2126 ol.docify("exception ");
2127 }
2128 else
2129 {
2130 ol.docify("class ");
2131 }
2132 ol.docify(stripScope(name()));
2133 if (!m_inherits.empty())
2134 {
2135 if (m_spec.isInterface() || m_spec.isException())
2136 {
2137 ol.docify(" extends ");
2138 bool first=true;
2139 for (const auto &ibcd : m_inherits)
2140 {
2141 if (!first) ol.docify(", ");
2142 ClassDef *icd = ibcd.classDef;
2143 ol.docify(icd->name());
2144 first=false;
2145 }
2146 }
2147 else
2148 {
2149 // Must be a class.
2150 bool implements = false;
2151 for (const auto &ibcd : m_inherits)
2152 {
2153 ClassDef *icd = ibcd.classDef;
2154 if (icd->isInterface())
2155 {
2156 implements = true;
2157 }
2158 else
2159 {
2160 ol.docify(" extends ");
2161 ol.docify(icd->name());
2162 }
2163 }
2164 if (implements)
2165 {
2166 ol.docify(" implements ");
2167 bool first = true;
2168 for (const auto &ibcd : m_inherits)
2169 {
2170 ClassDef *icd = ibcd.classDef;
2171 if (icd->isInterface())
2172 {
2173 if (!first) ol.docify(", ");
2174 first = false;
2175 ol.docify(icd->name());
2176 }
2177 }
2178 }
2179 }
2180 }
2181 ol.docify(" { ... }");
2182 ol.endTypewriter();
2183 ol.endParagraph();
2184}
constexpr auto prefix
Definition anchor.cpp:47
virtual bool isInterface() const =0
Returns true if this class represents an interface.
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:157
void lineBreak(const DString &style=DString())
Definition outputlist.h:555
virtual DString trDefinedIn()=0
#define Config_getList(name)
Definition config.h:38
int dstricmp(const char *s1, const char *s2)
Definition dstring.cpp:444
DString stripScope(const DString &name)
Definition util.cpp:3241

References FileInfo::absFilePath(), Config_getList, DString::data(), OutputList::docify(), dstricmp(), DString::empty(), OutputList::endParagraph(), OutputList::endTypewriter(), FileInfo::exists(), ClassDef::isInterface(), DString::left(), OutputList::lineBreak(), m_incInfo, m_inherits, m_metaData, m_spec, DString::mid(), Definition::name(), DefinitionMixin< ClassDefMutable >::name(), prefix, OutputList::startParagraph(), OutputList::startTypewriter(), stripScope(), theTranslator, Translator::trDefinedIn(), and OutputList::writeObjectLink().

Referenced by writeDocumentationContents().

◆ writeInheritanceGraph()

void ClassDefImpl::writeInheritanceGraph ( OutputList & ol) const
private

Definition at line 1883 of file classdef.cpp.

1884{
1885 bool haveDot = Config_getBool(HAVE_DOT);
1886 auto classGraph = m_typeInheritanceGraph;
1887
1888 if (classGraph == CLASS_GRAPH_t::NO) return;
1889 // count direct inheritance relations
1890 int count=countInheritanceNodes();
1891
1892 bool renderDiagram = false;
1893 if (haveDot && (classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH))
1894 // write class diagram using dot
1895 {
1896 DotClassGraph inheritanceGraph(this,GraphType::Inheritance);
1897 if (inheritanceGraph.isTooBig())
1898 {
1899 warn_uncond("Inheritance graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
1900 name(), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
1901 }
1902 else if (!inheritanceGraph.isTrivial())
1903 {
1904 ol.pushGeneratorState();
1906 ol.startDotGraph();
1908 ol.endDotGraph(inheritanceGraph);
1909 ol.popGeneratorState();
1910 renderDiagram = true;
1911 }
1912 }
1913 else if ((classGraph==CLASS_GRAPH_t::YES || classGraph==CLASS_GRAPH_t::GRAPH || classGraph==CLASS_GRAPH_t::BUILTIN) && count>0)
1914 // write class diagram using built-in generator
1915 {
1916 ClassDiagram diagram(this); // create a diagram of this class.
1917 ol.startClassDiagram();
1922 renderDiagram = true;
1923 }
1924
1925 if (renderDiagram) // if we already show the inheritance relations graphically,
1926 // then hide the text version
1927 {
1929 }
1930
1931 count = countInheritsNodes();
1932 if (count>0)
1933 {
1934 auto replaceFunc = [this,&ol](size_t entryIndex)
1935 {
1936 for (size_t index=0; index<m_inherits.size() ; index++)
1937 {
1938 const BaseClassDef &bcd=m_inherits[index];
1939 const ClassDef *cd=bcd.classDef;
1940
1941 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1942 {
1943 if (index==entryIndex) // found the requested index
1944 {
1945 // use the class name but with the template arguments as given
1946 // in the inheritance relation
1948 cd->displayName(),bcd.templSpecifiers);
1949
1950 if (cd->isLinkable())
1951 {
1953 cd->getOutputFileBase(),
1954 cd->anchor(),
1955 displayName);
1956 }
1957 else
1958 {
1959 ol.docify(displayName);
1960 }
1961 return;
1962 }
1963 }
1964 }
1965 };
1966
1967 ol.startParagraph();
1968 writeMarkerList(ol,
1970 static_cast<size_t>(count),
1971 replaceFunc);
1972 ol.endParagraph();
1973 }
1974
1975 // write subclasses
1976 count = countInheritedByNodes();
1977 if (count>0)
1978 {
1979 auto replaceFunc = [this,&ol](size_t entryIndex)
1980 {
1981 for (size_t index=0; index<m_inheritedBy.size() ; index++)
1982 {
1983 const BaseClassDef &bcd=m_inheritedBy[index];
1984 const ClassDef *cd=bcd.classDef;
1985 if (cd->isVisibleInHierarchy()) // filter on the class we want to show
1986 {
1987 if (index==entryIndex) // found the requested index
1988 {
1989 if (cd->isLinkable())
1990 {
1993 }
1994 else
1995 {
1996 ol.docify(cd->displayName());
1997 }
1998 return;
1999 }
2000 }
2001 }
2002 };
2003
2004 ol.startParagraph();
2005 writeMarkerList(ol,
2007 static_cast<size_t>(count),
2008 replaceFunc);
2009 ol.endParagraph();
2010 }
2011
2012 if (renderDiagram)
2013 {
2014 ol.enableAll();
2015 }
2016}
int countInheritanceNodes() const
virtual DString displayName(bool includeScope=true) const =0
virtual DString anchor() const =0
void startClassDiagram()
Definition outputlist.h:590
void endClassDiagram(const ClassDiagram &d, const DString &f, const DString &n)
Definition outputlist.h:592
void enableAll()
virtual DString trClassDiagram(const DString &clName)=0
virtual DString trInheritedByList(int numEntries)=0
virtual DString trInheritsList(int numEntries)=0
static void writeInheritanceSpecifier(OutputList &ol, const BaseClassDef &bcd)
@ Inheritance
Definition dotgraph.h:31
ClassDef * classDef
Class definition that this relation inherits from.
Definition classdef.h:56
DString templSpecifiers
Template arguments used for the base class.
Definition classdef.h:74
DString insertTemplateSpecifierInScope(const DString &scope, const DString &templ)
Definition util.cpp:3208
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition util.cpp:758

References Definition::anchor(), BaseClassDef::classDef, Config_getBool, Config_getInt, countInheritanceNodes(), countInheritedByNodes(), countInheritsNodes(), OutputList::disable(), OutputList::disableAllBut(), displayName(), Definition::displayName(), OutputList::docify(), OutputList::enable(), OutputList::enableAll(), OutputList::endClassDiagram(), OutputList::endDotGraph(), OutputList::endParagraph(), getOutputFileBase(), Definition::getOutputFileBase(), Definition::getReference(), Inheritance, insertTemplateSpecifierInScope(), Definition::isLinkable(), DotClassGraph::isTooBig(), DotClassGraph::isTrivial(), ClassDef::isVisibleInHierarchy(), m_inheritedBy, m_inherits, m_typeInheritanceGraph, Man, DefinitionMixin< ClassDefMutable >::name(), DotClassGraph::numNodes(), OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startClassDiagram(), OutputList::startDotGraph(), OutputList::startParagraph(), DString::str(), BaseClassDef::templSpecifiers, theTranslator, Translator::trClassDiagram(), Translator::trInheritedByList(), Translator::trInheritsList(), warn_uncond, writeInheritanceSpecifier(), writeMarkerList(), and OutputList::writeObjectLink().

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ writeInheritedMemberDeclarations()

void ClassDefImpl::writeInheritedMemberDeclarations ( OutputList & ol,
ClassDefSet & visitedClasses,
MemberListType lt,
MemberListType lt2,
const DString & title,
const ClassDef * inheritedFrom,
bool invert,
bool showAlways ) const
private

Definition at line 4941 of file classdef.cpp.

4944{
4945 int count = countMembersIncludingGrouped(lt,inheritedFrom,false);
4946 bool process = count>0;
4947 //printf("%s: writeInheritedMemberDec: lt=%s process=%d invert=%d always=%d\n",
4948 // qPrint(name()),qPrint(lt.to_string()),process,invert,showAlways);
4949 if ((process^invert) || showAlways)
4950 {
4951 for (const auto &ibcd : m_inherits)
4952 {
4953 ClassDefMutable *icd=toClassDefMutable(ibcd.classDef);
4954 if (icd && icd->isLinkable())
4955 {
4956 MemberListType lt1 = MemberListType::Invalid();
4957 MemberListType lt3 = MemberListType::Invalid();
4958 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt3);
4959 if (lt2.isInvalid() && !lt3.isInvalid())
4960 {
4961 lt2=lt3;
4962 }
4963 //printf("%s:convert %s->(%s,%s) prot=%d\n",qPrint(icd->name()),qPrint(lt.to_string()),
4964 // qPrint(lt1.to_string()),qPrint(lt2.to_string()),ibcd.prot);
4965 if (visitedClasses.find(icd)==visitedClasses.end())
4966 {
4967 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4968 if (!lt1.isInvalid())
4969 {
4970 //printf("--> writeMemberDeclarations for type %s\n",qPrint(lt1.to_string()));
4971 icd->writeMemberDeclarations(ol,visitedClasses,lt1,
4972 title,DString(),false,inheritedFrom,lt2,false,true);
4973 }
4974 }
4975 else
4976 {
4977 //printf("%s: class already visited!\n",qPrint(icd->name()));
4978 }
4979 }
4980 }
4981 }
4982}
virtual void writeMemberDeclarations(OutputList &ol, ClassDefSet &visitedClasses, MemberListType lt, const DString &title, const DString &subTitle=DString(), bool showInline=false, const ClassDef *inheritedFrom=nullptr, MemberListType lt2=MemberListType::Invalid(), bool invert=false, bool showAlways=false) const =0

References convertProtectionLevel(), countMembersIncludingGrouped(), MemberListType::Invalid(), MemberListType::isInvalid(), Definition::isLinkable(), m_inherits, title(), toClassDefMutable(), and ClassDef::writeMemberDeclarations().

Referenced by writeAdditionalInheritedMembers(), and writeMemberDeclarations().

◆ writeInlineClasses()

void ClassDefImpl::writeInlineClasses ( OutputList & ol) const
private

Definition at line 2246 of file classdef.cpp.

2247{
2249}
void writeDocumentation(OutputList &ol, const Definition *container=nullptr) const
Definition classlist.cpp:72

References m_innerClasses, and ClassLinkedRefMap::writeDocumentation().

Referenced by writeDocumentationContents().

◆ writeInlineDocumentation()

void ClassDefImpl::writeInlineDocumentation ( OutputList & ol) const
overridevirtual

Write class documentation inside another container (i.e. a group).

Implements ClassDef.

Definition at line 2483 of file classdef.cpp.

2484{
2485 bool isSimple = m_isSimple;
2486
2487 ol.addIndexItem(name(),DString());
2488 //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",qPrint(name()));
2489
2490 // part 1: anchor and title
2491 DString s = compoundTypeString()+" "+name();
2492
2493 // part 1a
2494 ol.pushGeneratorState();
2496 { // only HTML only
2497 ol.writeAnchor(DString(),anchor());
2498 ol.startMemberDoc(DString(),DString(),anchor(),name(),1,1,false);
2499 ol.startMemberDocName(false);
2500 ol.parseText(s);
2501 ol.endMemberDocName();
2502 ol.endMemberDoc(false);
2503 ol.writeString("</div>");
2504 ol.startIndent();
2505 }
2506 ol.popGeneratorState();
2507
2508 // part 1b
2509 ol.pushGeneratorState();
2512 { // for LaTeX/RTF only
2514 }
2515 ol.popGeneratorState();
2516
2517 // part 1c
2518 ol.pushGeneratorState();
2520 {
2521 // for LaTeX/RTF/Man
2522 ol.startGroupHeader("",1);
2523 ol.parseText(s);
2524 ol.endGroupHeader(1);
2525 }
2526 ol.popGeneratorState();
2527
2528 SrcLangExt lang=getLanguage();
2529
2530 // part 2: the header and detailed description
2531 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2532 {
2533 switch (lde->kind())
2534 {
2535 case LayoutDocEntry::BriefDesc:
2536 {
2537 // since we already shown the brief description in the
2538 // declaration part of the container, so we use this to
2539 // show the details on top.
2541 }
2542 break;
2543 case LayoutDocEntry::ClassInheritanceGraph:
2545 break;
2546 case LayoutDocEntry::ClassCollaborationGraph:
2548 break;
2549 case LayoutDocEntry::MemberDeclStart:
2551 break;
2552 case LayoutDocEntry::MemberDecl:
2553 {
2554 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2555 if (lmd)
2556 {
2557 ClassDefSet visitedClasses;
2558 if (!isSimple) writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang),true);
2559 }
2560 }
2561 break;
2562 case LayoutDocEntry::MemberGroups:
2563 if (!isSimple) writeMemberGroups(ol,true);
2564 break;
2565 case LayoutDocEntry::MemberDeclEnd:
2567 break;
2568 case LayoutDocEntry::MemberDefStart:
2570 break;
2571 case LayoutDocEntry::MemberDef:
2572 {
2573 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2574 if (lmd)
2575 {
2576 if (isSimple)
2577 {
2579 }
2580 else
2581 {
2582 writeMemberDocumentation(ol,lmd->type,lmd->title(lang),true);
2583 }
2584 }
2585 }
2586 break;
2587 case LayoutDocEntry::MemberDefEnd:
2589 break;
2590 default:
2591 break;
2592 }
2593 }
2594
2595 // part 3: close the block
2596 ol.pushGeneratorState();
2598 { // HTML only
2599 ol.endIndent();
2600 }
2601 ol.popGeneratorState();
2602}
void writeSimpleMemberDocumentation(OutputList &ol, MemberListType lt) const
void endIndent()
Definition outputlist.h:580
void startMemberDocName(bool align)
Definition outputlist.h:676
void endMemberDocName()
Definition outputlist.h:678
void endMemberDoc(bool hasArgs)
Definition outputlist.h:531
void addIndexItem(const DString &s1, const DString &s2)
Definition outputlist.h:586
void startMemberDoc(const DString &clName, const DString &memName, const DString &anchor, const DString &title, int memCount, int memTotal, bool showInline)
Definition outputlist.h:527
void startIndent()
Definition outputlist.h:578

References OutputList::addIndexItem(), anchor(), compoundTypeString(), OutputList::disable(), OutputList::disableAllBut(), OutputList::endGroupHeader(), OutputList::endIndent(), endMemberDeclarations(), OutputList::endMemberDoc(), OutputList::endMemberDocName(), endMemberDocumentation(), DefinitionMixin< ClassDefMutable >::getLanguage(), getOutputFileBase(), Html, LayoutDocManager::instance(), isSimple(), m_isSimple, Man, DefinitionMixin< ClassDefMutable >::name(), OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startGroupHeader(), OutputList::startIndent(), startMemberDeclarations(), OutputList::startMemberDoc(), OutputList::startMemberDocName(), startMemberDocumentation(), LayoutDocEntryMemberDecl::subtitle(), LayoutDocEntryMemberDecl::title(), LayoutDocEntryMemberDef::title(), LayoutDocEntryMemberDecl::type, LayoutDocEntryMemberDef::type, OutputList::writeAnchor(), writeCollaborationGraph(), writeDetailedDocumentationBody(), writeInheritanceGraph(), writeMemberDeclarations(), writeMemberDocumentation(), writeMemberGroups(), writeSimpleMemberDocumentation(), and OutputList::writeString().

◆ writeMemberDeclarations()

void ClassDefImpl::writeMemberDeclarations ( OutputList & ol,
ClassDefSet & visitedClasses,
MemberListType lt,
const DString & title,
const DString & subTitle = DString(),
bool showInline = false,
const ClassDef * inheritedFrom = nullptr,
MemberListType lt2 = MemberListType::Invalid(),
bool invert = false,
bool showAlways = false ) const
overridevirtual

Implements ClassDef.

Definition at line 4984 of file classdef.cpp.

4988{
4989 //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%s lt2=%s\n",qPrint(name()),qPrint(lt.to_string()),qPrint(lt2.to_string()));
4990 MemberList * ml = getMemberList(lt);
4991 MemberList * ml2 = getMemberList(lt2);
4992 if (getLanguage()==SrcLangExt::VHDL) // use specific declarations function
4993 {
4994 static const ClassDef *cdef;
4995 if (cdef!=this)
4996 { // only one inline link
4998 cdef=this;
4999 }
5000 if (ml)
5001 {
5002 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,this,nullptr,nullptr,nullptr);
5003 }
5004 }
5005 else
5006 {
5007 //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",qPrint(name()),qPrint(title),(void*)ml,(void*)ml2);
5008 DString tt = title, st = subTitle;
5009 if (ml)
5010 {
5011 //printf(" writeDeclarations ml type=%s count=%d\n",qPrint(lt.to_string()),ml->numDecMembers(inheritedFrom));
5012 ml->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,false,showInline,inheritedFrom,lt,true);
5013 tt.clear();
5014 st.clear();
5015 }
5016 if (ml2)
5017 {
5018 //printf(" writeDeclarations ml2 type=%s count=%d\n",qPrint(lt2.to_string()),ml2->numDecMembers(inheritedFrom));
5019 ml2->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,false,showInline,inheritedFrom,lt,ml==nullptr);
5020 }
5021 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
5022 if (!inlineInheritedMembers) // show inherited members as separate lists
5023 {
5024 writeInheritedMemberDeclarations(ol,visitedClasses,lt,lt2,title,
5025 inheritedFrom ? inheritedFrom : this,
5026 invert,showAlways);
5027 }
5028 }
5029}
void clear()
Definition dstring.h:214
void writeDeclarations(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const DString &title, const DString &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.
static void writeInlineClassLink(const ClassDef *, OutputList &ol)
static void writeVhdlDeclarations(const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)

References DString::clear(), Config_getBool, DefinitionMixin< ClassDefMutable >::getLanguage(), getMemberList(), title(), MemberList::writeDeclarations(), writeInheritedMemberDeclarations(), VhdlDocGen::writeInlineClassLink(), and VhdlDocGen::writeVhdlDeclarations().

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ writeMemberDocumentation()

void ClassDefImpl::writeMemberDocumentation ( OutputList & ol,
MemberListType lt,
const DString & title,
bool showInline = false ) const
private

Definition at line 5044 of file classdef.cpp.

5045{
5046 //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",qPrint(name()));
5047 MemberList * ml = getMemberList(lt);
5048 if (ml) ml->writeDocumentation(ol,displayName(),this,title,ml->listType().toLabel(),false,showInline);
5049}
void writeDocumentation(OutputList &ol, const DString &scopeName, const Definition *container, const DString &title, const DString &anchor, bool showEnumValues=false, bool showInline=false) const
MemberListType listType() const
Definition memberlist.h:131
constexpr const char * toLabel() const noexcept
Definition types.h:402

References displayName(), getMemberList(), MemberList::listType(), title(), MemberListType::toLabel(), and MemberList::writeDocumentation().

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ writeMemberGroups()

void ClassDefImpl::writeMemberGroups ( OutputList & ol,
bool showInline = false ) const
private

Definition at line 2223 of file classdef.cpp.

2224{
2225 // write user defined member groups
2226 for (const auto &mg : m_memberGroups)
2227 {
2228 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
2229 {
2230 mg->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,showInline);
2231 }
2232 else // add this group to the corresponding member section
2233 {
2234 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
2235 //mg->addToDeclarationSection();
2236 }
2237 }
2238}

References m_memberGroups, and m_subGrouping.

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ writeMemberList()

void ClassDefImpl::writeMemberList ( OutputList & ol) const
overridevirtual

Implements ClassDef.

Definition at line 3193 of file classdef.cpp.

3194{
3195 bool cOpt = Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
3196 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3197 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3198 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3199 if (m_allMemberNameInfoLinkedMap.empty() || cOpt) return;
3200 // only for HTML
3201 ol.pushGeneratorState();
3203
3205 if (sliceOpt)
3206 {
3207 if (compoundType()==Interface)
3208 {
3210 }
3211 else if (compoundType()==Struct)
3212 {
3214 }
3215 else if (compoundType()==Record)
3216 {
3218 }
3219 else if (compoundType()==Exception)
3220 {
3222 }
3223 else
3224 {
3226 }
3227 }
3228 else
3229 {
3231 }
3232
3233 DString memListFile = getMemberListFileName();
3234 startFile(ol,memListFile,false,memListFile,theTranslator->trMemberList(),hli,!generateTreeView,getOutputFileBase());
3235 if (!generateTreeView)
3236 {
3238 {
3240 }
3241 ol.endQuickIndices();
3242 }
3243 startTitle(ol,DString());
3245 endTitle(ol,DString(),DString());
3246 ol.startContents();
3247 ol.startParagraph();
3249 ol.docify(" ");
3252 ol.endParagraph();
3253
3254 //ol.startItemList();
3255
3256 bool first = true; // to prevent empty table
3257 int idx=0;
3258 for (auto &mni : m_allMemberNameInfoLinkedMap)
3259 {
3260 for (auto &mi : *mni)
3261 {
3262 const MemberDef *md=mi->memberDef();
3263 const ClassDef *cd=md->getClassDef();
3264 Protection prot = mi->prot();
3265 Specifier virt=md->virtualness();
3266
3267 //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n",
3268 // qPrint(name()),qPrint(md->name()),qPrint(cd->name()),md->protection(),mi->prot,prot,mi->inherited);
3269
3270 if (cd && !md->name().empty() && !md->isAnonymous())
3271 {
3272 bool memberWritten=false;
3273 if (cd->isLinkable() && md->isLinkable())
3274 // create a link to the documentation
3275 {
3276 DString name=mi->ambiguityResolutionScope()+md->name();
3277 //ol.writeListItem();
3278 if (first)
3279 {
3280 ol.writeString("<table class=\"directory\">\n");
3281 first = false;
3282 }
3283 ol.writeString(" <tr");
3284 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3285 idx++;
3286 ol.writeString("><td class=\"entry\">");
3287 if (cd->isObjectiveC())
3288 {
3289 if (md->isObjCMethod())
3290 {
3291 if (md->isStatic())
3292 ol.writeString("+&#160;</td><td>");
3293 else
3294 ol.writeString("-&#160;</td><td>");
3295 }
3296 else
3297 ol.writeString("</td><td class=\"entry\">");
3298 }
3299 if (md->isObjCMethod())
3300 {
3302 md->getOutputFileBase(),
3303 md->anchor(),md->name());
3304 }
3305 else
3306 {
3307 //Definition *bd = md->getGroupDef();
3308 //if (bd==nullptr) bd=cd;
3310 md->getOutputFileBase(),
3311 md->anchor(),name);
3312
3313 if ( md->isFunction() || md->isSignal() || md->isSlot() ||
3314 (md->isFriend() && !md->argsString().empty()))
3315 ol.docify(md->argsString());
3316 else if (md->isEnumerate())
3318 else if (md->isEnumValue())
3320 else if (md->isTypedef())
3321 ol.docify(" typedef");
3322 else if (md->isFriend() && md->typeString()=="friend class")
3323 ol.docify(" class");
3324 else if (md->isFriend() && md->typeString()=="friend struct")
3325 ol.docify(" struct");
3326 else if (md->isFriend() && md->typeString()=="friend union")
3327 ol.docify(" union");
3328 //ol.writeString("\n");
3329 }
3330 ol.writeString("</td>");
3331 memberWritten=true;
3332 }
3333 else if (!cd->isArtificial() &&
3334 !Config_getBool(HIDE_UNDOC_MEMBERS) &&
3336 ) // no documentation,
3337 // generate link to the class instead.
3338 {
3339 //ol.writeListItem();
3340 if (first)
3341 {
3342 ol.writeString("<table class=\"directory\">\n");
3343 first = false;
3344 }
3345 ol.writeString(" <tr bgcolor=\"#f0f0f0\"");
3346 if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\"");
3347 idx++;
3348 ol.writeString("><td class=\"entry\">");
3349 if (cd->isObjectiveC())
3350 {
3351 if (md->isObjCMethod())
3352 {
3353 if (md->isStatic())
3354 ol.writeString("+&#160;</td><td class=\"entry\">");
3355 else
3356 ol.writeString("-&#160;</td><td class=\"entry\">");
3357 }
3358 else
3359 ol.writeString("</td><td class=\"entry\">");
3360 }
3361 ol.startBold();
3362 ol.docify(md->name());
3363 ol.endBold();
3364 if (!md->isObjCMethod())
3365 {
3366 if ( md->isFunction() || md->isSignal() || md->isSlot() )
3367 ol.docify(md->argsString());
3368 else if (md->isEnumerate())
3370 else if (md->isEnumValue())
3372 else if (md->isTypedef())
3373 ol.docify(" typedef");
3374 }
3375 ol.writeString(" (");
3377 if (cd->isLinkable())
3378 {
3379 ol.writeObjectLink(
3380 cd->getReference(),
3381 cd->getOutputFileBase(),
3382 cd->anchor(),
3383 cd->displayName());
3384 }
3385 else
3386 {
3387 ol.startBold();
3388 ol.docify(cd->displayName());
3389 ol.endBold();
3390 }
3391 ol.writeString(")");
3392 ol.writeString("</td>");
3393 memberWritten=true;
3394 }
3395 if (memberWritten)
3396 {
3397 ol.writeString("<td class=\"entry\">");
3399 cd->getOutputFileBase(),
3400 cd->anchor(),
3401 md->category() ?
3402 md->category()->displayName() :
3403 cd->displayName());
3404 ol.writeString("</td>");
3405 ol.writeString("<td class=\"entry\">");
3406 }
3407 SrcLangExt lang = md->getLanguage();
3408 if (
3409 (prot!=Protection::Public || (virt!=Specifier::Normal && getLanguage()!=SrcLangExt::ObjC) ||
3410 md->isFriend() || md->isRelated() || md->isExplicit() ||
3411 md->isMutable() || (md->isInline() && Config_getBool(INLINE_INFO)) ||
3412 md->isSignal() || md->isSlot() || md->isThreadLocal() ||
3413 (getLanguage()==SrcLangExt::IDL &&
3414 (md->isOptional() || md->isAttribute() || md->isUNOProperty())) ||
3415 md->isStatic() || lang==SrcLangExt::VHDL
3416 )
3417 && memberWritten)
3418 {
3419 StringVector sl;
3420 if (lang==SrcLangExt::VHDL)
3421 {
3422 sl.push_back(theTranslator->trVhdlType(md->getVhdlSpecifiers(),true).str()); //append vhdl type
3423 }
3424 else if (md->isFriend()) sl.emplace_back("friend");
3425 else if (md->isRelated()) sl.emplace_back("related");
3426 else
3427 {
3428 if (Config_getBool(INLINE_INFO) && md->isInline())
3429 sl.emplace_back("inline");
3430 if (md->isExplicit()) sl.emplace_back("explicit");
3431 if (md->isMutable()) sl.emplace_back("mutable");
3432 if (md->isThreadLocal()) sl.emplace_back("thread_local");
3433 if (prot==Protection::Protected) sl.emplace_back("protected");
3434 else if (prot==Protection::Private) sl.emplace_back("private");
3435 else if (prot==Protection::Package) sl.emplace_back("package");
3436 if (virt==Specifier::Virtual && getLanguage()!=SrcLangExt::ObjC)
3437 sl.emplace_back("virtual");
3438 else if (virt==Specifier::Pure) sl.emplace_back("pure virtual");
3439 if (md->isStatic()) sl.emplace_back("static");
3440 if (md->isSignal()) sl.emplace_back("signal");
3441 if (md->isSlot()) sl.emplace_back("slot");
3442// this is the extra member page
3443 if (md->isOptional()) sl.emplace_back("optional");
3444 if (md->isAttribute()) sl.emplace_back("attribute");
3445 if (md->isUNOProperty()) sl.emplace_back("property");
3446 if (md->isReadonly()) sl.emplace_back("readonly");
3447 if (md->isBound()) sl.emplace_back("bound");
3448 if (md->isRemovable()) sl.emplace_back("removable");
3449 if (md->isConstrained()) sl.emplace_back("constrained");
3450 if (md->isTransient()) sl.emplace_back("transient");
3451 if (md->isMaybeVoid()) sl.emplace_back("maybevoid");
3452 if (md->isMaybeDefault()) sl.emplace_back("maybedefault");
3453 if (md->isMaybeAmbiguous()) sl.emplace_back("maybeambiguous");
3454 }
3455 bool firstSpan=true;
3456 for (const auto &s : sl)
3457 {
3458 if (!firstSpan)
3459 {
3460 ol.writeString("</span><span class=\"mlabel\">");
3461 }
3462 else
3463 {
3464 ol.writeString("<span class=\"mlabel\">");
3465 firstSpan=false;
3466 }
3467 ol.docify(s);
3468 }
3469 if (!firstSpan) ol.writeString("</span>");
3470 }
3471 if (memberWritten)
3472 {
3473 ol.writeString("</td>");
3474 ol.writeString("</tr>\n");
3475 }
3476 }
3477 }
3478 }
3479 //ol.endItemList();
3480
3481 if (!first) ol.writeString("</table>");
3482
3483 endFile(ol);
3484 ol.popGeneratorState();
3485}
virtual bool isObjectiveC() const =0
Returns true if this class is implemented in Objective-C.
virtual bool isArtificial() const =0
virtual bool isSignal() const =0
virtual bool isExplicit() const =0
virtual bool isObjCMethod() const =0
virtual bool isMaybeVoid() const =0
virtual ClassDef * category() const =0
virtual bool isSlot() const =0
virtual bool isInline() const =0
virtual bool isMaybeAmbiguous() const =0
virtual bool isAttribute() 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 bool isTransient() const =0
virtual bool isOptional() const =0
virtual bool isUNOProperty() const =0
virtual bool isMutable() const =0
virtual DString trIncludingInheritedMembers()=0
virtual DString trMemberList()=0
virtual DString trEnumName()=0
virtual DString trThisIsTheListOfAllMembers()=0
virtual DString trEnumValue()=0
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const DString &navPath)
Definition index.cpp:437

References anchor(), Definition::anchor(), MemberDef::argsString(), MemberDef::category(), ClassVisible, compoundType(), Config_getBool, OutputList::disableAllBut(), displayName(), Definition::displayName(), OutputList::docify(), DString::empty(), LinkedMap< T, Hash, KeyEqual, Map >::empty(), OutputList::endBold(), endFile(), OutputList::endParagraph(), OutputList::endQuickIndices(), endTitle(), ClassDef::Exception, ExceptionVisible, MemberDef::getClassDef(), Definition::getLanguage(), DefinitionMixin< ClassDefMutable >::getLanguage(), getMemberListFileName(), DefinitionMixin< ClassDefMutable >::getOuterScope(), getOutputFileBase(), Definition::getOutputFileBase(), getReference(), Definition::getReference(), MemberDef::getVhdlSpecifiers(), Doxygen::globalScope, Html, ClassDef::Interface, InterfaceVisible, Definition::isAnonymous(), Definition::isArtificial(), MemberDef::isAttribute(), MemberDef::isBound(), MemberDef::isConstrained(), MemberDef::isEnumerate(), MemberDef::isEnumValue(), MemberDef::isExplicit(), MemberDef::isFriend(), MemberDef::isFunction(), MemberDef::isInline(), Definition::isLinkable(), MemberDef::isMaybeAmbiguous(), MemberDef::isMaybeDefault(), MemberDef::isMaybeVoid(), MemberDef::isMutable(), MemberDef::isObjCMethod(), ClassDef::isObjectiveC(), MemberDef::isOptional(), MemberDef::isReadonly(), MemberDef::isRelated(), MemberDef::isRemovable(), MemberDef::isSignal(), MemberDef::isSlot(), MemberDef::isStatic(), MemberDef::isThreadLocal(), MemberDef::isTransient(), MemberDef::isTypedef(), MemberDef::isUNOProperty(), m_allMemberNameInfoLinkedMap, Definition::name(), DefinitionMixin< ClassDefMutable >::name(), None, OutputList::parseText(), OutputList::popGeneratorState(), MemberDef::protection(), protectionLevelVisible(), OutputList::pushGeneratorState(), ClassDef::Record, RecordVisible, OutputList::startBold(), OutputList::startContents(), startFile(), OutputList::startParagraph(), startTitle(), DString::str(), ClassDef::Struct, StructVisible, theTranslator, Translator::trDefinedIn(), Translator::trEnumName(), Translator::trEnumValue(), Translator::trIncludingInheritedMembers(), Translator::trMemberList(), Translator::trThisIsTheListOfAllMembers(), Translator::trVhdlType(), MemberDef::typeString(), MemberDef::virtualness(), DefinitionMixin< ClassDefMutable >::writeNavigationPath(), OutputList::writeObjectLink(), and OutputList::writeString().

◆ writeMemberPages()

void ClassDefImpl::writeMemberPages ( OutputList & ol) const
overridevirtual

Implements ClassDef.

Definition at line 3107 of file classdef.cpp.

3108{
3109 ///////////////////////////////////////////////////////////////////////////
3110 //// Member definitions on separate pages
3111 ///////////////////////////////////////////////////////////////////////////
3112
3113 ol.pushGeneratorState();
3115
3116 for (const auto &ml : m_memberLists)
3117 {
3118 if (ml->numDocMembers()>ml->numDocEnumValues() && ml->listType().isDetailed())
3119 {
3120 ml->writeDocumentationPage(ol,displayName(),this);
3121 }
3122 }
3123
3124 ol.popGeneratorState();
3125}

References OutputList::disableAllBut(), displayName(), Html, m_memberLists, OutputList::popGeneratorState(), and OutputList::pushGeneratorState().

Referenced by writeDocumentation().

◆ writeMoreLink()

void ClassDefImpl::writeMoreLink ( OutputList & ol,
const DString & anchor ) const
private

Definition at line 2604 of file classdef.cpp.

2605{
2606 // TODO: clean up this mess by moving it to
2607 // the output generators...
2608 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
2609 bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
2610 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
2611
2612 // HTML only
2613 ol.pushGeneratorState();
2615 ol.docify(" ");
2617 anchor.empty() ? DString("details") : anchor);
2619 ol.endTextLink();
2620 ol.popGeneratorState();
2621
2622 if (!anchor.empty())
2623 {
2624 ol.pushGeneratorState();
2625 // LaTeX + RTF
2629 if (!(usePDFLatex && pdfHyperlinks))
2630 {
2632 }
2633 if (!rtfHyperlinks)
2634 {
2636 }
2637 ol.docify(" ");
2640 ol.endTextLink();
2641 // RTF only
2643 ol.writeString("\\par");
2644 ol.popGeneratorState();
2645 }
2646}
void endTextLink()
Definition outputlist.h:440
void startTextLink(const DString &file, const DString &anchor)
Definition outputlist.h:438
virtual DString trMore()=0

References anchor(), Config_getBool, OutputList::disable(), OutputList::disableAllBut(), Docbook, OutputList::docify(), DString::empty(), OutputList::endTextLink(), getOutputFileBase(), Html, Latex, Man, OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), RTF, OutputList::startTextLink(), theTranslator, Translator::trMore(), and OutputList::writeString().

Referenced by writeBriefDescription(), and writeDeclarationLink().

◆ writeNestedClasses()

void ClassDefImpl::writeNestedClasses ( OutputList & ol,
const DString & title ) const
private

Definition at line 2240 of file classdef.cpp.

2241{
2242 // nested classes
2243 m_innerClasses.writeDeclaration(ol,nullptr,title,true);
2244}
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter, const DString &header, bool localNames) const
Definition classlist.cpp:51

References m_innerClasses, title(), and ClassLinkedRefMap::writeDeclaration().

Referenced by writeDocumentationContents().

◆ writePageNavigation()

void ClassDefImpl::writePageNavigation ( OutputList & ol) const
overridevirtual

Implements DefinitionMutable.

Definition at line 2373 of file classdef.cpp.

2374{
2375 ol.writePageOutline();
2376}
void writePageOutline()
Definition outputlist.h:612

References OutputList::writePageOutline().

◆ writePlainMemberDeclaration()

void ClassDefImpl::writePlainMemberDeclaration ( OutputList & ol,
MemberListType lt,
bool inGroup,
int indentLevel,
const ClassDef * inheritedFrom,
const DString & inheritId ) const
private

Definition at line 5058 of file classdef.cpp.

5061{
5062 //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",qPrint(name()));
5063 MemberList * ml = getMemberList(lt);
5064 if (ml)
5065 {
5066 ml->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
5067 }
5068}
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 DString &inheritId) const

References getMemberList(), and MemberList::writePlainDeclarations().

Referenced by writeDeclaration().

◆ writeQuickMemberLinks()

void ClassDefImpl::writeQuickMemberLinks ( OutputList & ol,
const MemberDef * md ) const
overridevirtual

Implements DefinitionMutable.

Definition at line 3127 of file classdef.cpp.

3128{
3129 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
3130
3131 ol.writeString(" <div class=\"navtab\">\n");
3132 ol.writeString(" <table>\n");
3133
3134 for (auto &mni : m_allMemberNameInfoLinkedMap)
3135 {
3136 for (auto &mi : *mni)
3137 {
3138 const MemberDef *md=mi->memberDef();
3139 if (md->getClassDef()==this && md->isLinkable() && !md->isEnumValue())
3140 {
3141 if (md->isLinkableInProject())
3142 {
3143 if (md==currentMd) // selected item => highlight
3144 {
3145 ol.writeString(" <tr><td class=\"navtabHL\">");
3146 }
3147 else
3148 {
3149 ol.writeString(" <tr><td class=\"navtab\">");
3150 }
3151 ol.writeString("<span class=\"label\"><a ");
3152 ol.writeString("href=\"");
3153 if (createSubDirs) ol.writeString("../../");
3154 DString url = md->getOutputFileBase();
3156 ol.writeString(url+"#"+md->anchor());
3157 ol.writeString("\">");
3158 ol.writeString(convertToHtml(md->name()));
3159 ol.writeString("</a></span>");
3160 ol.writeString("</td></tr>\n");
3161 }
3162 }
3163 }
3164 }
3165
3166 ol.writeString(" </table>\n");
3167 ol.writeString(" </div>\n");
3168}
void createSubDirs(const Dir &d)
Definition util.cpp:3101
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3423
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:4063

References addHtmlExtensionIfMissing(), Definition::anchor(), Config_getBool, convertToHtml(), createSubDirs(), MemberDef::getClassDef(), Definition::getOutputFileBase(), MemberDef::isEnumValue(), Definition::isLinkable(), Definition::isLinkableInProject(), m_allMemberNameInfoLinkedMap, Definition::name(), and OutputList::writeString().

◆ writeSimpleMemberDocumentation()

void ClassDefImpl::writeSimpleMemberDocumentation ( OutputList & ol,
MemberListType lt ) const
private

Definition at line 5051 of file classdef.cpp.

5052{
5053 //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",qPrint(name()));
5054 MemberList * ml = getMemberList(lt);
5055 if (ml) ml->writeSimpleDocumentation(ol,this);
5056}
void writeSimpleDocumentation(OutputList &ol, const Definition *container) const

References getMemberList(), and MemberList::writeSimpleDocumentation().

Referenced by writeInlineDocumentation().

◆ writeSummaryLinks()

void ClassDefImpl::writeSummaryLinks ( OutputList & ol) const
overridevirtual

Implements DefinitionMutable.

Definition at line 2304 of file classdef.cpp.

2305{
2306 static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2307 ol.pushGeneratorState();
2309 bool first=true;
2310 SrcLangExt lang = getLanguage();
2311
2312 if (lang!=SrcLangExt::VHDL)
2313 {
2314 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2315 {
2316 if (lde->kind()==LayoutDocEntry::ClassNestedClasses &&
2318 )
2319 {
2320 for (const auto &innerCd : m_innerClasses)
2321 {
2322 if (!innerCd->isAnonymous() &&
2323 !innerCd->isExtension() &&
2324 (innerCd->protection()!=Protection::Private || extractPrivate) &&
2325 innerCd->visibleInParentsDeclList()
2326 )
2327 {
2328 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection *>(lde.get());
2329 ol.writeSummaryLink(DString(),"nested-classes",ls->title(lang),first);
2330 first=false;
2331 break;
2332 }
2333 }
2334 }
2335 else if (lde->kind()==LayoutDocEntry::ClassAllMembersLink &&
2337 !Config_getBool(OPTIMIZE_OUTPUT_FOR_C)
2338 )
2339 {
2341 first=false;
2342 }
2343 else if (lde->kind()==LayoutDocEntry::MemberDecl)
2344 {
2345 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2346 if (lmd)
2347 {
2348 MemberList * ml = getMemberList(lmd->type);
2349 if (ml && ml->declVisible())
2350 {
2351 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
2352 first=false;
2353 }
2354 }
2355 }
2356 }
2357 }
2358 else // VDHL only
2359 {
2360 for (const auto &s : m_vhdlSummaryTitles)
2361 {
2362 ol.writeSummaryLink(DString(),convertToId(s),s,first);
2363 first=false;
2364 }
2365 }
2366 if (!first)
2367 {
2368 ol.writeString(" </div>\n");
2369 }
2370 ol.popGeneratorState();
2371}
bool declVisible(const ClassDef::CompoundType *filter=nullptr) const
Definition classlist.cpp:27
bool declVisible() const
void writeSummaryLink(const DString &file, const DString &anchor, const DString &title, bool first)
Definition outputlist.h:610
virtual DString trListOfAllMembers()=0
DString convertToId(const DString &s)
Definition util.cpp:3334

References Config_getBool, convertToId(), ClassLinkedRefMap::declVisible(), MemberList::declVisible(), OutputList::disableAllBut(), LinkedMap< T, Hash, KeyEqual, Map >::empty(), DefinitionMixin< ClassDefMutable >::getLanguage(), getMemberList(), getMemberListFileName(), Html, LayoutDocManager::instance(), MemberList::listType(), m_allMemberNameInfoLinkedMap, m_innerClasses, m_vhdlSummaryTitles, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), theTranslator, LayoutDocEntryMemberDecl::title(), LayoutDocEntrySection::title(), MemberListType::toLabel(), Translator::trListOfAllMembers(), LayoutDocEntryMemberDecl::type, OutputList::writeString(), and OutputList::writeSummaryLink().

◆ writeTagFile()

void ClassDefImpl::writeTagFile ( TextStream & tagFile) const
overridevirtual

Implements ClassDef.

Definition at line 2378 of file classdef.cpp.

2379{
2380 if (!isLinkableInProject() || isArtificial()) return;
2381 tagFile << " <compound kind=\"";
2382 if (isFortran() && (compoundTypeString() == "type"))
2383 tagFile << "struct";
2384 else
2385 tagFile << compoundTypeString();
2386 tagFile << "\"";
2387 if (isObjectiveC()) { tagFile << " objc=\"yes\""; }
2388 tagFile << ">\n";
2389 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
2390 DString fn = getOutputFileBase();
2392 tagFile << " <filename>" << convertToXML(fn) << "</filename>\n";
2393 if (!anchor().empty())
2394 {
2395 tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
2396 }
2397 DString idStr = id();
2398 if (!idStr.empty())
2399 {
2400 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
2401 }
2402 for (const Argument &a : m_tempArgs)
2403 {
2404 tagFile << " <templarg>" << convertToXML(a.type);
2405 if (!a.name.empty())
2406 {
2407 tagFile << " " << convertToXML(a.name);
2408 }
2409 tagFile << "</templarg>\n";
2410 }
2411 for (const auto &ibcd : m_inherits)
2412 {
2413 ClassDef *cd=ibcd.classDef;
2414 if (cd && cd->isLinkable())
2415 {
2416 tagFile << " <base";
2417 if (ibcd.prot==Protection::Protected)
2418 {
2419 tagFile << " protection=\"protected\"";
2420 }
2421 else if (ibcd.prot==Protection::Private)
2422 {
2423 tagFile << " protection=\"private\"";
2424 }
2425 if (ibcd.virt==Specifier::Virtual)
2426 {
2427 tagFile << " virtualness=\"virtual\"";
2428 }
2430 cd->displayName(),ibcd.templSpecifiers);
2431 tagFile << ">" << convertToXML(displayName) << "</base>\n";
2432 }
2433 }
2434 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2435 {
2436 switch (lde->kind())
2437 {
2438 case LayoutDocEntry::ClassNestedClasses:
2439 {
2440 for (const auto &innerCd : m_innerClasses)
2441 {
2442 if (innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
2443 protectionLevelVisible(innerCd->protection()) &&
2444 !innerCd->isEmbeddedInOuterScope()
2445 )
2446 {
2447 tagFile << " <class kind=\"" << innerCd->compoundTypeString() <<
2448 "\">" << convertToXML(innerCd->name()) << "</class>\n";
2449 }
2450 }
2451 }
2452 break;
2453 case LayoutDocEntry::MemberDecl:
2454 {
2455 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2456 if (lmd)
2457 {
2458 MemberList * ml = getMemberList(lmd->type);
2459 if (ml)
2460 {
2461 ml->writeTagFile(tagFile);
2462 }
2463 }
2464 }
2465 break;
2466 case LayoutDocEntry::MemberGroups:
2467 {
2468 for (const auto &mg : m_memberGroups)
2469 {
2470 mg->writeTagFile(tagFile);
2471 }
2472 }
2473 break;
2474 default:
2475 break;
2476 }
2477 }
2478 writeDocAnchorsToTagFile(tagFile);
2479 tagFile << " </compound>\n";
2480}
bool isObjectiveC() const override
Returns true if this class is implemented in Objective-C.
bool isFortran() const override
Returns true if this class is implemented in Fortran.
void writeDocAnchorsToTagFile(TextStream &fs) const override
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3364

References addHtmlExtensionIfMissing(), anchor(), compoundTypeString(), convertToXML(), displayName(), Definition::displayName(), DString::empty(), getMemberList(), getOutputFileBase(), DefinitionMixin< ClassDefMutable >::id(), insertTemplateSpecifierInScope(), LayoutDocManager::instance(), DefinitionMixin< ClassDefMutable >::isArtificial(), isFortran(), Definition::isLinkable(), isLinkableInProject(), isObjectiveC(), m_inherits, m_innerClasses, m_memberGroups, m_tempArgs, DefinitionMixin< ClassDefMutable >::name(), protectionLevelVisible(), LayoutDocEntryMemberDecl::type, DefinitionMixin< ClassDefMutable >::writeDocAnchorsToTagFile(), and MemberList::writeTagFile().

◆ writeTemplateSpec()

void ClassDefImpl::writeTemplateSpec ( OutputList & ol,
const Definition * d,
const DString & type,
SrcLangExt lang ) const
private

Definition at line 1552 of file classdef.cpp.

1554{
1555 ArgumentLists specs;
1556 DString name;
1557 searchTemplateSpecs(d,specs,name,lang);
1558 if (!specs.empty()) // class has template scope specifiers
1559 {
1561 for (const ArgumentList &al : specs)
1562 {
1563 ol.docify("template<");
1564 auto it = al.begin();
1565 while (it!=al.end())
1566 {
1567 Argument a = *it;
1568 linkifyText(TextGeneratorOLImpl(ol), // out
1569 a.type, // text
1570 LinkifyTextOptions().setScope(d).setFileScope(getFileDef()).setSelf(this));
1571 if (!a.name.empty())
1572 {
1573 ol.docify(" ");
1574 ol.docify(a.name);
1575 }
1576 if (a.defval.length()!=0)
1577 {
1578 ol.docify(" = ");
1579 ol.docify(a.defval);
1580 }
1581 ++it;
1582 if (it!=al.end()) ol.docify(", ");
1583 }
1584 ol.docify(">");
1585 ol.lineBreak();
1586 }
1587 if (!m_requiresClause.empty())
1588 {
1589 ol.docify("requires ");
1590 linkifyText(TextGeneratorOLImpl(ol), // out
1591 m_requiresClause, // text
1592 LinkifyTextOptions().setScope(d).setFileScope(getFileDef()).setSelf(this));
1593 ol.lineBreak();
1594 }
1595 ol.docify(type.lower()+" "+name);
1597 }
1598}
DString defval
Definition arguments.h:47
DString name
Definition arguments.h:45
DString type
Definition arguments.h:43
DString lower() const
Definition dstring.h:326
void endCompoundTemplateParams()
Definition outputlist.h:499
void startCompoundTemplateParams()
Definition outputlist.h:497
static void searchTemplateSpecs(const Definition *d, ArgumentLists &result, DString &name, SrcLangExt lang)
void linkifyText(const TextGeneratorIntf &out, const DString &text, const LinkifyTextOptions &options)

References Argument::defval, OutputList::docify(), DString::empty(), OutputList::endCompoundTemplateParams(), getFileDef(), DString::length(), OutputList::lineBreak(), linkifyText(), DString::lower(), m_requiresClause, Argument::name, DefinitionMixin< ClassDefMutable >::name(), searchTemplateSpecs(), OutputList::startCompoundTemplateParams(), and Argument::type.

Referenced by writeDetailedDocumentationBody().

Member Data Documentation

◆ m_allMemberNameInfoLinkedMap

◆ m_arrowOperator

const MemberDef* ClassDefImpl::m_arrowOperator = nullptr
private

Does this class overloaded the -> operator?

Definition at line 559 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), internalInsertMember(), and isSmartPointer().

◆ m_categoryOf

ClassDef* ClassDefImpl::m_categoryOf = nullptr
private

If this class is a Objective-C category, then this points to the class which is extended.

Definition at line 522 of file classdef.cpp.

Referenced by categoryOf(), ClassDefImpl(), deepCopy(), and setCategoryOf().

◆ m_className

DString ClassDefImpl::m_className
private

local class name which could be a typedef'ed alias name.

Definition at line 517 of file classdef.cpp.

Referenced by className(), deepCopy(), setClassName(), and setProtection().

◆ m_collabFileName

DString ClassDefImpl::m_collabFileName
private

file name used for the collaboration diagram

Definition at line 441 of file classdef.cpp.

Referenced by ClassDefImpl(), collaborationGraphFileName(), and deepCopy().

◆ m_compType

ClassDef::CompoundType ClassDefImpl::m_compType
private

Holds the kind of "class" this is.

Definition at line 487 of file classdef.cpp.

Referenced by ClassDefImpl(), compoundType(), compoundTypeString(), deepCopy(), generatedFromFiles(), setCompoundType(), and title().

◆ m_constraintClassList

ConstraintClassList ClassDefImpl::m_constraintClassList
private

Definition at line 504 of file classdef.cpp.

Referenced by addTypeConstraint(), deepCopy(), and templateTypeConstraints().

◆ m_examples

ExampleList ClassDefImpl::m_examples
private

Examples that use this class

Definition at line 484 of file classdef.cpp.

Referenced by addExample(), deepCopy(), getExamples(), hasExamples(), and writeDetailedDocumentationBody().

◆ m_fileDef

FileDef* ClassDefImpl::m_fileDef = nullptr
private

Namespace this class is part of (this is the inner most namespace in case of nested namespaces)

File this class is defined in

Definition at line 466 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), getFileDef(), moveTo(), and setFileDef().

◆ m_fileName

DString ClassDefImpl::m_fileName
private

file name that forms the base for the output file containing the class documentation. For compatibility with Qt (e.g. links via tag files) this name cannot be derived from the class name directly.

Definition at line 435 of file classdef.cpp.

Referenced by anchor(), ClassDefImpl(), getInstanceOutputFileBase(), and getOutputFileBase().

◆ m_files

FileList ClassDefImpl::m_files
private

Files that were used for generating the class documentation.

Definition at line 481 of file classdef.cpp.

Referenced by deepCopy(), generatedFromFiles(), insertUsedFile(), showUsedFiles(), and usedFiles().

◆ m_hasCollaborationGraph

bool ClassDefImpl::m_hasCollaborationGraph = false
private

◆ m_hasNamedVariable

bool ClassDefImpl::m_hasNamedVariable = false
private

Definition at line 562 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), hasNamedVariable(), and setHasNamedVariable().

◆ m_implicitTemplateInstance

◆ m_incInfo

std::unique_ptr<IncludeInfo> ClassDefImpl::m_incInfo
private

Include information about the header file should be included in the documentation. 0 by default, set by setIncludeFile().

Definition at line 449 of file classdef.cpp.

Referenced by deepCopy(), includeInfo(), setIncludeFile(), writeIncludeFiles(), and writeIncludeFilesForSlice().

◆ m_inheritedBy

BaseClassList ClassDefImpl::m_inheritedBy
private

List of sub-classes that directly derive from this class

Definition at line 458 of file classdef.cpp.

Referenced by countInheritedByNodes(), deepCopy(), insertSubClass(), isVisibleInHierarchy(), subClasses(), updateSubClasses(), and writeInheritanceGraph().

◆ m_inheritFileName

DString ClassDefImpl::m_inheritFileName
private

file name used for the inheritance graph

Definition at line 444 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), and inheritanceGraphFileName().

◆ m_inherits

BaseClassList ClassDefImpl::m_inherits
private

◆ m_innerClasses

ClassLinkedRefMap ClassDefImpl::m_innerClasses
private

◆ m_isAbstract

bool ClassDefImpl::m_isAbstract = false
private

Is this an abstract class?

Definition at line 530 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), internalInsertMember(), and isAbstract().

◆ m_isJavaEnum

bool ClassDefImpl::m_isJavaEnum = false
private

Does this class represent a Java style enum?

Definition at line 565 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), and isJavaEnum().

◆ m_isLocal

bool ClassDefImpl::m_isLocal = false
private

true if the class is defined in a source file rather than a header file.

Definition at line 539 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), isLinkableInProject(), and isLocal().

◆ m_isSimple

bool ClassDefImpl::m_isSimple = false
private

◆ m_isStatic

bool ClassDefImpl::m_isStatic = false
private

Is the class part of an unnamed namespace?

Definition at line 533 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), isLinkableInProject(), isVisibleInHierarchy(), and setIsStatic().

◆ m_isTemplArg

bool ClassDefImpl::m_isTemplArg = false
private

Definition at line 541 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), isTemplateArgument(), and makeTemplateArgument().

◆ m_memberGroups

◆ m_memberListFileName

DString ClassDefImpl::m_memberListFileName
private

file name used for the list of all members

Definition at line 438 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), and getMemberListFileName().

◆ m_memberLists

◆ m_membersMerged

bool ClassDefImpl::m_membersMerged = false
private

true if classes members are merged with those of the base classes.

Definition at line 536 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), and mergeMembers().

◆ m_metaData

DString ClassDefImpl::m_metaData
private

Definition at line 569 of file classdef.cpp.

Referenced by deepCopy(), setMetaData(), and writeIncludeFilesForSlice().

◆ m_moduleDef

ModuleDef* ClassDefImpl::m_moduleDef = nullptr
private

Module this class is defined in

Definition at line 469 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), getModuleDef(), moveTo(), and setModuleDef().

◆ m_primaryConstructorParams

ArgumentList ClassDefImpl::m_primaryConstructorParams
private

Definition at line 581 of file classdef.cpp.

Referenced by setPrimaryConstructorParams(), and title().

◆ m_prot

Protection ClassDefImpl::m_prot
private

The protection level in which this class was found. Typically Public, but for nested classes this can also be Protected or Private.

Definition at line 493 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), isLinkableInProject(), isVisibleInHierarchy(), protection(), and setProtection().

◆ m_qualifiers

StringVector ClassDefImpl::m_qualifiers
private

Definition at line 574 of file classdef.cpp.

Referenced by addClassAttributes(), addQualifiers(), deepCopy(), and getQualifiers().

◆ m_requiresClause

DString ClassDefImpl::m_requiresClause
private

C++20 requires clause.

Definition at line 572 of file classdef.cpp.

Referenced by deepCopy(), requiresClause(), setRequiresClause(), and writeTemplateSpec().

◆ m_spec

◆ m_subGrouping

bool ClassDefImpl::m_subGrouping = false
private

Does this class group its user-grouped members as a sub-section of the normal (public/protected/..) groups?

Definition at line 547 of file classdef.cpp.

Referenced by addGroupedInheritedMembers(), addMembersToMemberGroup(), ClassDefImpl(), countMembersIncludingGrouped(), deepCopy(), setSubGrouping(), subGrouping(), and writeMemberGroups().

◆ m_taglessParent

const ClassDef* ClassDefImpl::m_taglessParent = nullptr
private

Definition at line 561 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), setTaglessParent(), and taglessParent().

◆ m_tempArgs

◆ m_templateInstances

TemplateInstanceList ClassDefImpl::m_templateInstances
private

Template instances that exists of this class, the key in the dictionary is the template argument list.

Definition at line 509 of file classdef.cpp.

Referenced by deepCopy(), getTemplateInstances(), insertExplicitTemplateInstance(), insertTemplateInstance(), and insertUsedFile().

◆ m_templateMaster

const ClassDef* ClassDefImpl::m_templateMaster = nullptr
private

◆ m_templBaseClassNames

TemplateNameMap ClassDefImpl::m_templBaseClassNames
private

Definition at line 511 of file classdef.cpp.

Referenced by deepCopy(), getTemplateBaseClassNames(), and setTemplateBaseClassNames().

◆ m_typeConstraints

ArgumentList ClassDefImpl::m_typeConstraints
private

Type constraints for template parameters

Definition at line 478 of file classdef.cpp.

Referenced by deepCopy(), setTypeConstraints(), typeConstraints(), and writeDetailedDocumentationBody().

◆ m_typeInheritanceGraph

CLASS_GRAPH_t ClassDefImpl::m_typeInheritanceGraph = CLASS_GRAPH_t::NO
private

◆ m_usedByImplClassList

UsesClassList ClassDefImpl::m_usedByImplClassList
private

Definition at line 502 of file classdef.cpp.

Referenced by addUsedByClass(), deepCopy(), and usedByImplementationClasses().

◆ m_usedOnly

bool ClassDefImpl::m_usedOnly = false
private

Reason of existence is a "use" relation.

Definition at line 550 of file classdef.cpp.

Referenced by ClassDefImpl(), deepCopy(), isUsedOnly(), and setUsedOnly().

◆ m_usesImplClassList

UsesClassList ClassDefImpl::m_usesImplClassList
private

Definition at line 501 of file classdef.cpp.

Referenced by addUsedClass(), deepCopy(), and usedImplementationClasses().

◆ m_vhdlSummaryTitles

StringSet ClassDefImpl::m_vhdlSummaryTitles
private

List of titles to use for the summary.

Definition at line 553 of file classdef.cpp.

Referenced by deepCopy(), internalInsertMember(), and writeSummaryLinks().


The documentation for this class was generated from the following file: