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 , 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 200 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 828 of file classdef.cpp.

833 : DefinitionMixin(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),nullptr,nullptr,isSymbol)
834{
835 AUTO_TRACE("name={}",name());
836 setReference(lref);
837 m_compType = ct;
839 DString compTypeString = getCompoundTypeString(getLanguage(),ct,isJavaEnum);
840 if (!fName.empty())
841 {
843 }
844 else
845 {
846 m_fileName=compTypeString+name();
847 }
848 m_prot=Protection::Public;
849 //nspace=nullptr;
850 m_fileDef=nullptr;
851 m_moduleDef=nullptr;
852 m_subGrouping=Config_getBool(SUBGROUPING);
853 m_templateMaster =nullptr;
854 m_isAbstract = false;
855 m_isStatic = false;
856 m_isTemplArg = false;
857 m_membersMerged = false;
858 m_categoryOf = nullptr;
859 m_usedOnly = false;
860 m_isSimple = Config_getBool(INLINE_SIMPLE_STRUCTS);
861 m_arrowOperator = nullptr;
862 m_taglessParent = nullptr;
863 m_hasNamedVariable = false;
864 m_spec=TypeSpecifier();
865 //DString ns;
866 //extractNamespaceName(name,className,ns);
867 //printf("m_name=%s m_className=%s ns=%s\n",qPrint(m_name),qPrint(m_className),qPrint(ns));
868
869 // we cannot use getLanguage at this point, as setLanguage has not been called.
870 SrcLangExt lang = getLanguageFromFileName(defFileName);
871 if ((lang==SrcLangExt::Cpp || lang==SrcLangExt::ObjC) && EntryType::guessSection(defFileName).isSource())
872 {
873 m_isLocal=true;
874 }
875 else
876 {
877 m_isLocal=false;
878 }
879 m_hasCollaborationGraph = Config_getBool(COLLABORATION_GRAPH);
881 m_memberListFileName = convertNameToFile(compTypeString+name()+"-members");
884 if (lref.empty())
885 {
887 }
888 AUTO_TRACE_EXIT("m_fileName='{}'",m_fileName);
889}
const MemberDef * m_arrowOperator
Does this class overloaded the -> operator?
Definition classdef.cpp:558
TypeSpecifier m_spec
Definition classdef.cpp:566
DString m_fileName
Definition classdef.cpp:434
ClassDef * m_categoryOf
Definition classdef.cpp:521
Protection m_prot
Definition classdef.cpp:492
const ClassDef * m_templateMaster
Definition classdef.cpp:513
bool m_membersMerged
Definition classdef.cpp:535
bool m_hasNamedVariable
Definition classdef.cpp:561
bool m_isJavaEnum
Does this class represent a Java style enum?
Definition classdef.cpp:564
ModuleDef * m_moduleDef
Definition classdef.cpp:468
bool isJavaEnum() const override
DString m_inheritFileName
Definition classdef.cpp:443
bool m_isSimple
Is this a simple (non-nested) C structure?
Definition classdef.cpp:555
CLASS_GRAPH_t m_typeInheritanceGraph
Definition classdef.cpp:576
DString m_memberListFileName
Definition classdef.cpp:437
bool m_isAbstract
Definition classdef.cpp:529
FileDef * m_fileDef
Definition classdef.cpp:465
ClassDef::CompoundType m_compType
Definition classdef.cpp:486
bool m_hasCollaborationGraph
Definition classdef.cpp:575
const ClassDef * m_taglessParent
Definition classdef.cpp:560
bool m_isTemplArg
Definition classdef.cpp:540
bool m_usedOnly
Reason of existence is a "use" relation.
Definition classdef.cpp:549
bool m_subGrouping
Definition classdef.cpp:546
DString m_collabFileName
Definition classdef.cpp:440
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:3964
DString removeRedundantWhiteSpace(const DString &s)
Definition util.cpp:427
DString convertNameToFile(const DString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:2872
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4177

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 2773 of file classdef.cpp.

2774{
2775 StringVector sl;
2776 if (isFinal()) sl.emplace_back("final");
2777 if (isSealed()) sl.emplace_back("sealed");
2778 if (isAbstract()) sl.emplace_back("abstract");
2779 if (isRef()) sl.emplace_back("ref");
2780 if (isExported()) sl.emplace_back("export");
2781 if (getLanguage()==SrcLangExt::IDL && isPublished()) sl.emplace_back("published");
2782
2783 for (const auto &sx : m_qualifiers)
2784 {
2785 bool alreadyAdded = std::find(sl.begin(), sl.end(), sx) != sl.end();
2786 if (!alreadyAdded)
2787 {
2788 sl.push_back(sx);
2789 }
2790 }
2791
2792 ol.pushGeneratorState();
2794 if (!sl.empty())
2795 {
2796 ol.startLabels();
2797 size_t i=0;
2798 for (const auto &s : sl)
2799 {
2800 i++;
2801 ol.writeLabel(s,i==sl.size());
2802 }
2803 ol.endLabels();
2804 }
2805 ol.popGeneratorState();
2806}
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:573
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 3469 of file classdef.cpp.

3470{
3471 return m_examples.inSort(Example(anchor,nameStr,file));
3472}
ExampleList m_examples
Definition classdef.cpp:483
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 5012 of file classdef.cpp.

5014{
5015 //printf("** %s::addGroupedInheritedMembers() inheritId=%s\n",qPrint(name()),qPrint(inheritId));
5016 for (const auto &mg : m_memberGroups)
5017 {
5018 if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section
5019 {
5020 mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId);
5021 }
5022 }
5023}
MemberGroupList m_memberGroups
Definition classdef.cpp:526

References m_memberGroups, and m_subGrouping.

◆ addInnerCompound()

void ClassDefImpl::addInnerCompound ( Definition * d)
overridevirtual

Implements DefinitionMutable.

Definition at line 4391 of file classdef.cpp.

4392{
4393 //printf("**** %s::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
4394 if (d->definitionType()==Definition::TypeClass) // only classes can be nested in classes.
4395 {
4396 ClassDef *cd = toClassDef(d);
4397 m_innerClasses.add(d->localName(),cd);
4398 if (cd && cd->isAnonymous())
4399 {
4400 m_isSimple = false;
4401 }
4402 }
4403}
ClassLinkedRefMap m_innerClasses
Definition classdef.cpp:497
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 4603 of file classdef.cpp.

4604{
4605 if (!isLinkableInProject()) return;
4606 SrcLangExt lang = getLanguage();
4608 qualifiedName(),
4611 displayName(),
4612 DString(),
4613 this
4614 );
4615 for (const auto &mg : m_memberGroups)
4616 {
4617 mg->addListReferences(this);
4618 }
4619 for (auto &ml : m_memberLists)
4620 {
4621 if (ml->listType().isDetailed())
4622 {
4623 ml->addListReferences(this);
4624 }
4625 }
4626}
bool isLinkableInProject() const override
MemberLists m_memberLists
Definition classdef.cpp:523
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 1047 of file classdef.cpp.

1048{
1049 for (auto &ml : m_memberLists)
1050 {
1051 if (!ml->listType().isDetailed())
1052 {
1054 }
1055 }
1056
1057 // add members inside sections to their groups
1058 for (const auto &mg : m_memberGroups)
1059 {
1060 if (mg->allMembersInSameSection() && m_subGrouping)
1061 {
1062 //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
1063 mg->addToDeclarationSection();
1064 }
1065 }
1066}
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 4515 of file classdef.cpp.

4516{
4517 AUTO_TRACE("this={} cd={} templSpec={}",name(),cd->name(),templSpec);
4518 //printf("%s::addMembersToTemplateInstance(%s,%s)\n",qPrint(name()),qPrint(cd->name()),templSpec);
4519 for (const auto &mni : cd->memberNameInfoLinkedMap())
4520 {
4521 for (const auto &mi : *mni)
4522 {
4523 const MemberDef *md = mi->memberDef();
4524 if (m_allMemberNameInfoLinkedMap.find(md->name())==nullptr) // only insert the member if not hidden by one with the same name (#11541)
4525 {
4527 }
4528 }
4529 }
4530 // also instantiate members for nested classes
4531 for (const auto &innerCd : cd->getClasses())
4532 {
4533 ClassDefMutable *ncd = toClassDefMutable(m_innerClasses.find(innerCd->localName()));
4534 if (ncd)
4535 {
4536 ncd->addMembersToTemplateInstance(innerCd,cd->templateArguments(),templSpec);
4537 }
4538 }
4539}
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:471
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 4687 of file classdef.cpp.

4688{
4689 AUTO_TRACE("{} md={} lt={} isBrief={}",name(),md->name(),lt,isBrief);
4690 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
4691 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
4692 const auto &ml = m_memberLists.get(lt,MemberListContainer::Class);
4693 ml->setNeedsSorting((isBrief && sortBriefDocs) || (!isBrief && sortMemberDocs));
4694 ml->push_back(md);
4695
4696 // for members in the declaration lists we set the section, needed for member grouping
4697 if (!ml->listType().isDetailed())
4698 {
4699 MemberDefMutable *mdm = toMemberDefMutable(md);
4700 if (mdm)
4701 {
4702 mdm->setSectionList(this,ml.get());
4703 }
4704 }
4705}
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 4489 of file classdef.cpp.

4492{
4493 AUTO_TRACE("this={} md={}",name(),md->name());
4494 auto actualArguments_p = stringToArgumentList(getLanguage(),templSpec);
4495 auto imd = md->createTemplateInstanceMember(templateArguments,actualArguments_p);
4496 auto mmd = toMemberDefMutable(imd.get());
4497 mmd->setMemberClass(this);
4498 mmd->setTemplateMaster(md);
4499 mmd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
4500 mmd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
4501 mmd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
4502 mmd->setMemberSpecifiers(md->getMemberSpecifiers());
4503 mmd->setMemberGroupId(md->getMemberGroupId());
4504 mmd->setArtificial(true);
4505 insertMember(imd.get());
4506 //printf("Adding member=%s %s%s to class %s templSpec %s\n",
4507 // imd->typeString(),qPrint(imd->name()),imd->argsString(),
4508 // qPrint(imd->getClassDef()->name()),templSpec);
4509 // insert imd in the list of all members
4510 //printf("Adding member=%s class=%s\n",qPrint(imd->name()),qPrint(name()));
4511 MemberName *mn = Doxygen::memberNameLinkedMap->add(imd->name());
4512 mn->push_back(std::move(imd));
4513}
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:821

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 5407 of file classdef.cpp.

5408{
5409 for (const auto &sx : qualifiers)
5410 {
5411 bool alreadyAdded = std::find(m_qualifiers.begin(), m_qualifiers.end(), sx) != m_qualifiers.end();
5412 if (!alreadyAdded)
5413 {
5414 m_qualifiers.push_back(sx);
5415 }
5416 }
5417}

References m_qualifiers.

◆ addRequirementReferences()

void ClassDefImpl::addRequirementReferences ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 4628 of file classdef.cpp.

4629{
4630 if (!isLinkableInProject()) return;
4632 for (const auto &mg : m_memberGroups)
4633 {
4634 mg->addRequirementReferences(this);
4635 }
4636 for (auto &ml : m_memberLists)
4637 {
4638 if (ml->listType().isDetailed())
4639 {
4640 ml->addRequirementReferences(this);
4641 }
4642 }
4643}
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 3480 of file classdef.cpp.

3481{
3482 //printf("addTypeConstraint(%s,%s)\n",qPrint(type),qPrint(typeConstraint));
3483 bool hideUndocRelation = Config_getBool(HIDE_UNDOC_RELATIONS);
3484 if (typeConstraint.empty() || type.empty()) return;
3485 SymbolResolver resolver(getFileDef());
3486 ClassDefMutable *cd = resolver.resolveClassMutable(this,typeConstraint);
3487 if (cd==nullptr && !hideUndocRelation)
3488 {
3489 cd = toClassDefMutable(
3490 Doxygen::hiddenClassLinkedMap->add(typeConstraint,
3491 std::unique_ptr<ClassDef>(
3492 new ClassDefImpl(
3494 getDefColumn(),
3495 typeConstraint,
3496 ClassDef::Class))));
3497 if (cd)
3498 {
3499 cd->setUsedOnly(true);
3500 cd->setLanguage(getLanguage());
3501 //printf("Adding undocumented constraint '%s' to class %s on type %s\n",
3502 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3503 }
3504 }
3505 if (cd)
3506 {
3507 auto it = std::find_if(m_constraintClassList.begin(),
3509 [&cd](const auto &ccd) { return ccd.classDef==cd; });
3510
3511 if (it==m_constraintClassList.end())
3512 {
3513 m_constraintClassList.emplace_back(cd);
3514 it = m_constraintClassList.end()-1;
3515 }
3516 (*it).addAccessor(type);
3517 //printf("Adding constraint '%s' to class %s on type %s\n",
3518 // qPrint(typeConstraint),qPrint(name()),qPrint(type));
3519 }
3520}
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:828
ConstraintClassList m_constraintClassList
Definition classdef.cpp:503
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 3523 of file classdef.cpp.

3524{
3525 for (const Argument &a : m_tempArgs)
3526 {
3527 if (!a.typeConstraint.empty())
3528 {
3529 DString typeConstraint;
3530 size_t i=0,p=0;
3531 while ((i=a.typeConstraint.find('&',p))!=DString::npos) // typeConstraint="A &I" for C<T extends A & I>
3532 {
3533 typeConstraint = a.typeConstraint.mid(p,i-p).stripWhiteSpace();
3534 addTypeConstraint(typeConstraint,a.type);
3535 p=i+1;
3536 }
3537 typeConstraint = a.typeConstraint.mid(p).stripWhiteSpace();
3538 addTypeConstraint(typeConstraint,a.type);
3539 }
3540 }
3541}
void addTypeConstraint(const DString &typeConstraint, const DString &type)
ArgumentList m_tempArgs
Definition classdef.cpp:474
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 4278 of file classdef.cpp.

4280{
4281 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4282 bool umlLook = Config_getBool(UML_LOOK);
4283 if (prot==Protection::Private && !extractPrivate) return;
4284 //printf("%s::addUsedByClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4285 //
4286 auto it = std::find_if(m_usedByImplClassList.begin(),
4288 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4289 if (it==m_usedByImplClassList.end())
4290 {
4291 m_usedByImplClassList.emplace_back(cd);
4292 //printf("Adding used by class %s to class %s\n",
4293 // qPrint(cd->name()),qPrint(name()));
4294 it = m_usedByImplClassList.end()-1;
4295 }
4296 DString acc = accessName;
4297 if (umlLook)
4298 {
4299 switch(prot)
4300 {
4301 case Protection::Public: acc.prepend("+"); break;
4302 case Protection::Private: acc.prepend("-"); break;
4303 case Protection::Protected: acc.prepend("#"); break;
4304 case Protection::Package: acc.prepend("~"); break;
4305 }
4306 }
4307 (*it).addAccessor(acc);
4308}
UsesClassList m_usedByImplClassList
Definition classdef.cpp:501
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 4246 of file classdef.cpp.

4248{
4249 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
4250 bool umlLook = Config_getBool(UML_LOOK);
4251 if (prot==Protection::Private && !extractPrivate) return;
4252 //printf("%s::addUsedClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
4253
4254 auto it = std::find_if(m_usesImplClassList.begin(),
4255 m_usesImplClassList.end(),
4256 [&cd](const auto &ucd) { return ucd.classDef==cd; });
4257 if (it==m_usesImplClassList.end())
4258 {
4259 m_usesImplClassList.emplace_back(cd);
4260 //printf("Adding used class %s to class %s via accessor %s\n",
4261 // qPrint(cd->name()),qPrint(name()),accessName);
4262 it = m_usesImplClassList.end()-1;
4263 }
4264 DString acc = accessName;
4265 if (umlLook)
4266 {
4267 switch(prot)
4268 {
4269 case Protection::Public: acc.prepend("+"); break;
4270 case Protection::Private: acc.prepend("-"); break;
4271 case Protection::Protected: acc.prepend("#"); break;
4272 case Protection::Package: acc.prepend("~"); break;
4273 }
4274 }
4275 (*it).addAccessor(acc);
4276}
UsesClassList m_usesImplClassList
Definition classdef.cpp:500

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 5316 of file classdef.cpp.

5317{
5318 DString anc;
5320 {
5322 {
5323 // point to the template of which this class is an instance
5325 }
5326 else
5327 {
5328 anc = m_fileName;
5329 }
5330 }
5331 return anc;
5332}
bool m_implicitTemplateInstance
Definition classdef.cpp:578
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 5066 of file classdef.cpp.

5067{
5068 return m_inherits;
5069}
BaseClassList m_inherits
Definition classdef.cpp:453

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 5221 of file classdef.cpp.

5222{
5223 return m_categoryOf;
5224}

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 4587 of file classdef.cpp.

4588{
4589 DString name = m_className.empty() ? localName() : m_className;
4590 auto lang = getLanguage();
4591 if (lang==SrcLangExt::CSharp)
4592 {
4594 }
4595 return name;
4596}
DString m_className
Definition classdef.cpp:516
const DString & localName() const override
DString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
Definition util.cpp:911
DString demangleCSharpGenericName(const DString &name, const DString &templArgs)
Definition util.cpp:5376

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 5510 of file classdef.cpp.

5511{
5512 switch (compoundType())
5513 {
5514 case Class: return CodeSymbolType::Class; break;
5515 case Struct: return CodeSymbolType::Struct; break;
5516 case Union: return CodeSymbolType::Union; break;
5517 case Interface: return CodeSymbolType::Interface; break;
5518 case Protocol: return CodeSymbolType::Protocol; break;
5519 case Category: return CodeSymbolType::Category; break;
5520 case Exception: return CodeSymbolType::Exception; break;
5521 case Service: return CodeSymbolType::Service; break;
5522 case Singleton: return CodeSymbolType::Singleton; break;
5523 }
5524 return CodeSymbolType::Class;
5525}
@ Singleton
Definition classdef.h:113
@ Interface
Definition classdef.h:108
@ Exception
Definition classdef.h:111

References ClassDef::Category, Category, ClassDef::Class, Class, compoundType(), ClassDef::Exception, Exception, ClassDef::Interface, Interface, ClassDef::Protocol, Protocol, 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 5490 of file classdef.cpp.

5491{
5492 return m_collabFileName;
5493}

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 5061 of file classdef.cpp.

5062{
5063 return m_compType;
5064}

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 1395 of file classdef.cpp.

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

References m_memberGroups, and m_memberLists.

◆ containsOverload()

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

Implements ClassDef.

Definition at line 5424 of file classdef.cpp.

5425{
5426 AUTO_TRACE("name={}",md->name());
5427 const auto &mni = m_allMemberNameInfoLinkedMap.find(md->name());
5428 if (mni)
5429 {
5430 for (const auto &mi : *mni)
5431 {
5432 const MemberDef *classMd = mi->memberDef();
5433 const ArgumentList &classAl = classMd->argumentList();
5434 const ArgumentList &al = md->argumentList();
5435 bool found = matchArguments2(
5436 classMd->getOuterScope(),classMd->getFileDef(),classMd->typeString(),&classAl,
5437 md->getOuterScope(),md->getFileDef(),md->typeString(),&al,
5438 true,getLanguage()
5439 );
5440 if (found)
5441 {
5442 AUTO_TRACE_EXIT("true");
5443 return true;
5444 }
5445 }
5446 }
5447 AUTO_TRACE_EXIT("false");
5448 return false;
5449}
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)
Definition util.cpp:1597

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 4861 of file classdef.cpp.

4862{
4863 int totalCount=0;
4864 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4865 {
4866 if (lde->kind()==LayoutDocEntry::MemberDecl)
4867 {
4868 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4869 if (lmd && lmd->type!=MemberListType::Friends()) // friendship is not inherited
4870 {
4871 ClassDefSet visited;
4872 totalCount+=countInheritedDecMembers(lmd->type,this,true,false,visited);
4873 }
4874 }
4875 }
4876 //printf("countAdditionalInheritedMembers()=%d\n",totalCount);
4877 return totalCount;
4878}
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:1449
std::unordered_set< const ClassDef * > ClassDefSet
Definition classdef.h:91
MemberListType type
Definition layout.h:117

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

Referenced by endMemberDeclarations().

◆ countInheritanceNodes()

int ClassDefImpl::countInheritanceNodes ( ) const
private

Definition at line 1877 of file classdef.cpp.

1878{
1880}
int countInheritsNodes() const
int countInheritedByNodes() const

References countInheritedByNodes(), and countInheritsNodes().

Referenced by writeInheritanceGraph().

◆ countInheritedByNodes()

int ClassDefImpl::countInheritedByNodes ( ) const
private

Definition at line 1855 of file classdef.cpp.

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

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 4804 of file classdef.cpp.

4807{
4808 int inhCount = 0;
4809 int count = countMembersIncludingGrouped(lt,inheritedFrom,false);
4810 bool process = count>0;
4811 //printf("%s: countInheritedDecMembers: lt=%s process=%d count=%d invert=%d\n",
4812 // qPrint(name()),lt.to_string(),process,count,invert);
4813 if ((process^invert) || showAlways)
4814 {
4815 for (const auto &ibcd : m_inherits)
4816 {
4817 ClassDefMutable *icd = toClassDefMutable(ibcd.classDef);
4818 MemberListType lt1 = MemberListType::Invalid();
4819 MemberListType lt2 = MemberListType::Invalid();
4820 if (icd && icd->isLinkable())
4821 {
4822 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt2);
4823 //printf("%s: convert %s->(%s,%s) prot=%d\n",
4824 // qPrint(icd->name()),lt.to_string(),lt1.to_string(),lt2.to_string(),ibcd.prot);
4825 if (visitedClasses.find(icd)==visitedClasses.end())
4826 {
4827 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4828 if (!lt1.isInvalid())
4829 {
4830 inhCount+=icd->countMemberDeclarations(lt1,inheritedFrom,lt2,false,true,visitedClasses);
4831 }
4832 }
4833 }
4834 }
4835 }
4836 //printf("%s: count=%d\n",qPrint(name()),inhCount);
4837 return inhCount;
4838}
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:4913

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 1866 of file classdef.cpp.

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

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 4726 of file classdef.cpp.

4728{
4729 //printf("%s: countMemberDeclarations for %s and %s\n",qPrint(name()),lt.to_string(),lt2.to_string());
4730 int count=0;
4731 MemberList * ml = getMemberList(lt);
4732 MemberList * ml2 = getMemberList(lt2);
4733 if (getLanguage()!=SrcLangExt::VHDL) // use specific declarations function
4734 {
4735 if (ml)
4736 {
4737 count+=ml->numDecMembers(inheritedFrom);
4738 //printf("-> ml=%d\n",ml->numDecMembers());
4739 }
4740 if (ml2)
4741 {
4742 count+=ml2->numDecMembers(inheritedFrom);
4743 //printf("-> ml2=%d\n",ml2->numDecMembers());
4744 }
4745 // also include grouped members that have their own section in the class (see bug 722759)
4746 if (inheritedFrom)
4747 {
4748 for (const auto &mg : m_memberGroups)
4749 {
4750 count+=mg->countGroupedInheritedMembers(lt);
4751 if (!lt2.isInvalid()) count+=mg->countGroupedInheritedMembers(lt2);
4752 }
4753 }
4754 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
4755 if (!inlineInheritedMembers) // show inherited members as separate lists
4756 {
4757 count+=countInheritedDecMembers(lt,inheritedFrom,invert,showAlways,visitedClasses);
4758 }
4759 }
4760 //printf("-> %d\n",count);
4761 return count;
4762}
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 4790 of file classdef.cpp.

4791{
4792 for (auto &ml : m_memberLists)
4793 {
4794 ml->countDecMembers();
4795 ml->countDocMembers();
4796 }
4797 for (const auto &mg : m_memberGroups)
4798 {
4799 mg->countDecMembers();
4800 mg->countDocMembers();
4801 }
4802}

References m_memberGroups, and m_memberLists.

◆ countMembersIncludingGrouped()

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

Implements ClassDef.

Definition at line 4897 of file classdef.cpp.

4899{
4900 int count=0;
4901 MemberList *ml = getMemberList(lt);
4902 if (ml)
4903 {
4904 count=ml->countInheritableMembers(inheritedFrom);
4905 }
4906 //printf("%s:countMembersIncludingGrouped: count=%d\n",qPrint(name()),count);
4907 for (const auto &mg : m_memberGroups)
4908 {
4909 bool hasOwnSection = !mg->allMembersInSameSection() ||
4910 !m_subGrouping; // group is in its own section
4911 if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
4912 {
4913 count+=mg->countGroupedInheritedMembers(lt);
4914 }
4915 }
4916 //printf("%s:countMembersIncludingGrouped(lt=%s,%s)=%d\n",
4917 // qPrint(name()),qPrint(lt.to_string()),ml?qPrint(ml->listType().to_string()):"<none>",count);
4918 return count;
4919}
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 891 of file classdef.cpp.

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

208{ 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 1022 of file classdef.cpp.

1023{
1024 return makeDisplayName(this,includeScope);
1025}
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 1411 of file classdef.cpp.

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

References m_memberGroups.

◆ endMemberDeclarations()

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

Definition at line 2272 of file classdef.cpp.

2273{
2274 //printf("%s: ClassDefImpl::endMemberDeclarations()\n",qPrint(name()));
2275 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
2276 if (!inlineInheritedMembers && countAdditionalInheritedMembers()>0)
2277 {
2278 ol.startMemberHeader("inherited");
2280 ol.endMemberHeader();
2282 }
2283 ol.endMemberSections();
2284}
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 2256 of file classdef.cpp.

2257{
2258 //printf("%s: ClassDefImpl::endMemberDocumentation()\n",qPrint(name()));
2259 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2260 {
2263 }
2264}
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 1419 of file classdef.cpp.

1420{
1424 for (const auto &mg : m_memberGroups)
1425 {
1426 mg->findSectionsInDocumentation(this);
1427 }
1428 for (auto &ml : m_memberLists)
1429 {
1430 if (!ml->listType().isDetailed())
1431 {
1432 ml->findSectionsInDocumentation(this);
1433 }
1434 }
1435}
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 1745 of file classdef.cpp.

1746{
1747 DString result;
1748 SrcLangExt lang = getLanguage();
1749 size_t numFiles = m_files.size();
1750 if (lang==SrcLangExt::Fortran)
1751 {
1753 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1754 numFiles==1);
1755 }
1756 else if (isJavaEnum())
1757 {
1758 result = theTranslator->trEnumGeneratedFromFiles(numFiles==1);
1759 }
1760 else if (m_compType==Service)
1761 {
1762 result = theTranslator->trServiceGeneratedFromFiles(numFiles==1);
1763 }
1764 else if (m_compType==Singleton)
1765 {
1766 result = theTranslator->trSingletonGeneratedFromFiles(numFiles==1);
1767 }
1768 else
1769 {
1771 getLanguage()==SrcLangExt::ObjC && m_compType==Interface ? Class : m_compType,
1772 numFiles==1);
1773 }
1774 return result;
1775}
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 5056 of file classdef.cpp.

5057{
5058 return m_innerClasses;
5059}

References m_innerClasses.

◆ getExamples()

const ExampleList & ClassDefImpl::getExamples ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5470 of file classdef.cpp.

5471{
5472 return m_examples;
5473}

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 5111 of file classdef.cpp.

5112{
5113 return m_fileDef;
5114}

References m_fileDef.

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

◆ getInstanceOutputFileBase()

DString ClassDefImpl::getInstanceOutputFileBase ( ) const
overridevirtual

Implements ClassDef.

Definition at line 4354 of file classdef.cpp.

4355{
4356 return m_fileName;
4357}

References m_fileName.

◆ getMemberByName()

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

Returns the member with the given name.

Implements ClassDef.

Definition at line 4645 of file classdef.cpp.

4646{
4647 const MemberDef *xmd = nullptr;
4648 const MemberNameInfo *mni = m_allMemberNameInfoLinkedMap.find(name);
4649 if (mni)
4650 {
4651 const int maxInheritanceDepth = 100000;
4652 int mdist=maxInheritanceDepth;
4653 for (auto &mi : *mni)
4654 {
4655 const ClassDef *mcd=mi->memberDef()->getClassDef();
4656 int m=minClassDistance(this,mcd);
4657 //printf("found member in %s linkable=%d m=%d\n",
4658 // qPrint(mcd->name()),mcd->isLinkable(),m);
4659 if (m<mdist)
4660 {
4661 mdist=m;
4662 xmd=mi->memberDef();
4663 }
4664 }
4665 }
4666 //printf("getMemberByName(%s)=%p\n",qPrint(name),xmd);
4667 return xmd;
4668}
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 5231 of file classdef.cpp.

5232{
5233 return m_memberGroups;
5234}

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 4675 of file classdef.cpp.

4676{
4677 for (auto &ml : m_memberLists)
4678 {
4679 if (ml->listType()==lt)
4680 {
4681 return ml.get();
4682 }
4683 }
4684 return nullptr;
4685}

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 1017 of file classdef.cpp.

1018{
1019 return m_memberListFileName;
1020}

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 5226 of file classdef.cpp.

5227{
5228 return m_memberLists;
5229}

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 5116 of file classdef.cpp.

5117{
5118 return m_moduleDef;
5119}

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 4316 of file classdef.cpp.

4317{
4318 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
4319 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
4321 {
4322 Definition *scope=nullptr;
4323 if (inlineGroupedClasses && !partOfGroups().empty())
4324 {
4325 // point to the group that embeds this class
4326 return partOfGroups().front()->getOutputFileBase();
4327 }
4328 else if (inlineSimpleClasses && m_isSimple && !partOfGroups().empty())
4329 {
4330 // point to simple struct inside a group
4331 return partOfGroups().front()->getOutputFileBase();
4332 }
4333 else if (inlineSimpleClasses && m_isSimple && (scope=getOuterScope()))
4334 {
4335 if (scope==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) // simple struct embedded in file
4336 {
4337 return getFileDef()->getOutputFileBase();
4338 }
4339 else if (scope->isLinkableInProject()) // simple struct embedded in other container (namespace/group/class)
4340 {
4341 return getOuterScope()->getOutputFileBase();
4342 }
4343 }
4344 }
4345 AUTO_TRACE("name='{}' m_templateMaster={} m_implicitTemplateInstance={}",name(),(void*)m_templateMaster,m_implicitTemplateInstance);
4347 {
4348 // point to the template of which this class is an instance
4350 }
4351 return m_fileName;
4352}
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 5419 of file classdef.cpp.

5420{
5421 return m_qualifiers;
5422}

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 4541 of file classdef.cpp.

4542{
4544 {
4546 }
4547 else
4548 {
4550 }
4551}
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 4359 of file classdef.cpp.

4360{
4362 {
4364 }
4365 else
4366 {
4368 }
4369}
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 4484 of file classdef.cpp.

4485{
4486 return m_templBaseClassNames;
4487}

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 5121 of file classdef.cpp.

5122{
5123 return m_templateInstances;
5124}

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 4565 of file classdef.cpp.

4566{
4567 ArgumentLists result;
4568 Definition *d=getOuterScope();
4569 while (d && d->definitionType()==Definition::TypeClass)
4570 {
4571 result.insert(result.begin(),toClassDef(d)->templateArguments());
4572 d = d->getOuterScope();
4573 }
4574 if (!templateArguments().empty())
4575 {
4576 result.push_back(templateArguments());
4577 }
4578 return result;
4579}

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 4840 of file classdef.cpp.

4842{
4843 SrcLangExt lang = getLanguage();
4844 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4845 {
4846 if (lde->kind()==LayoutDocEntry::MemberDecl)
4847 {
4848 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4849 if (lmd && lmd->type==type)
4850 {
4851 title = lmd->title(lang);
4852 subtitle = lmd->subtitle(lang);
4853 return;
4854 }
4855 }
4856 }
4857 title="";
4858 subtitle="";
4859}
DString title() const override
DString subtitle(SrcLangExt lang) const
Definition layout.cpp:1805
DString title(SrcLangExt lang) const
Definition layout.cpp:1800

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 5532 of file classdef.cpp.

5533{
5535}

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 1697 of file classdef.cpp.

1698{
1699 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1700 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1701 return ((!briefDescription().empty() && repeatBrief) ||
1703 !typeConstraints().empty() ||
1704 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()) ||
1706}
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 3724 of file classdef.cpp.

3725{
3727}
bool hasDocumentation() const override

References DefinitionMixin< Base >::hasDocumentation().

Referenced by isLinkableInProject(), and isVisibleInHierarchy().

◆ hasExamples()

bool ClassDefImpl::hasExamples ( ) const
overridevirtual

Implements ClassDef.

Definition at line 3475 of file classdef.cpp.

3476{
3477 return !m_examples.empty();
3478}

References m_examples.

Referenced by writeDetailedDocumentationBody(), and writeDocumentationContents().

◆ hasInheritanceGraph()

CLASS_GRAPH_t ClassDefImpl::hasInheritanceGraph ( ) const
overridevirtual

Implements ClassDefMutable.

Definition at line 5505 of file classdef.cpp.

5506{
5508}

References m_typeInheritanceGraph.

◆ hasNamedVariable()

bool ClassDefImpl::hasNamedVariable ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5379 of file classdef.cpp.

5380{
5381 return m_hasNamedVariable;
5382}

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 3592 of file classdef.cpp.

3593{
3594 return hasNonReferenceSuperClassRec(this,0);
3595}
static bool hasNonReferenceSuperClassRec(const ClassDef *cd, int level)

References hasNonReferenceSuperClassRec().

Referenced by isVisibleInHierarchy().

◆ hideDerivedVariablesInPython()

void ClassDefImpl::hideDerivedVariablesInPython ( ClassDefMutable * cls)
private

Definition at line 4035 of file classdef.cpp.

4036{
4037 //printf("hideDerivedVariableInPython()\n");
4038 if (bClass)
4039 {
4040 const MemberNameInfoLinkedMap &srcMnd = bClass->memberNameInfoLinkedMap();
4041 MemberNameInfoLinkedMap &dstMnd = m_allMemberNameInfoLinkedMap;
4042
4043 // recurse up the inheritance hierarchy
4044 for (const auto &bcd : bClass->baseClasses())
4045 {
4047 }
4048
4049 for (auto &srcMni : srcMnd) // for each member in a base class
4050 {
4051 //printf(" candidate(%s)\n",qPrint(srcMni->memberName()));
4052 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4053 if (dstMni) // that is also in this class
4054 {
4056 //printf("%s member in %s and %s\n",qPrint(name()),qPrint(bClass->name()),qPrint(name()));
4057 for (it=dstMni->begin();it!=dstMni->end();)
4058 {
4059 MemberDefMutable *dstMd = toMemberDefMutable((*it)->memberDef());
4060 if (dstMd && dstMd->isVariable() && !dstMd->name().startsWith("__"))
4061 {
4062 //printf(" hiding member %s\n",qPrint(dstMd->name()));
4063 // hide a member variable if it is already defined in a base class, unless
4064 // it is a __private variable
4065 removeMemberFromLists(dstMd);
4066 it = dstMni->erase(it);
4067 }
4068 else
4069 {
4070 ++it;
4071 }
4072 }
4073 if (dstMni->empty()) // if the list has become empty, remove the entry from the dictionary
4074 {
4075 dstMnd.del(srcMni->memberName());
4076 }
4077 }
4078 }
4079 }
4080}
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 5146 of file classdef.cpp.

5147{
5148 return m_incInfo.get();
5149}

References m_incInfo.

◆ inheritanceGraphFileName()

DString ClassDefImpl::inheritanceGraphFileName ( ) const
overridevirtual

returns the file name to use for the inheritance graph

Implements ClassDef.

Definition at line 5495 of file classdef.cpp.

5496{
5497 return m_inheritFileName;
5498}

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 1028 of file classdef.cpp.

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

References m_inherits, and m_isSimple.

Referenced by mergeCategory().

◆ insertExplicitTemplateInstance()

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

Implements ClassDefMutable.

Definition at line 4473 of file classdef.cpp.

4474{
4475 AUTO_TRACE("this={} cd={} templSpec={}",name(),templateClass->name(),templSpec);
4476 m_templateInstances.emplace_back(templSpec,templateClass);
4477}

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

◆ insertMember()

void ClassDefImpl::insertMember ( MemberDef * md)
overridevirtual

Implements ClassDefMutable.

Definition at line 1389 of file classdef.cpp.

1390{
1391 internalInsertMember(md,md->protection(),true);
1392}
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 1037 of file classdef.cpp.

1039{
1040 //printf("*** insert sub class %s into %s\n",qPrint(cd->name()),qPrint(name()));
1041 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
1042 if (!extractPrivate && cd->protection()==Protection::Private) return;
1043 m_inheritedBy.emplace_back(cd,DString(),p,s,t);
1044 m_isSimple = false;
1045}
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 4410 of file classdef.cpp.

4412{
4413 freshInstance = false;
4414 auto it = std::find_if(m_templateInstances.begin(),
4415 m_templateInstances.end(),
4416 [&templSpec](const auto &ti) { return templSpec==ti.templSpec; });
4417 ClassDefMutable *templateClass=nullptr;
4418 if (it!=m_templateInstances.end())
4419 {
4420 templateClass = toClassDefMutable((*it).classDef);
4421 }
4422 if (templateClass==nullptr)
4423 {
4424 DString tcname = removeRedundantWhiteSpace(name()+templSpec);
4425 AUTO_TRACE("New template instance class name='{}' templSpec='{}' inside '{}' hidden={}",
4426 name(),templSpec,name(),isHidden());
4427
4428 ClassDef *foundCd = Doxygen::classLinkedMap->find(tcname);
4429 if (foundCd)
4430 {
4431 return foundCd;
4432 }
4433 templateClass =
4435 Doxygen::classLinkedMap->add(tcname,
4436 std::unique_ptr<ClassDef>(
4437 new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
4438 if (templateClass)
4439 {
4440 templateClass->setTemplateMaster(this);
4441 ArgumentList tal = *stringToArgumentList(getLanguage(),templSpec);
4442 templateClass->setTemplateArguments(tal);
4443 templateClass->setOuterScope(getOuterScope());
4444 templateClass->setHidden(isHidden());
4445 templateClass->setArtificial(isArtificial());
4446 templateClass->setImplicitTemplateInstance(true);
4447 m_templateInstances.emplace_back(templSpec,templateClass);
4448
4449 // also add nested classes
4450 for (const auto &innerCd : m_innerClasses)
4451 {
4452 DString innerName = tcname+"::"+innerCd->localName();
4453 ClassDefMutable *innerClass =
4455 Doxygen::classLinkedMap->add(innerName,
4456 std::unique_ptr<ClassDef>(
4457 new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
4458 if (innerClass)
4459 {
4460 templateClass->addInnerCompound(innerClass);
4461 innerClass->setOuterScope(templateClass);
4462 innerClass->setHidden(isHidden());
4463 innerClass->setArtificial(true);
4464 innerClass->setImplicitTemplateInstance(true);
4465 }
4466 }
4467 freshInstance=true;
4468 }
4469 }
4470 return templateClass;
4471}
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 1439 of file classdef.cpp.

1440{
1441 if (fd == nullptr) return;
1442
1443 if (std::find(m_files.begin(), m_files.end(), fd) == m_files.end()) m_files.push_back(fd);
1444
1445 for (const auto &ti : m_templateInstances)
1446 {
1447 ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
1448 if (cdm && cdm->isImplicitTemplateInstance()) // (partial) specializations have their own files
1449 {
1450 cdm->insertUsedFile(fd);
1451 }
1452 }
1453}
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 1069 of file classdef.cpp.

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

5172{
5173 return m_isAbstract || m_spec.isAbstract();
5174}

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 4670 of file classdef.cpp.

4671{
4672 return md->getClassDef() && isBaseClass(md->getClassDef(),true,DString());
4673}
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 3734 of file classdef.cpp.

3735{
3736 int distance=0;
3737 //printf("isBaseClass(cd=%s) looking for %s templSpec=%s\n",qPrint(name()),qPrint(bcd->name()),qPrint(templSpec));
3738 for (const auto &bclass : baseClasses())
3739 {
3740 const ClassDef *ccd = bclass.classDef;
3741 if (!followInstances && ccd->templateMaster())
3742 {
3743 ccd=ccd->templateMaster();
3744 }
3745 if (ccd==bcd && (templSpec.empty() || templSpec==bclass.templSpecifiers))
3746 {
3747 distance=1;
3748 break; // no shorter path possible
3749 }
3750 else
3751 {
3752 int d = ccd->isBaseClass(bcd,followInstances,templSpec);
3753 if (d>256)
3754 {
3755 err("Possible recursive class relation while inside {} and looking for base class {}\n",name(),bcd->name());
3756 return 0;
3757 }
3758 else if (d>0) // path found
3759 {
3760 if (distance==0 || d+1<distance) // update if no path found yet or shorter path found
3761 {
3762 distance=d+1;
3763 }
3764 }
3765 }
3766 }
3767 return distance;
3768}
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 5216 of file classdef.cpp.

5217{
5218 return getLanguage()==SrcLangExt::CSharp;
5219}

References DefinitionMixin< ClassDefMutable >::getLanguage().

◆ isEmbeddedInOuterScope()

bool ClassDefImpl::isEmbeddedInOuterScope ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5334 of file classdef.cpp.

5335{
5336 bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
5337 bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS);
5338
5339 Definition *container = getOuterScope();
5340
5341 bool containerLinkable =
5342 container &&
5343 (
5344 (container==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) || // global class in documented file
5345 container->isLinkableInProject() // class in documented scope
5346 );
5347
5348 if (isAnonymous())
5349 {
5350 return false; // don't inline an anonymous class
5351 }
5352
5353 // inline because of INLINE_GROUPED_CLASSES=YES ?
5354 bool b1 = (inlineGroupedClasses && !partOfGroups().empty()); // a grouped class
5355 // inline because of INLINE_SIMPLE_STRUCTS=YES ?
5356 bool b2 = (inlineSimpleClasses && m_isSimple && // a simple class
5357 (containerLinkable || // in a documented container
5358 !partOfGroups().empty() // or part of a group
5359 )
5360 );
5361 //printf("%s::isEmbeddedInOuterScope(): inlineGroupedClasses=%d "
5362 // "inlineSimpleClasses=%d partOfGroups()=%d m_isSimple=%d "
5363 // "getOuterScope()=%s b1=%d b2=%d\n",
5364 // qPrint(name()),inlineGroupedClasses,inlineSimpleClasses,
5365 // !partOfGroups().empty(),m_isSimple,getOuterScope()?qPrint(getOuterScope()->name()):"<none>",b1,b2);
5366 return b1 || b2; // either reason will do
5367}

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 5451 of file classdef.cpp.

5452{
5453 DString n = name();
5454 size_t si = n.find('(');
5455 size_t ei = n.find(')');
5456 bool b = si!=DString::npos && ei!=DString::npos && ei>si && n.mid(si+1,ei-si-1).stripWhiteSpace().empty();
5457 return b;
5458}

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 5176 of file classdef.cpp.

5177{
5178 return m_spec.isFinal();
5179}

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 5211 of file classdef.cpp.

5212{
5213 return getLanguage()==SrcLangExt::Fortran;
5214}

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 5196 of file classdef.cpp.

5197{
5198 return m_spec.isForwardDecl();
5199}

References m_spec.

◆ isImplicitTemplateInstance()

bool ClassDefImpl::isImplicitTemplateInstance ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5131 of file classdef.cpp.

5132{
5134}

References m_implicitTemplateInstance.

◆ isInterface()

bool ClassDefImpl::isInterface ( ) const
overridevirtual

Returns true if this class represents an interface.

Implements ClassDef.

Definition at line 5201 of file classdef.cpp.

5202{
5203 return m_spec.isInterface();
5204}

References m_spec.

◆ isJavaEnum()

bool ClassDefImpl::isJavaEnum ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5397 of file classdef.cpp.

5398{
5399 return m_isJavaEnum;
5400}

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 3677 of file classdef.cpp.

3678{
3680 {
3681 return m_templateMaster->isLinkable();
3682 }
3683 else
3684 {
3685 return isReference() || isLinkableInProject();
3686 }
3687}
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 3645 of file classdef.cpp.

3646{
3647 bool extractLocal = Config_getBool(EXTRACT_LOCAL_CLASSES);
3648 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3649 bool hideUndoc = Config_getBool(HIDE_UNDOC_CLASSES);
3651 {
3653 }
3654 else
3655 {
3656 //printf("%s::isLinkableInProject() conditions: artificial=%d hidden=%d anonymous=%d protection=%d local=%d docs=%d static=%d ref=%d\n",
3657 // qPrint(name()),
3658 // !isArtificial(),
3659 // !isHidden(),
3660 // !isAnonymous(),
3661 // protectionLevelVisible(m_prot),
3662 // !m_isLocal || extractLocal,
3663 // hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc,
3664 // !m_isStatic || extractStatic,
3665 // !isReference());
3666 return
3667 !isArtificial() && !isHidden() && /* not hidden */
3668 !isAnonymous() && /* not anonymous */
3669 protectionLevelVisible(m_prot) && /* private/internal */
3670 (!m_isLocal || extractLocal) && /* local */
3671 (hasDocumentation() || m_tempArgs.hasTemplateDocumentation() || !hideUndoc) && /* documented */
3672 (!m_isStatic || extractStatic) && /* static */
3673 !isReference(); /* not an external reference */
3674 }
3675}
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 5051 of file classdef.cpp.

5052{
5053 return m_isLocal;
5054}

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 5206 of file classdef.cpp.

5207{
5208 return getLanguage()==SrcLangExt::ObjC;
5209}

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 5191 of file classdef.cpp.

5192{
5193 return m_spec.isPublished();
5194}

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 5186 of file classdef.cpp.

5187{
5188 return m_spec.isRef();
5189}

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 4553 of file classdef.cpp.

4554{
4556 {
4557 return m_templateMaster->isReference();
4558 }
4559 else
4560 {
4562 }
4563}
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 5181 of file classdef.cpp.

5182{
5183 return m_spec.isSealed();
5184}

References m_spec.

Referenced by addClassAttributes().

◆ isSimple()

bool ClassDefImpl::isSimple ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5296 of file classdef.cpp.

5297{
5298 return m_isSimple;
5299}

References m_isSimple.

Referenced by internalInsertMember(), and writeInlineDocumentation().

◆ isSliceLocal()

bool ClassDefImpl::isSliceLocal ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5480 of file classdef.cpp.

5481{
5482 return m_spec.isLocal();
5483}

References m_spec.

Referenced by title(), and writeDeclarationLink().

◆ isSmartPointer()

const MemberDef * ClassDefImpl::isSmartPointer ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5301 of file classdef.cpp.

5302{
5303 return m_arrowOperator;
5304}

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 3772 of file classdef.cpp.

3773{
3774 bool found=false;
3775 if (level>256)
3776 {
3777 err("Possible recursive class relation while inside {} and looking for derived class {}\n",name(),cd->name());
3778 return false;
3779 }
3780 for (const auto &iscd : subClasses())
3781 {
3782 ClassDef *ccd=iscd.classDef;
3783 found = (ccd==cd) || ccd->isSubClass(cd,level+1);
3784 if (found) break;
3785 }
3786 return found;
3787}
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 5141 of file classdef.cpp.

5142{
5143 return !m_tempArgs.empty();
5144}
bool empty() const
Definition arguments.h:100

References ArgumentList::empty(), and m_tempArgs.

◆ isTemplateArgument()

bool ClassDefImpl::isTemplateArgument ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5166 of file classdef.cpp.

5167{
5168 return m_isTemplArg;
5169}

References m_isTemplArg.

◆ isUsedOnly()

bool ClassDefImpl::isUsedOnly ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5291 of file classdef.cpp.

5292{
5293 return m_usedOnly;
5294}

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 3691 of file classdef.cpp.

3692{
3693 bool allExternals = Config_getBool(ALLEXTERNALS);
3694 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
3695 bool extractStatic = Config_getBool(EXTRACT_STATIC);
3696
3697 //printf("%s: isArtificial=%d isAnonymous=%d protectionLevelVisible=%d hasDocumentation=%d templateInstance=%d static=%d\n",
3698 // qPrint(name()),
3699 // (allExternals && !isArtificial()) || hasNonReferenceSuperClass(),
3700 // !isAnonymous(),
3701 // protectionLevelVisible(m_prot),
3702 // (hasDocumentation() || !hideUndocClasses || (m_templateMaster && m_templateMaster->hasDocumentation()) || isReference()),
3703 // !m_implicitTemplateInstance || !m_inherits.empty() || !m_inheritedBy.empty(),
3704 // !m_isStatic || extractStatic);
3705
3706 return // show all classes or a subclass is visible
3707 ((allExternals && !isArtificial()) || hasNonReferenceSuperClass()) &&
3708 // and not an anonymous compound
3709 !isAnonymous() &&
3710 // and not privately inherited
3712 // documented or shown anyway or documentation is external
3713 (hasDocumentation() ||
3714 !hideUndocClasses ||
3716 isReference()
3717 ) &&
3718 // if this is an implicit template instance then it most be part of the inheritance hierarchy
3719 (!m_implicitTemplateInstance || !m_inherits.empty() || !m_inheritedBy.empty()) &&
3720 // is not part of an unnamed namespace or shown anyway
3721 (!m_isStatic || extractStatic);
3722}
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 5276 of file classdef.cpp.

5277{
5278 m_isTemplArg = b;
5279}

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 5086 of file classdef.cpp.

5087{
5089}

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 4128 of file classdef.cpp.

4129{
4130 AUTO_TRACE();
4131 ClassDefMutable *category = toClassDefMutable(cat);
4132 if (category)
4133 {
4134 bool extractLocalMethods = Config_getBool(EXTRACT_LOCAL_METHODS);
4135 bool makePrivate = category->isLocal();
4136 // in case extract local methods is not enabled we don't add the methods
4137 // of the category in case it is defined in the .m file.
4138 if (makePrivate && !extractLocalMethods) return;
4139 bool isExtension = category->isExtension();
4140
4141 category->setCategoryOf(this);
4142 if (isExtension)
4143 {
4144 category->setArtificial(true);
4145
4146 // copy base classes/protocols from extension
4147 for (const auto &bcd : category->baseClasses())
4148 {
4149 insertBaseClass(bcd.classDef,bcd.usedName,bcd.prot,bcd.virt,bcd.templSpecifiers);
4150 // correct bcd.classDef so that they do no longer derive from
4151 // category, but from this class!
4152 BaseClassList scl = bcd.classDef->subClasses();
4153 for (auto &scd : scl)
4154 {
4155 if (scd.classDef==category)
4156 {
4157 scd.classDef=this;
4158 }
4159 }
4160 bcd.classDef->updateSubClasses(scl);
4161 }
4162 }
4163 // make methods private for categories defined in the .m file
4164 //printf("%s::mergeCategory makePrivate=%d\n",qPrint(name()),makePrivate);
4165
4166 const MemberNameInfoLinkedMap &srcMnd = category->memberNameInfoLinkedMap();
4167 MemberNameInfoLinkedMap &dstMnd = m_allMemberNameInfoLinkedMap;
4168
4169 for (auto &srcMni : srcMnd)
4170 {
4171 MemberNameInfo *dstMni=dstMnd.find(srcMni->memberName());
4172 if (dstMni) // method is already defined in the class
4173 {
4174 AUTO_TRACE_ADD("Existing member {}",srcMni->memberName());
4175 const auto &dstMi = dstMni->front();
4176 const auto &srcMi = srcMni->front();
4177 if (srcMi && dstMi)
4178 {
4179 MemberDefMutable *smdm = toMemberDefMutable(srcMi->memberDef());
4180 MemberDefMutable *dmdm = toMemberDefMutable(dstMi->memberDef());
4181 if (smdm && dmdm)
4182 {
4184 dmdm->setCategory(category);
4185 dmdm->setCategoryRelation(smdm);
4186 smdm->setCategoryRelation(dmdm);
4187 }
4188 }
4189 }
4190 else // new method name
4191 {
4192 AUTO_TRACE_ADD("New member {}",srcMni->memberName());
4193 // create a deep copy of the list
4194 MemberNameInfo *newMni = dstMnd.add(srcMni->memberName());
4195
4196 // copy the member(s) from the category to this class
4197 for (auto &mi : *srcMni)
4198 {
4199 //printf("Adding '%s'\n",qPrint(mi->memberDef->name()));
4200 Protection prot = mi->prot();
4201 //if (makePrivate) prot = Private;
4202 auto newMd = mi->memberDef()->deepCopy();
4203 if (newMd)
4204 {
4205 auto mmd = toMemberDefMutable(newMd.get());
4206 AUTO_TRACE_ADD("Copying member {}",mmd->name());
4207 if (mmd)
4208 {
4209 mmd->moveTo(this);
4210 }
4211
4212 auto newMi=std::make_unique<MemberInfo>(newMd.get(),prot,mi->virt(),mi->inherited(),mi->virtualBaseClass());
4213 newMi->setScopePath(mi->scopePath());
4214 newMi->setAmbigClass(mi->ambigClass());
4215 newMi->setAmbiguityResolutionScope(mi->ambiguityResolutionScope());
4216 newMni->push_back(std::move(newMi));
4217
4218 // also add the newly created member to the global members list
4219
4220 DString name = newMd->name();
4221 MemberName *mn = Doxygen::memberNameLinkedMap->add(name);
4222
4223 if (mmd)
4224 {
4225 mmd->setCategory(category);
4226 mmd->setCategoryRelation(mi->memberDef());
4227 }
4228 auto miMmd = toMemberDefMutable(mi->memberDef());
4229 if (miMmd) miMmd->setCategoryRelation(newMd.get());
4230
4231 if (mmd && (makePrivate || isExtension))
4232 {
4233 mmd->makeImplementationDetail();
4234 }
4235 internalInsertMember(newMd.get(),prot,false);
4236 mn->push_back(std::move(newMd));
4237 }
4238 }
4239 }
4240 }
4241 }
4242}
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 4087 of file classdef.cpp.

4088{
4089 if (m_membersMerged) return;
4090 if (getLanguage()==SrcLangExt::Python)
4091 {
4092 for (const auto &bcd : baseClasses())
4093 {
4094 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4096 }
4097 }
4098
4099 //printf("> %s::mergeMembers()\n",qPrint(name()));
4100
4101 m_membersMerged=true;
4102
4103 // first merge the members of the base class recursively
4104 for (const auto &bcd : baseClasses())
4105 {
4106 ClassDefMutable *bClass=toClassDefMutable(bcd.classDef);
4107 if (bClass)
4108 {
4109 // merge the members in the base class of this inheritance branch first
4110 bClass->mergeMembers();
4111 }
4112 }
4113
4114 // first merge the member that are not inherited via a virtual base class
4115 // (as this can end up reimplemented via multiple paths, see #10717 for examples)
4117 // then process the member that are inherited via a virtual base class to add the
4118 // ones that are not reimplemented via any path
4120
4121 //printf("< %s::mergeMembers()\n",qPrint(name()));
4122}
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 3798 of file classdef.cpp.

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

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 1003 of file classdef.cpp.

1004{
1005 //printf("%s::moveTo(%s)\n",qPrint(name()),qPrint(scope->name()));
1006 setOuterScope(scope);
1008 {
1009 m_fileDef = toFileDef(scope);
1010 }
1011 else if (scope->definitionType()==Definition::TypeModule)
1012 {
1013 m_moduleDef = toModuleDef(scope);
1014 }
1015}
void setOuterScope(Definition *def) override
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:2033
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 5527 of file classdef.cpp.

5528{
5530}

References m_hasCollaborationGraph.

◆ overrideInheritanceGraph()

void ClassDefImpl::overrideInheritanceGraph ( CLASS_GRAPH_t e)
overridevirtual

Implements ClassDefMutable.

Definition at line 5500 of file classdef.cpp.

5501{
5503}

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 5101 of file classdef.cpp.

5102{
5103 return m_prot;
5104}

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 4581 of file classdef.cpp.

4583{
4584 return makeQualifiedNameWithTemplateParameters(this,actualParams,actualParamIndex);
4585}
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 5306 of file classdef.cpp.

5307{
5308 md->setMemberType(t);
5309 for (auto &ml : m_memberLists)
5310 {
5311 ml->remove(md);
5312 }
5313 insertMember(md);
5314}
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 5389 of file classdef.cpp.

5390{
5391 for (auto &ml : m_memberLists)
5392 {
5393 ml->remove(md);
5394 }
5395}

References m_memberLists.

Referenced by hideDerivedVariablesInPython().

◆ requiresClause()

DString ClassDefImpl::requiresClause ( ) const
overridevirtual

Implements ClassDef.

Definition at line 3597 of file classdef.cpp.

3598{
3599 return m_requiresClause;
3600}

References m_requiresClause.

◆ setAnonymousEnumType()

void ClassDefImpl::setAnonymousEnumType ( )
overridevirtual

Implements ClassDefMutable.

Definition at line 4764 of file classdef.cpp.

4765{
4766 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
4767 {
4768 if (lde->kind()==LayoutDocEntry::MemberDecl)
4769 {
4770 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
4771 if (lmd)
4772 {
4773 MemberList * ml = getMemberList(lmd->type);
4774 if (ml)
4775 {
4777 }
4778 }
4779 }
4780 else if (lde->kind()==LayoutDocEntry::MemberGroups)
4781 {
4782 for (const auto &mg : m_memberGroups)
4783 {
4784 mg->setAnonymousEnumType();
4785 }
4786 }
4787 }
4788}
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 5281 of file classdef.cpp.

5282{
5283 m_categoryOf = cd;
5284}

References m_categoryOf.

◆ setClassName()

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

Implements ClassDefMutable.

Definition at line 4598 of file classdef.cpp.

4599{
4600 m_className = name;
4601}

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

◆ setClassSpecifier()

void ClassDefImpl::setClassSpecifier ( TypeSpecifier spec)
overridevirtual

Implements ClassDefMutable.

Definition at line 5402 of file classdef.cpp.

5403{
5404 m_spec = spec;
5405}

References m_spec.

◆ setCompoundType()

void ClassDefImpl::setCompoundType ( CompoundType t)
overridevirtual

Implements ClassDefMutable.

Definition at line 5265 of file classdef.cpp.

5266{
5267 m_compType = t;
5268}

References m_compType.

◆ setFileDef()

void ClassDefImpl::setFileDef ( FileDef * fd)
overridevirtual

Implements ClassDefMutable.

Definition at line 5236 of file classdef.cpp.

5237{
5238 m_fileDef = fd;
5239}

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 4371 of file classdef.cpp.

4372{
4373 gd->addClass(this);
4374 //printf("ClassDefImpl::setGroupDefForAllMembers(%s)\n",qPrint(gd->name()));
4375 for (auto &mni : m_allMemberNameInfoLinkedMap)
4376 {
4377 for (auto &mi : *mni)
4378 {
4379 MemberDefMutable *md = toMemberDefMutable(mi->memberDef());
4380 if (md)
4381 {
4382 md->setGroupDef(gd,pri,fileName,startLine,hasDocs);
4383 gd->insertMember(md,true);
4384 ClassDefMutable *innerClass = toClassDefMutable(const_cast<ClassDef*>(md->getClassDefOfAnonymousType()));
4385 if (innerClass) innerClass->setGroupDefForAllMembers(gd,pri,fileName,startLine,hasDocs);
4386 }
4387 }
4388 }
4389}
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 5384 of file classdef.cpp.

5385{
5387}

References m_hasNamedVariable.

◆ setImplicitTemplateInstance()

void ClassDefImpl::setImplicitTemplateInstance ( bool b)
overridevirtual

Implements ClassDefMutable.

Definition at line 5136 of file classdef.cpp.

5137{
5139}

References m_implicitTemplateInstance.

◆ setIncludeFile()

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

Implements ClassDefMutable.

Definition at line 1477 of file classdef.cpp.

1479{
1480 //printf("ClassDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,includeName,local,force);
1481 if (!m_incInfo) m_incInfo = std::make_unique<IncludeInfo>();
1482 if ((!includeName.empty() && m_incInfo->includeName.empty()) ||
1483 (fd!=nullptr && m_incInfo->fileDef==nullptr)
1484 )
1485 {
1486 //printf("Setting file info\n");
1487 m_incInfo->fileDef = fd;
1488 m_incInfo->includeName = includeName;
1490 }
1491 if (force && !includeName.empty())
1492 {
1493 m_incInfo->includeName = includeName;
1495 }
1496}
@ 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 5260 of file classdef.cpp.

5261{
5262 m_isStatic=b;
5263}

References m_isStatic.

◆ setMetaData()

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

Implements ClassDefMutable.

Definition at line 5485 of file classdef.cpp.

5486{
5487 m_metaData = md;
5488}

References m_metaData.

◆ setModuleDef()

void ClassDefImpl::setModuleDef ( ModuleDef * mod)
overridevirtual

Implements ClassDefMutable.

Definition at line 5241 of file classdef.cpp.

5242{
5243 m_moduleDef = mod;
5244}

References m_moduleDef.

◆ setPrimaryConstructorParams()

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

Implements ClassDefMutable.

Definition at line 3607 of file classdef.cpp.

3608{
3610}
ArgumentList m_primaryConstructorParams
Definition classdef.cpp:580

References m_primaryConstructorParams.

◆ setProtection()

void ClassDefImpl::setProtection ( Protection p)
overridevirtual

Implements ClassDefMutable.

Definition at line 5251 of file classdef.cpp.

5252{
5253 m_prot=p;
5254 if (getLanguage()==SrcLangExt::VHDL && VhdlDocGen::convert(p)==VhdlDocGen::ARCHITECTURECLASS)
5255 {
5256 m_className = name();
5257 }
5258}
@ 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 3602 of file classdef.cpp.

3603{
3604 m_requiresClause = req;
3605}

References m_requiresClause.

◆ setSubGrouping()

void ClassDefImpl::setSubGrouping ( bool enabled)
overridevirtual

Implements ClassDefMutable.

Definition at line 5246 of file classdef.cpp.

5247{
5248 m_subGrouping = enabled;
5249}

References m_subGrouping.

◆ setTaglessParent()

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

Implements ClassDefMutable.

Definition at line 5374 of file classdef.cpp.

5375{
5376 m_taglessParent = cd;
5377}

References m_taglessParent.

◆ setTemplateArguments()

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

Implements ClassDefMutable.

Definition at line 3549 of file classdef.cpp.

3550{
3551 m_tempArgs = al;
3552}

References m_tempArgs.

◆ setTemplateBaseClassNames()

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

Implements ClassDefMutable.

Definition at line 4479 of file classdef.cpp.

4480{
4481 m_templBaseClassNames = templateNames;
4482}

References m_templBaseClassNames.

◆ setTemplateMaster()

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

Implements ClassDefMutable.

Definition at line 5270 of file classdef.cpp.

5271{
5272 ASSERT(tm!=this);
5274}
#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 3544 of file classdef.cpp.

3545{
3546 m_typeConstraints = al;
3547}

References m_typeConstraints.

◆ setUsedOnly()

void ClassDefImpl::setUsedOnly ( bool b)
overridevirtual

Implements ClassDefMutable.

Definition at line 5286 of file classdef.cpp.

5287{
5288 m_usedOnly = b;
5289}

References m_usedOnly.

◆ showUsedFiles()

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

Definition at line 1777 of file classdef.cpp.

1778{
1779 ol.pushGeneratorState();
1781
1782
1783 ol.writeRuler();
1784 ol.pushGeneratorState();
1786 ol.startParagraph();
1788 ol.endParagraph();
1789 ol.popGeneratorState();
1793
1794 bool first=true;
1795 for (const auto &fd : m_files)
1796 {
1797 if (first)
1798 {
1799 first=false;
1800 ol.startItemList();
1801 }
1802
1803 ol.startItemListItem();
1804 DString path=fd->getPath();
1805 if (Config_getBool(FULL_PATH_NAMES))
1806 {
1807 ol.docify(stripFromPath(path));
1808 }
1809
1810 DString fname = fd->name();
1811 if (!fd->getVersion().empty()) // append version if available
1812 {
1813 fname += " (" + fd->getVersion() + ")";
1814 }
1815
1816 // for HTML
1817 ol.pushGeneratorState();
1819 if (fd->generateSourceFile())
1820 {
1821 ol.writeObjectLink(DString(),fd->getSourceFileBase(),DString(),fname);
1822 }
1823 else if (fd->isLinkable())
1824 {
1825 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),DString(),fname);
1826 }
1827 else
1828 {
1829 ol.startBold();
1830 ol.docify(fname);
1831 ol.endBold();
1832 }
1833 ol.popGeneratorState();
1834
1835 // for other output formats
1836 ol.pushGeneratorState();
1838 if (fd->isLinkable())
1839 {
1840 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),DString(),fname);
1841 }
1842 else
1843 {
1844 ol.docify(fname);
1845 }
1846 ol.popGeneratorState();
1847
1848 ol.endItemListItem();
1849 }
1850 if (!first) ol.endItemList();
1851
1852 ol.popGeneratorState();
1853}
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 5091 of file classdef.cpp.

5092{
5093 std::stable_sort(m_allMemberNameInfoLinkedMap.begin(),
5095 [](const auto &m1,const auto &m2)
5096 {
5097 return dstricmp_sort(m1->memberName(),m2->memberName())<0;
5098 });
5099}
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 4707 of file classdef.cpp.

4708{
4709 for (auto &ml : m_memberLists)
4710 {
4711 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
4712 }
4713 if (Config_getBool(SORT_BRIEF_DOCS))
4714 {
4715 std::stable_sort(m_innerClasses.begin(),
4717 [](const auto &c1,const auto &c2)
4718 {
4719 return Config_getBool(SORT_BY_SCOPE_NAME) ?
4720 dstricmp_sort(c1->name(), c2->name() )<0 :
4721 dstricmp_sort(c1->className(), c2->className())<0 ;
4722 });
4723 }
4724}
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 2266 of file classdef.cpp.

2267{
2268 //printf("%s: ClassDefImpl::startMemberDeclarations()\n",qPrint(name()));
2270}
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 2246 of file classdef.cpp.

2247{
2248 //printf("%s: ClassDefImpl::startMemberDocumentation()\n",qPrint(name()));
2249 if (Config_getBool(SEPARATE_MEMBER_PAGES))
2250 {
2253 }
2254}

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 5076 of file classdef.cpp.

5077{
5078 return m_inheritedBy;
5079}

References m_inheritedBy.

Referenced by isSubClass().

◆ subGrouping()

bool ClassDefImpl::subGrouping ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5475 of file classdef.cpp.

5476{
5477 return m_subGrouping;
5478}

References m_subGrouping.

◆ taglessParent()

const ClassDef * ClassDefImpl::taglessParent ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5369 of file classdef.cpp.

5370{
5371 return m_taglessParent;
5372}

References m_taglessParent.

◆ templateArguments()

const ArgumentList & ClassDefImpl::templateArguments ( ) const
overridevirtual

Returns the template arguments of this class.

Implements ClassDef.

Definition at line 5106 of file classdef.cpp.

5107{
5108 return m_tempArgs;
5109}

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 5126 of file classdef.cpp.

5127{
5128 return m_templateMaster;
5129}

References m_templateMaster.

◆ templateTypeConstraints()

const ConstraintClassList & ClassDefImpl::templateTypeConstraints ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5161 of file classdef.cpp.

5162{
5163 return m_constraintClassList;
5164}

References m_constraintClassList.

◆ title()

DString ClassDefImpl::title ( ) const
overridevirtual

Implements ClassDef.

Definition at line 2953 of file classdef.cpp.

2954{
2955 DString pageTitle;
2956 SrcLangExt lang = getLanguage();
2957
2958 auto getReferenceTitle = [this](std::function<DString()> translateFunc) -> DString
2959 {
2960 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
2961 };
2962
2963 if (lang==SrcLangExt::Fortran)
2964 {
2965 pageTitle = getReferenceTitle([this](){
2967 });
2968 }
2969 else if (lang==SrcLangExt::Slice)
2970 {
2971 pageTitle = getReferenceTitle([this](){
2973 });
2974 }
2975 else if (lang==SrcLangExt::VHDL)
2976 {
2977 pageTitle = getReferenceTitle([this](){
2979 });
2980 }
2981 else if (lang==SrcLangExt::CSharp && !m_primaryConstructorParams.empty())
2982 {
2983 pageTitle = getReferenceTitle([this](){
2985 m_compType,
2986 !m_tempArgs.empty());
2987 });
2988 }
2989 else if (isJavaEnum())
2990 {
2991 pageTitle = getReferenceTitle([this](){
2993 });
2994 }
2995 else if (m_compType==Service)
2996 {
2997 pageTitle = getReferenceTitle([this](){
2999 });
3000 }
3001 else if (m_compType==Singleton)
3002 {
3003 pageTitle = getReferenceTitle([this](){
3005 });
3006 }
3007 else
3008 {
3009 pageTitle = getReferenceTitle([this](){
3011 m_compType == Interface && getLanguage()==SrcLangExt::ObjC ? Class : m_compType,
3012 !m_tempArgs.empty());
3013 });
3014 }
3015 return pageTitle;
3016}
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:867

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 5465 of file classdef.cpp.

5466{
5467 return m_typeConstraints;
5468}

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 5071 of file classdef.cpp.

5072{
5073 m_inherits = bcd;
5074}

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 5081 of file classdef.cpp.

5082{
5083 m_inheritedBy = bcd;
5084}

References m_inheritedBy.

◆ usedByImplementationClasses()

const UsesClassList & ClassDefImpl::usedByImplementationClasses ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5156 of file classdef.cpp.

5157{
5158 return m_usedByImplClassList;
5159}

References m_usedByImplClassList.

◆ usedFiles()

const FileList & ClassDefImpl::usedFiles ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5460 of file classdef.cpp.

5461{
5462 return m_files;
5463}

References m_files.

◆ usedImplementationClasses()

const UsesClassList & ClassDefImpl::usedImplementationClasses ( ) const
overridevirtual

Implements ClassDef.

Definition at line 5151 of file classdef.cpp.

5152{
5153 return m_usesImplClassList;
5154}

References m_usesImplClassList.

◆ visibleInParentsDeclList()

bool ClassDefImpl::visibleInParentsDeclList ( ) const
overridevirtual

show this class in the declaration section of its parent?

Implements ClassDef.

Definition at line 2643 of file classdef.cpp.

2644{
2645 bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2646 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
2647 bool extractLocalClasses = Config_getBool(EXTRACT_LOCAL_CLASSES);
2648 bool linkable = isLinkable();
2649 return (!isAnonymous() && !isExtension() &&
2650 (protection()!=Protection::Private || extractPrivate) &&
2651 (linkable || (!hideUndocClasses && (!isLocal() || extractLocalClasses)))
2652 );
2653}
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 4880 of file classdef.cpp.

4881{
4882 //printf("**** writeAdditionalInheritedMembers()\n");
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())
4889 {
4890 ClassDefSet visited;
4891 writeInheritedMemberDeclarations(ol,visited,lmd->type,MemberListType::Invalid(),lmd->title(getLanguage()),this,true,false);
4892 }
4893 }
4894 }
4895}
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 2286 of file classdef.cpp.

2287{
2288 ol.pushGeneratorState();
2290 ol.writeString("\n");
2291 ol.startGroupHeader();
2292 ol.parseText(theTranslator->trAuthor(true,true));
2293 ol.endGroupHeader();
2295 ol.popGeneratorState();
2296}
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 1599 of file classdef.cpp.

1600{
1601 if (hasBriefDescription())
1602 {
1603 ol.startParagraph();
1604 ol.pushGeneratorState();
1606 ol.writeString(" - ");
1607 ol.popGeneratorState();
1609 briefLine(),
1610 this,
1611 nullptr,
1613 DocOptions()
1614 .setIndexWords(true)
1615 .setSingleLine(true));
1616 ol.pushGeneratorState();
1618 ol.writeString(" \n");
1620 ol.popGeneratorState();
1621
1622 if (hasDetailedDescription() || exampleFlag)
1623 {
1624 writeMoreLink(ol,anchor());
1625 }
1626
1627 ol.endParagraph();
1628 }
1629 ol.writeSynopsis();
1630}
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 2017 of file classdef.cpp.

2018{
2019 if (Config_getBool(HAVE_DOT) && m_hasCollaborationGraph /*&& Config_getBool(COLLABORATION_GRAPH)*/)
2020 {
2021 DotClassGraph usageImplGraph(this,GraphType::Collaboration);
2022 if (usageImplGraph.isTooBig())
2023 {
2024 warn_uncond("Collaboration graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
2025 name(), usageImplGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
2026 }
2027 else if (!usageImplGraph.isTrivial())
2028 {
2029 ol.pushGeneratorState();
2031 ol.startDotGraph();
2033 ol.endDotGraph(usageImplGraph);
2034 ol.popGeneratorState();
2035 }
2036 }
2037}
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 3615 of file classdef.cpp.

3617{
3618 //printf("ClassName='%s' inGroup=%d\n",qPrint(name()),inGroup);
3619
3621 ol.docify(" {");
3623 ol.endMemberDeclaration(DString(),inheritId);
3624
3625 // write user defined member groups
3626 for (const auto &mg : m_memberGroups)
3627 {
3628 mg->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
3629 }
3630
3631 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3632 {
3633 if (lde->kind()==LayoutDocEntry::MemberDecl)
3634 {
3635 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
3636 if (lmd)
3637 {
3638 writePlainMemberDeclaration(ol,lmd->type,inGroup,indentLevel,inheritedFrom,inheritId);
3639 }
3640 }
3641 }
3642}
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 2655 of file classdef.cpp.

2656{
2657 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
2658 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
2659 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2660 SrcLangExt lang = getLanguage();
2662 {
2663 if (!found) // first class
2664 {
2665 if (sliceOpt)
2666 {
2667 if (compoundType()==Interface)
2668 {
2669 ol.startMemberHeader("interfaces");
2670 }
2671 else if (compoundType()==Struct)
2672 {
2673 ol.startMemberHeader("structs");
2674 }
2675 else if (compoundType()==Exception)
2676 {
2677 ol.startMemberHeader("exceptions");
2678 }
2679 else // compoundType==Class
2680 {
2681 ol.startMemberHeader("nested-classes");
2682 }
2683 }
2684 else // non-Slice optimization: single header for class/struct/..
2685 {
2686 ol.startMemberHeader("nested-classes");
2687 }
2688 if (!header.empty())
2689 {
2690 ol.parseText(header);
2691 }
2692 else if (lang==SrcLangExt::VHDL)
2693 {
2695 }
2696 else
2697 {
2698 ol.parseText(lang==SrcLangExt::Fortran ?
2701 }
2702 ol.endMemberHeader();
2703 ol.startMemberList();
2704 found=true;
2705 }
2707 DString ctype = compoundTypeString();
2708 DString cname = displayName(!localNames);
2709 DString anc = anchor();
2710 if (anc.empty()) anc = cname; else anc.prepend(cname+"_");
2712
2713 if (lang!=SrcLangExt::VHDL) // for VHDL we swap the name and the type
2714 {
2715 if (isSliceLocal())
2716 {
2717 ol.writeString("local ");
2718 }
2719 ol.writeString(ctype);
2720 ol.writeString(" ");
2721 ol.insertMemberAlign();
2722 }
2723 if (isLinkable())
2724 {
2727 anchor(),
2728 cname
2729 );
2730 }
2731 else
2732 {
2733 ol.startBold();
2734 ol.docify(cname);
2735 ol.endBold();
2736 }
2737 if (lang==SrcLangExt::VHDL) // now write the type
2738 {
2739 ol.writeString(" ");
2740 ol.insertMemberAlign();
2742 }
2744
2745 // add the brief description if available
2746 if (!briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
2747 {
2748 auto parser { createDocParser() };
2749 auto ast { validatingParseDoc(*parser.get(),
2750 briefFile(),
2751 briefLine(),
2752 this,
2753 nullptr,
2755 DocOptions()
2756 .setSingleLine(true))
2757 };
2758 if (!ast->empty())
2759 {
2761 ol.writeDoc(ast.get(),this,nullptr);
2762 if (isLinkableInProject())
2763 {
2764 writeMoreLink(ol,anchor());
2765 }
2767 }
2768 }
2769 ol.endMemberDeclaration(anchor(),DString());
2770 }
2771}
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(), 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 1709 of file classdef.cpp.

1711{
1712 if (hasDetailedDescription() || exampleFlag)
1713 {
1714 ol.pushGeneratorState();
1716 ol.writeRuler();
1717 ol.popGeneratorState();
1718
1719 ol.pushGeneratorState();
1721 ol.writeAnchor(DString(),anchor.empty() ? DString("details") : anchor);
1722 ol.popGeneratorState();
1723
1724 if (!anchor.empty())
1725 {
1726 ol.pushGeneratorState();
1730 ol.popGeneratorState();
1731 }
1732
1733 ol.startGroupHeader("details");
1734 ol.parseText(title);
1735 ol.endGroupHeader();
1736
1738 }
1739 else
1740 {
1741 //writeTemplateSpec(ol,this,pageType);
1742 }
1743}
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 1632 of file classdef.cpp.

1633{
1634 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
1635
1636 ol.startTextBlock();
1637
1638 if (getLanguage()==SrcLangExt::Cpp)
1639 {
1640 writeTemplateSpec(ol,this,compoundTypeString(),SrcLangExt::Cpp);
1641 }
1642
1643 // repeat brief description
1644 if (!briefDescription().empty() && repeatBrief)
1645 {
1647 briefLine(),
1648 this,
1649 nullptr,
1651 DocOptions());
1652 }
1653 if (!briefDescription().empty() && repeatBrief &&
1654 !documentation().empty())
1655 {
1656 ol.pushGeneratorState();
1658 ol.writeString("\n\n");
1659 ol.popGeneratorState();
1660 }
1661 // write documentation
1662 if (!documentation().empty())
1663 {
1664 ol.generateDoc(docFile(),
1665 docLine(),
1666 this,
1667 nullptr,
1668 documentation(),
1669 DocOptions()
1670 .setIndexWords(true));
1671 }
1672 // write type constraints
1674
1675 ol.generateDoc(
1676 docFile(),docLine(),
1677 this,
1678 nullptr, // memberDef
1680 DocOptions()
1681 .setIndexWords(true));
1682
1683 // write examples
1684 if (hasExamples())
1685 {
1686 ol.startExamples();
1687 ol.startDescForItem();
1689 ol.endDescForItem();
1690 ol.endExamples();
1691 }
1692 writeSourceDef(ol);
1694 ol.endTextBlock();
1695}
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:4292
DString inlineTemplateArgListToDoc(const ArgumentList &al)
Definition util.cpp:840
void writeExamples(OutputList &ol, const ExampleList &list)
Definition util.cpp:812

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 3019 of file classdef.cpp.

3020{
3021 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3022 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3023 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3024 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3025 DString pageTitle = title();
3026
3028 if (sliceOpt)
3029 {
3030 if (compoundType()==Interface)
3031 {
3033 }
3034 else if (compoundType()==Struct)
3035 {
3037 }
3038 else if (compoundType()==Exception)
3039 {
3041 }
3042 else
3043 {
3045 }
3046 }
3047 else
3048 {
3050 }
3051
3052 AUTO_TRACE("name='{}' getOutputFileBase='{}'",name(),getOutputFileBase());
3053 bool hasAllMembersLink=false;
3054 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
3055 {
3056 if (lde->kind()==LayoutDocEntry::ClassAllMembersLink)
3057 {
3058 hasAllMembersLink = true;
3059 break;
3060 }
3061 }
3062 DString memListFile;
3063 if (hasAllMembersLink && !m_allMemberNameInfoLinkedMap.empty() && !Config_getBool(OPTIMIZE_OUTPUT_FOR_C))
3064 {
3065 memListFile = getMemberListFileName();
3066 }
3067 startFile(ol,getOutputFileBase(),false,name(),pageTitle,hli,!generateTreeView,DString(),0,memListFile);
3068 if (!generateTreeView)
3069 {
3071 {
3073 }
3074 ol.endQuickIndices();
3075 }
3076
3077 startTitle(ol,getOutputFileBase(),this);
3078 ol.parseText(pageTitle);
3080 addGroupListToTitle(ol,this);
3082 writeDocumentationContents(ol,pageTitle);
3083
3084 endFileWithNavPath(ol,this);
3085
3086 if (Config_getBool(SEPARATE_MEMBER_PAGES))
3087 {
3088 writeMemberPages(ol);
3089 }
3090}
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:398
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:452
void startTitle(OutputList &ol, const DString &fileName, const DefinitionMutable *def)
Definition index.cpp:388
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:405
HighlightedItem
Definition index.h:58
@ InterfaceVisible
Definition index.h:88
@ ExceptionVisible
Definition index.h:90
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:3930

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(), 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 2808 of file classdef.cpp.

2809{
2810 ol.startContents();
2811
2812 DString pageType = " ";
2813 pageType += compoundTypeString();
2814
2815 bool exampleFlag=hasExamples();
2816
2817 //---------------------------------------- start flexible part -------------------------------
2818
2819 SrcLangExt lang = getLanguage();
2820
2821 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2822 {
2823 switch (lde->kind())
2824 {
2825 case LayoutDocEntry::BriefDesc:
2826 writeBriefDescription(ol,exampleFlag);
2827 break;
2828 case LayoutDocEntry::Includes:
2829 if (lang==SrcLangExt::Slice)
2830 {
2832 }
2833 else
2834 {
2836 }
2837 break;
2838 case LayoutDocEntry::ClassInheritanceGraph:
2840 break;
2841 case LayoutDocEntry::ClassCollaborationGraph:
2843 break;
2844 case LayoutDocEntry::ClassAllMembersLink:
2845 //writeAllMembersLink(ol); // this is now part of the summary links
2846 break;
2847 case LayoutDocEntry::MemberDeclStart:
2849 break;
2850 case LayoutDocEntry::MemberGroups:
2852 break;
2853 case LayoutDocEntry::MemberDecl:
2854 {
2855 ClassDefSet visitedClasses;
2856 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2857 if (lmd)
2858 {
2859 writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang));
2860 }
2861 }
2862 break;
2863 case LayoutDocEntry::ClassNestedClasses:
2864 {
2865 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2866 if (ls)
2867 {
2868 writeNestedClasses(ol,ls->title(lang));
2869 }
2870 }
2871 break;
2872 case LayoutDocEntry::MemberDeclEnd:
2874 break;
2875 case LayoutDocEntry::DetailedDesc:
2876 {
2877 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
2878 if (ls)
2879 {
2880 writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang));
2881 }
2882 }
2883 break;
2884 case LayoutDocEntry::MemberDefStart:
2886 break;
2887 case LayoutDocEntry::ClassInlineClasses:
2889 break;
2890 case LayoutDocEntry::MemberDef:
2891 {
2892 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2893 if (lmd)
2894 {
2895 writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
2896 }
2897 }
2898 break;
2899 case LayoutDocEntry::MemberDefEnd:
2901 break;
2902 case LayoutDocEntry::ClassUsedFiles:
2903 showUsedFiles(ol);
2904 break;
2905 case LayoutDocEntry::AuthorSection:
2907 break;
2908 case LayoutDocEntry::NamespaceNestedNamespaces:
2909 case LayoutDocEntry::NamespaceNestedConstantGroups:
2910 case LayoutDocEntry::NamespaceClasses:
2911 case LayoutDocEntry::NamespaceConcepts:
2912 case LayoutDocEntry::NamespaceInterfaces:
2913 case LayoutDocEntry::NamespaceStructs:
2914 case LayoutDocEntry::NamespaceExceptions:
2915 case LayoutDocEntry::NamespaceInlineClasses:
2916 case LayoutDocEntry::ConceptDefinition:
2917 case LayoutDocEntry::FileClasses:
2918 case LayoutDocEntry::FileConcepts:
2919 case LayoutDocEntry::FileInterfaces:
2920 case LayoutDocEntry::FileStructs:
2921 case LayoutDocEntry::FileExceptions:
2922 case LayoutDocEntry::FileNamespaces:
2923 case LayoutDocEntry::FileConstantGroups:
2924 case LayoutDocEntry::FileIncludeGraph:
2925 case LayoutDocEntry::FileIncludedByGraph:
2926 case LayoutDocEntry::FileSourceLink:
2927 case LayoutDocEntry::FileInlineClasses:
2928 case LayoutDocEntry::GroupClasses:
2929 case LayoutDocEntry::GroupConcepts:
2930 case LayoutDocEntry::GroupModules:
2931 case LayoutDocEntry::GroupInlineClasses:
2932 case LayoutDocEntry::GroupNamespaces:
2933 case LayoutDocEntry::GroupDirs:
2934 case LayoutDocEntry::GroupNestedGroups:
2935 case LayoutDocEntry::GroupFiles:
2936 case LayoutDocEntry::GroupGraph:
2937 case LayoutDocEntry::GroupPageDocs:
2938 case LayoutDocEntry::ModuleExports:
2939 case LayoutDocEntry::ModuleClasses:
2940 case LayoutDocEntry::ModuleConcepts:
2941 case LayoutDocEntry::ModuleUsedFiles:
2942 case LayoutDocEntry::DirSubDirs:
2943 case LayoutDocEntry::DirFiles:
2944 case LayoutDocEntry::DirGraph:
2945 err("Internal inconsistency: member '{}' should not be part of LayoutDocManager::Class entry list\n",lde->entryToString());
2946 break;
2947 }
2948 }
2949
2950 ol.endContents();
2951}
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:136
DString title(SrcLangExt lang) const
Definition layout.cpp:1812
DString title(SrcLangExt lang) const
Definition layout.cpp:1793

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 3157 of file classdef.cpp.

3158{
3159 // write inner classes after the parent, so the tag files contain
3160 // the definition in proper order!
3161 for (const auto &innerCd : m_innerClasses)
3162 {
3163 if (
3164 innerCd->isLinkableInProject() && !innerCd->isImplicitTemplateInstance() &&
3165 protectionLevelVisible(innerCd->protection()) &&
3166 !innerCd->isEmbeddedInOuterScope()
3167 )
3168 {
3169 msg("Generating docs for nested compound {}...\n",innerCd->displayName());
3170 innerCd->writeDocumentation(ol);
3171 innerCd->writeMemberList(ol);
3172 }
3173 innerCd->writeDocumentationForInnerClasses(ol);
3174 }
3175}
#define msg(fmt,...)
Definition message.h:94

References m_innerClasses, msg, and protectionLevelVisible().

◆ writeIncludeFiles()

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

Definition at line 2181 of file classdef.cpp.

2182{
2183 if (m_incInfo /*&& Config_getBool(SHOW_HEADERFILE)*/)
2184 {
2185 SrcLangExt lang = getLanguage();
2186 DString nm=m_incInfo->includeName.empty() ?
2187 (m_incInfo->fileDef ?
2188 m_incInfo->fileDef->docName() : DString()
2189 ) :
2190 m_incInfo->includeName;
2191 if (!nm.empty())
2192 {
2193 ol.startParagraph();
2194 ol.startTypewriter();
2195 ol.docify(::includeStatement(lang,m_incInfo->kind));
2196 ol.docify(::includeOpen(lang,m_incInfo->kind));
2197 ol.pushGeneratorState();
2199 ol.docify(nm);
2202 if (m_incInfo->fileDef)
2203 {
2204 ol.writeObjectLink(DString(),m_incInfo->fileDef->includeName(),DString(),nm);
2205 }
2206 else
2207 {
2208 ol.docify(nm);
2209 }
2210 ol.popGeneratorState();
2211 ol.docify(::includeClose(lang,m_incInfo->kind));
2212 ol.endTypewriter();
2213 ol.endParagraph();
2214 }
2215 }
2216}
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 2040 of file classdef.cpp.

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

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 1882 of file classdef.cpp.

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

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 4922 of file classdef.cpp.

4925{
4926 int count = countMembersIncludingGrouped(lt,inheritedFrom,false);
4927 bool process = count>0;
4928 //printf("%s: writeInheritedMemberDec: lt=%s process=%d invert=%d always=%d\n",
4929 // qPrint(name()),qPrint(lt.to_string()),process,invert,showAlways);
4930 if ((process^invert) || showAlways)
4931 {
4932 for (const auto &ibcd : m_inherits)
4933 {
4934 ClassDefMutable *icd=toClassDefMutable(ibcd.classDef);
4935 if (icd && icd->isLinkable())
4936 {
4937 MemberListType lt1 = MemberListType::Invalid();
4938 MemberListType lt3 = MemberListType::Invalid();
4939 convertProtectionLevel(lt,ibcd.prot,&lt1,&lt3);
4940 if (lt2.isInvalid() && !lt3.isInvalid())
4941 {
4942 lt2=lt3;
4943 }
4944 //printf("%s:convert %s->(%s,%s) prot=%d\n",qPrint(icd->name()),qPrint(lt.to_string()),
4945 // qPrint(lt1.to_string()),qPrint(lt2.to_string()),ibcd.prot);
4946 if (visitedClasses.find(icd)==visitedClasses.end())
4947 {
4948 visitedClasses.insert(icd); // guard for multiple virtual inheritance
4949 if (!lt1.isInvalid())
4950 {
4951 //printf("--> writeMemberDeclarations for type %s\n",qPrint(lt1.to_string()));
4952 icd->writeMemberDeclarations(ol,visitedClasses,lt1,
4953 title,DString(),false,inheritedFrom,lt2,false,true);
4954 }
4955 }
4956 else
4957 {
4958 //printf("%s: class already visited!\n",qPrint(icd->name()));
4959 }
4960 }
4961 }
4962 }
4963}
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 2241 of file classdef.cpp.

2242{
2244}
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 2478 of file classdef.cpp.

2479{
2480 bool isSimple = m_isSimple;
2481
2482 ol.addIndexItem(name(),DString());
2483 //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",qPrint(name()));
2484
2485 // part 1: anchor and title
2486 DString s = compoundTypeString()+" "+name();
2487
2488 // part 1a
2489 ol.pushGeneratorState();
2491 { // only HTML only
2492 ol.writeAnchor(DString(),anchor());
2493 ol.startMemberDoc(DString(),DString(),anchor(),name(),1,1,false);
2494 ol.startMemberDocName(false);
2495 ol.parseText(s);
2496 ol.endMemberDocName();
2497 ol.endMemberDoc(false);
2498 ol.writeString("</div>");
2499 ol.startIndent();
2500 }
2501 ol.popGeneratorState();
2502
2503 // part 1b
2504 ol.pushGeneratorState();
2507 { // for LaTeX/RTF only
2509 }
2510 ol.popGeneratorState();
2511
2512 // part 1c
2513 ol.pushGeneratorState();
2515 {
2516 // for LaTeX/RTF/Man
2517 ol.startGroupHeader("",1);
2518 ol.parseText(s);
2519 ol.endGroupHeader(1);
2520 }
2521 ol.popGeneratorState();
2522
2523 SrcLangExt lang=getLanguage();
2524
2525 // part 2: the header and detailed description
2526 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2527 {
2528 switch (lde->kind())
2529 {
2530 case LayoutDocEntry::BriefDesc:
2531 {
2532 // since we already shown the brief description in the
2533 // declaration part of the container, so we use this to
2534 // show the details on top.
2536 }
2537 break;
2538 case LayoutDocEntry::ClassInheritanceGraph:
2540 break;
2541 case LayoutDocEntry::ClassCollaborationGraph:
2543 break;
2544 case LayoutDocEntry::MemberDeclStart:
2546 break;
2547 case LayoutDocEntry::MemberDecl:
2548 {
2549 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2550 if (lmd)
2551 {
2552 ClassDefSet visitedClasses;
2553 if (!isSimple) writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang),true);
2554 }
2555 }
2556 break;
2557 case LayoutDocEntry::MemberGroups:
2558 if (!isSimple) writeMemberGroups(ol,true);
2559 break;
2560 case LayoutDocEntry::MemberDeclEnd:
2562 break;
2563 case LayoutDocEntry::MemberDefStart:
2565 break;
2566 case LayoutDocEntry::MemberDef:
2567 {
2568 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
2569 if (lmd)
2570 {
2571 if (isSimple)
2572 {
2574 }
2575 else
2576 {
2577 writeMemberDocumentation(ol,lmd->type,lmd->title(lang),true);
2578 }
2579 }
2580 }
2581 break;
2582 case LayoutDocEntry::MemberDefEnd:
2584 break;
2585 default:
2586 break;
2587 }
2588 }
2589
2590 // part 3: close the block
2591 ol.pushGeneratorState();
2593 { // HTML only
2594 ol.endIndent();
2595 }
2596 ol.popGeneratorState();
2597}
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 4965 of file classdef.cpp.

4969{
4970 //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%s lt2=%s\n",qPrint(name()),qPrint(lt.to_string()),qPrint(lt2.to_string()));
4971 MemberList * ml = getMemberList(lt);
4972 MemberList * ml2 = getMemberList(lt2);
4973 if (getLanguage()==SrcLangExt::VHDL) // use specific declarations function
4974 {
4975 static const ClassDef *cdef;
4976 if (cdef!=this)
4977 { // only one inline link
4979 cdef=this;
4980 }
4981 if (ml)
4982 {
4983 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,this,nullptr,nullptr,nullptr);
4984 }
4985 }
4986 else
4987 {
4988 //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",qPrint(name()),qPrint(title),(void*)ml,(void*)ml2);
4989 DString tt = title, st = subTitle;
4990 if (ml)
4991 {
4992 //printf(" writeDeclarations ml type=%s count=%d\n",qPrint(lt.to_string()),ml->numDecMembers(inheritedFrom));
4993 ml->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,false,showInline,inheritedFrom,lt,true);
4994 tt.clear();
4995 st.clear();
4996 }
4997 if (ml2)
4998 {
4999 //printf(" writeDeclarations ml2 type=%s count=%d\n",qPrint(lt2.to_string()),ml2->numDecMembers(inheritedFrom));
5000 ml2->writeDeclarations(ol,this,nullptr,nullptr,nullptr,nullptr,tt,st,false,showInline,inheritedFrom,lt,ml==nullptr);
5001 }
5002 bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
5003 if (!inlineInheritedMembers) // show inherited members as separate lists
5004 {
5005 writeInheritedMemberDeclarations(ol,visitedClasses,lt,lt2,title,
5006 inheritedFrom ? inheritedFrom : this,
5007 invert,showAlways);
5008 }
5009 }
5010}
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 5025 of file classdef.cpp.

5026{
5027 //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",qPrint(name()));
5028 MemberList * ml = getMemberList(lt);
5029 if (ml) ml->writeDocumentation(ol,displayName(),this,title,ml->listType().toLabel(),false,showInline);
5030}
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 2218 of file classdef.cpp.

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

References m_memberGroups, and m_subGrouping.

Referenced by writeDocumentationContents(), and writeInlineDocumentation().

◆ writeMemberList()

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

Implements ClassDef.

Definition at line 3178 of file classdef.cpp.

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

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(), 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 3092 of file classdef.cpp.

3093{
3094 ///////////////////////////////////////////////////////////////////////////
3095 //// Member definitions on separate pages
3096 ///////////////////////////////////////////////////////////////////////////
3097
3098 ol.pushGeneratorState();
3100
3101 for (const auto &ml : m_memberLists)
3102 {
3103 if (ml->numDocMembers()>ml->numDocEnumValues() && ml->listType().isDetailed())
3104 {
3105 ml->writeDocumentationPage(ol,displayName(),this);
3106 }
3107 }
3108
3109 ol.popGeneratorState();
3110}

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 2599 of file classdef.cpp.

2600{
2601 // TODO: clean up this mess by moving it to
2602 // the output generators...
2603 bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
2604 bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
2605 bool usePDFLatex = Config_getBool(USE_PDFLATEX);
2606
2607 // HTML only
2608 ol.pushGeneratorState();
2610 ol.docify(" ");
2612 anchor.empty() ? DString("details") : anchor);
2614 ol.endTextLink();
2615 ol.popGeneratorState();
2616
2617 if (!anchor.empty())
2618 {
2619 ol.pushGeneratorState();
2620 // LaTeX + RTF
2624 if (!(usePDFLatex && pdfHyperlinks))
2625 {
2627 }
2628 if (!rtfHyperlinks)
2629 {
2631 }
2632 ol.docify(" ");
2635 ol.endTextLink();
2636 // RTF only
2638 ol.writeString("\\par");
2639 ol.popGeneratorState();
2640 }
2641}
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 2235 of file classdef.cpp.

2236{
2237 // nested classes
2238 m_innerClasses.writeDeclaration(ol,nullptr,title,true);
2239}
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 2368 of file classdef.cpp.

2369{
2370 ol.writePageOutline();
2371}
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 5039 of file classdef.cpp.

5042{
5043 //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",qPrint(name()));
5044 MemberList * ml = getMemberList(lt);
5045 if (ml)
5046 {
5047 ml->writePlainDeclarations(ol,inGroup,this,nullptr,nullptr,nullptr,nullptr,indentLevel,inheritedFrom,inheritId);
5048 }
5049}
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 3112 of file classdef.cpp.

3113{
3114 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
3115
3116 ol.writeString(" <div class=\"navtab\">\n");
3117 ol.writeString(" <table>\n");
3118
3119 for (auto &mni : m_allMemberNameInfoLinkedMap)
3120 {
3121 for (auto &mi : *mni)
3122 {
3123 const MemberDef *md=mi->memberDef();
3124 if (md->getClassDef()==this && md->isLinkable() && !md->isEnumValue())
3125 {
3126 if (md->isLinkableInProject())
3127 {
3128 if (md==currentMd) // selected item => highlight
3129 {
3130 ol.writeString(" <tr><td class=\"navtabHL\">");
3131 }
3132 else
3133 {
3134 ol.writeString(" <tr><td class=\"navtab\">");
3135 }
3136 ol.writeString("<span class=\"label\"><a ");
3137 ol.writeString("href=\"");
3138 if (createSubDirs) ol.writeString("../../");
3139 DString url = md->getOutputFileBase();
3141 ol.writeString(url+"#"+md->anchor());
3142 ol.writeString("\">");
3143 ol.writeString(convertToHtml(md->name()));
3144 ol.writeString("</a></span>");
3145 ol.writeString("</td></tr>\n");
3146 }
3147 }
3148 }
3149 }
3150
3151 ol.writeString(" </table>\n");
3152 ol.writeString(" </div>\n");
3153}
void createSubDirs(const Dir &d)
Definition util.cpp:2978
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3300
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3940

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 5032 of file classdef.cpp.

5033{
5034 //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",qPrint(name()));
5035 MemberList * ml = getMemberList(lt);
5036 if (ml) ml->writeSimpleDocumentation(ol,this);
5037}
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 2299 of file classdef.cpp.

2300{
2301 static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
2302 ol.pushGeneratorState();
2304 bool first=true;
2305 SrcLangExt lang = getLanguage();
2306
2307 if (lang!=SrcLangExt::VHDL)
2308 {
2309 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2310 {
2311 if (lde->kind()==LayoutDocEntry::ClassNestedClasses &&
2313 )
2314 {
2315 for (const auto &innerCd : m_innerClasses)
2316 {
2317 if (!innerCd->isAnonymous() &&
2318 !innerCd->isExtension() &&
2319 (innerCd->protection()!=Protection::Private || extractPrivate) &&
2320 innerCd->visibleInParentsDeclList()
2321 )
2322 {
2323 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection *>(lde.get());
2324 ol.writeSummaryLink(DString(),"nested-classes",ls->title(lang),first);
2325 first=false;
2326 break;
2327 }
2328 }
2329 }
2330 else if (lde->kind()==LayoutDocEntry::ClassAllMembersLink &&
2332 !Config_getBool(OPTIMIZE_OUTPUT_FOR_C)
2333 )
2334 {
2336 first=false;
2337 }
2338 else if (lde->kind()==LayoutDocEntry::MemberDecl)
2339 {
2340 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
2341 if (lmd)
2342 {
2343 MemberList * ml = getMemberList(lmd->type);
2344 if (ml && ml->declVisible())
2345 {
2346 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
2347 first=false;
2348 }
2349 }
2350 }
2351 }
2352 }
2353 else // VDHL only
2354 {
2355 for (const auto &s : m_vhdlSummaryTitles)
2356 {
2357 ol.writeSummaryLink(DString(),convertToId(s),s,first);
2358 first=false;
2359 }
2360 }
2361 if (!first)
2362 {
2363 ol.writeString(" </div>\n");
2364 }
2365 ol.popGeneratorState();
2366}
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:3211

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 2373 of file classdef.cpp.

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

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 1551 of file classdef.cpp.

1553{
1554 ArgumentLists specs;
1555 DString name;
1556 searchTemplateSpecs(d,specs,name,lang);
1557 if (!specs.empty()) // class has template scope specifiers
1558 {
1560 for (const ArgumentList &al : specs)
1561 {
1562 ol.docify("template<");
1563 auto it = al.begin();
1564 while (it!=al.end())
1565 {
1566 Argument a = *it;
1567 linkifyText(TextGeneratorOLImpl(ol), // out
1568 a.type, // text
1569 LinkifyTextOptions().setScope(d).setFileScope(getFileDef()).setSelf(this));
1570 if (!a.name.empty())
1571 {
1572 ol.docify(" ");
1573 ol.docify(a.name);
1574 }
1575 if (a.defval.length()!=0)
1576 {
1577 ol.docify(" = ");
1578 ol.docify(a.defval);
1579 }
1580 ++it;
1581 if (it!=al.end()) ol.docify(", ");
1582 }
1583 ol.docify(">");
1584 ol.lineBreak();
1585 }
1586 if (!m_requiresClause.empty())
1587 {
1588 ol.docify("requires ");
1589 linkifyText(TextGeneratorOLImpl(ol), // out
1590 m_requiresClause, // text
1591 LinkifyTextOptions().setScope(d).setFileScope(getFileDef()).setSelf(this));
1592 ol.lineBreak();
1593 }
1594 ol.docify(type.lower()+" "+name);
1596 }
1597}
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 558 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 521 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 516 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 440 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 486 of file classdef.cpp.

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

◆ m_constraintClassList

ConstraintClassList ClassDefImpl::m_constraintClassList
private

Definition at line 503 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 483 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 465 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 434 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 480 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 561 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 448 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 457 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 443 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 529 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 564 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 538 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 532 of file classdef.cpp.

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

◆ m_isTemplArg

bool ClassDefImpl::m_isTemplArg = false
private

Definition at line 540 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 437 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 535 of file classdef.cpp.

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

◆ m_metaData

DString ClassDefImpl::m_metaData
private

Definition at line 568 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 468 of file classdef.cpp.

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

◆ m_primaryConstructorParams

ArgumentList ClassDefImpl::m_primaryConstructorParams
private

Definition at line 580 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 492 of file classdef.cpp.

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

◆ m_qualifiers

StringVector ClassDefImpl::m_qualifiers
private

Definition at line 573 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 571 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 546 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 560 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 508 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 510 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 477 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 501 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 549 of file classdef.cpp.

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

◆ m_usesImplClassList

UsesClassList ClassDefImpl::m_usesImplClassList
private

Definition at line 500 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 552 of file classdef.cpp.

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


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