Doxygen
Loading...
Searching...
No Matches
MemberGroup Class Reference

A class representing a group of members. More...

#include <src/membergroup.h>

+ Collaboration diagram for MemberGroup:

Public Member Functions

 MemberGroup (const Definition *container, int id, const QCString &header, const QCString &docs, const QCString &docFile, int docLine, MemberListContainer con)
 
QCString header () const
 
int groupId () const
 
void insertMember (MemberDef *md)
 
void setAnchors ()
 
void writePlainDeclarations (OutputList &ol, bool inGroup, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const
 
void writeDeclarations (OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool showInline=FALSE) const
 
void writeDocumentation (OutputList &ol, const QCString &scopeName, const Definition *container, bool showEnumValues, bool showInline) const
 
void writeDocumentationPage (OutputList &ol, const QCString &scopeName, const DefinitionMutable *container) const
 
void writeTagFile (TextStream &, bool qualifiedName=false)
 
void addGroupedInheritedMembers (OutputList &ol, const ClassDef *cd, MemberListType lt, const ClassDef *inheritedFrom, const QCString &inheritId) const
 
void setAnonymousEnumType ()
 
const QCStringdocumentation () const
 
bool allMembersInSameSection () const
 
void addToDeclarationSection ()
 
void countDecMembers ()
 
void countDocMembers ()
 
int countGroupedInheritedMembers (MemberListType lt)
 
void distributeMemberGroupDocumentation ()
 
void findSectionsInDocumentation (const Definition *d)
 
int numDecMembers () const
 
int numDecEnumValues () const
 
int numDocMembers () const
 
int numDocEnumValues () const
 
const Definitioncontainer () const
 
const DefinitionmemberContainer () const
 
int countInheritableMembers (const ClassDef *inheritedFrom) const
 
void addListReferences (Definition *d)
 
void setRefItems (const RefItemVector &sli)
 
const MemberListmembers () const
 
QCString docFile () const
 
int docLine () const
 

Private Attributes

const Definitionm_container
 
std::unique_ptr< MemberListmemberList
 
MemberListinDeclSection = nullptr
 
int grpId = 0
 
QCString grpHeader
 
QCString fileName
 
QCString doc
 
bool inSameSection = true
 
QCString m_docFile
 
int m_docLine
 
RefItemVector m_xrefListItems
 

Detailed Description

A class representing a group of members.

Definition at line 42 of file membergroup.h.

Constructor & Destructor Documentation

◆ MemberGroup()

MemberGroup::MemberGroup ( const Definition * container,
int id,
const QCString & header,
const QCString & docs,
const QCString & docFile,
int docLine,
MemberListContainer con )

Definition at line 32 of file membergroup.cpp.

36 memberList(std::make_unique<MemberList>(MemberListType::MemberGroup(),con)),
38{
39 //printf("New member group id=%d header=%s desc=%s\n",id,hdr,d);
40 memberList->setNeedsSorting(Config_getBool(SORT_BRIEF_DOCS)); // detailed sections are already sorted elsewhere.
41 //printf("Member group docs='%s'\n",qPrint(doc));
42}
const Definition * container() const
QCString docFile() const
Definition membergroup.h:88
int docLine() const
Definition membergroup.h:89
QCString doc
Definition membergroup.h:98
QCString m_docFile
const Definition * m_container
Definition membergroup.h:92
std::unique_ptr< MemberList > memberList
Definition membergroup.h:93
QCString grpHeader
Definition membergroup.h:96
#define Config_getBool(name)
Definition config.h:33

References Config_getBool, container(), doc, docFile(), docLine(), grpHeader, grpId, m_container, m_docFile, m_docLine, MemberGroup(), and memberList.

Referenced by MemberGroup().

Member Function Documentation

◆ addGroupedInheritedMembers()

void MemberGroup::addGroupedInheritedMembers ( OutputList & ol,
const ClassDef * cd,
MemberListType lt,
const ClassDef * inheritedFrom,
const QCString & inheritId ) const

Definition at line 121 of file membergroup.cpp.

124{
125 //printf("** addGroupedInheritedMembers()\n");
126 for (const auto &md : *memberList)
127 {
128 //printf("matching %d == %d\n",lt,md->getSectionList()->listType());
129 const MemberList *ml = md->getSectionList(m_container);
130 if (ml && lt==ml->listType())
131 {
132 MemberList mml(lt,MemberListContainer::Class);
133 mml.push_back(md);
134 mml.countDecMembers();
135 mml.writePlainDeclarations(ol,false,cd,nullptr,nullptr,nullptr,nullptr,0,inheritedFrom,inheritId);
136 }
137 }
138}
MemberListType listType() const
Definition memberlist.h:113

References Class, MemberList::countDecMembers(), MemberList::listType(), m_container, memberList, MemberVector::push_back(), and MemberList::writePlainDeclarations().

◆ addListReferences()

void MemberGroup::addListReferences ( Definition * d)

Definition at line 267 of file membergroup.cpp.

268{
269 memberList->addListReferences(def);
270}

References memberList.

◆ addToDeclarationSection()

void MemberGroup::addToDeclarationSection ( )

Add this group as a subsection of the declaration section, instead of rendering it in its own section

Definition at line 160 of file membergroup.cpp.

161{
162 if (inDeclSection)
163 {
164 //printf("Adding group %p to list %p (type=%d) memberList=%p\n",this,
165 // inDeclSection,inDeclSection->listType(),memberList);
166 inDeclSection->addMemberGroup(this);
167 }
168}
MemberList * inDeclSection
Definition membergroup.h:94

References inDeclSection.

◆ allMembersInSameSection()

bool MemberGroup::allMembersInSameSection ( ) const
inline

Definition at line 69 of file membergroup.h.

69{ return inSameSection; }
bool inSameSection
Definition membergroup.h:99

References inSameSection.

◆ container()

const Definition * MemberGroup::container ( ) const

Definition at line 180 of file membergroup.cpp.

181{
182 return m_container;
183}

References m_container.

Referenced by MemberGroup(), writeDocumentation(), and writeDocumentationPage().

◆ countDecMembers()

void MemberGroup::countDecMembers ( )

Definition at line 170 of file membergroup.cpp.

171{
172 memberList->countDecMembers();
173}

References memberList.

◆ countDocMembers()

void MemberGroup::countDocMembers ( )

Definition at line 175 of file membergroup.cpp.

176{
177 memberList->countDocMembers();
178}

References memberList.

◆ countGroupedInheritedMembers()

int MemberGroup::countGroupedInheritedMembers ( MemberListType lt)

Definition at line 140 of file membergroup.cpp.

141{
142 //printf("** countGroupedInheritedMembers()\n");
143 int count=0;
144 for (const auto &md : *memberList)
145 {
146 //printf("matching %d == %d\n",lt,md->getSectionList()->listType());
147 const MemberList *ml = md->getSectionList(m_container);
148 if (ml && lt==ml->listType())
149 {
150 count++;
151 }
152 }
153 return count;
154}

References MemberList::listType(), m_container, and memberList.

◆ countInheritableMembers()

int MemberGroup::countInheritableMembers ( const ClassDef * inheritedFrom) const

Definition at line 202 of file membergroup.cpp.

203{
204 return memberList->countInheritableMembers(inheritedFrom);
205}

References memberList.

◆ distributeMemberGroupDocumentation()

void MemberGroup::distributeMemberGroupDocumentation ( )

Definition at line 208 of file membergroup.cpp.

209{
210 //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",qPrint(grpHeader));
211 const MemberDef *md = nullptr;
212 for (const auto &smd : *memberList)
213 {
214 //printf("checking md=%s\n",qPrint(md->name()));
215 // find the first member of the group with documentation
216 if (!smd->documentation().isEmpty() ||
217 !smd->briefDescription().isEmpty() ||
218 !smd->inbodyDocumentation().isEmpty()
219 )
220 {
221 //printf("found it!\n");
222 md = smd;
223 break;
224 }
225 }
226 if (md) // distribute docs of md to other members of the list
227 {
228 //printf("Member %s has documentation!\n",qPrint(md->name()));
229 for (const auto &iomd : *memberList)
230 {
231 MemberDefMutable *omd = toMemberDefMutable(iomd);
232 if (omd && md!=omd && omd->documentation().isEmpty() &&
233 omd->briefDescription().isEmpty() &&
235 )
236 {
237 //printf("Copying documentation to member %s\n",qPrint(omd->name()));
239 omd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
241 }
242 }
243 }
244}
virtual QCString docFile() const =0
virtual int docLine() const =0
virtual int inbodyLine() const =0
virtual int briefLine() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual QCString documentation() const =0
virtual QCString briefFile() const =0
virtual QCString inbodyDocumentation() const =0
virtual QCString inbodyFile() const =0
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
virtual void setInbodyDocumentation(const QCString &d, const QCString &docFile, int docLine)=0
virtual void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)=0
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
MemberDefMutable * toMemberDefMutable(Definition *d)

References Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), Definition::docFile(), Definition::docLine(), Definition::documentation(), Definition::inbodyDocumentation(), Definition::inbodyFile(), Definition::inbodyLine(), QCString::isEmpty(), memberList, DefinitionMutable::setBriefDescription(), DefinitionMutable::setDocumentation(), DefinitionMutable::setInbodyDocumentation(), and toMemberDefMutable().

◆ docFile()

QCString MemberGroup::docFile ( ) const
inline

Definition at line 88 of file membergroup.h.

88{ return m_docFile; }

References m_docFile.

Referenced by MemberGroup().

◆ docLine()

int MemberGroup::docLine ( ) const
inline

Definition at line 89 of file membergroup.h.

89{ return m_docLine; }

References m_docLine.

Referenced by MemberGroup().

◆ documentation()

const QCString & MemberGroup::documentation ( ) const
inline

Definition at line 68 of file membergroup.h.

68{ return doc; }

References doc.

◆ findSectionsInDocumentation()

void MemberGroup::findSectionsInDocumentation ( const Definition * d)

Definition at line 272 of file membergroup.cpp.

273{
275 memberList->findSectionsInDocumentation(d);
276}
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)

References doc, docFindSections(), m_docFile, and memberList.

◆ groupId()

int MemberGroup::groupId ( ) const
inline

Definition at line 49 of file membergroup.h.

49{ return grpId; }

References grpId.

◆ header()

QCString MemberGroup::header ( ) const
inline

Definition at line 48 of file membergroup.h.

48{ return grpHeader; }

References grpHeader.

◆ insertMember()

void MemberGroup::insertMember ( MemberDef * md)

Definition at line 44 of file membergroup.cpp.

45{
46 //printf("MemberGroup::insertMember(%s) inSameSection=%d md->getSectionList()=%s\n",qPrint(md->name()),
47 // inSameSection,qPrint(md->getSectionList(m_container)->listType().to_string()));
48
49 MemberDef *firstMd = memberList->empty() ? nullptr : memberList->front();
50 if (inSameSection && firstMd &&
52 {
53 //printf("inSameSection=FALSE\n");
55 }
56 else if (inDeclSection==nullptr)
57 {
58 inDeclSection = const_cast<MemberList*>(md->getSectionList(m_container));
59 //printf("inDeclSection=%p type=%d\n",inDeclSection,inDeclSection->listType());
60 }
61 memberList->push_back(md);
62
63 // copy the group of the first member in the memberGroup
64 GroupDef *gd = nullptr;
65 if (firstMd && !firstMd->isAlias() && (gd=firstMd->getGroupDef()))
66 {
67 MemberDefMutable *mdm = toMemberDefMutable(md);
68 if (mdm)
69 {
70 mdm->setGroupDef(gd, firstMd->getGroupPri(),
71 firstMd->getGroupFileName(),
72 firstMd->getGroupStartLine(),
73 firstMd->getGroupHasDocs());
74 }
75 gd->insertMember(md);
76 }
77}
virtual bool isAlias() const =0
virtual bool insertMember(MemberDef *def, bool docOnly=FALSE)=0
virtual bool getGroupHasDocs() const =0
virtual GroupDef * getGroupDef()=0
virtual int getGroupStartLine() const =0
virtual Grouping::GroupPri_t getGroupPri() const =0
virtual const MemberList * getSectionList(const Definition *container) const =0
virtual QCString getGroupFileName() const =0
virtual void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr)=0
#define FALSE
Definition qcstring.h:34

References FALSE, MemberDef::getGroupDef(), MemberDef::getGroupFileName(), MemberDef::getGroupHasDocs(), MemberDef::getGroupPri(), MemberDef::getGroupStartLine(), MemberDef::getSectionList(), inDeclSection, inSameSection, GroupDef::insertMember(), Definition::isAlias(), m_container, memberList, MemberDefMutable::setGroupDef(), and toMemberDefMutable().

Referenced by addMembersToMemberGroup().

◆ memberContainer()

const Definition * MemberGroup::memberContainer ( ) const

Definition at line 185 of file membergroup.cpp.

186{
187 // return the container for the first member.
188 // Note this can be different from container() in case
189 // the member is rendered as part of a file but the members
190 // are actually of a namespace.
191 const Definition *ctx = nullptr;
192 if (memberList && !memberList->empty())
193 {
194 const MemberDef *md = memberList->front();
195 ctx = md->getClassDef();
196 if (ctx==nullptr) ctx = md->getNamespaceDef();
197 if (ctx==nullptr) ctx = md->getFileDef();
198 }
199 return ctx==nullptr ? m_container : ctx;
200}
virtual const ClassDef * getClassDef() const =0
virtual const FileDef * getFileDef() const =0
virtual const NamespaceDef * getNamespaceDef() const =0

References MemberDef::getClassDef(), MemberDef::getFileDef(), MemberDef::getNamespaceDef(), m_container, and memberList.

◆ members()

const MemberList & MemberGroup::members ( ) const
inline

Definition at line 86 of file membergroup.h.

86{ return *memberList.get(); }

References memberList.

◆ numDecEnumValues()

int MemberGroup::numDecEnumValues ( ) const

Definition at line 252 of file membergroup.cpp.

253{
254 return memberList->numDecEnumValues();
255}

References memberList.

◆ numDecMembers()

int MemberGroup::numDecMembers ( ) const

Definition at line 247 of file membergroup.cpp.

248{
249 return memberList->numDecMembers();
250}

References memberList.

◆ numDocEnumValues()

int MemberGroup::numDocEnumValues ( ) const

Definition at line 262 of file membergroup.cpp.

263{
264 return memberList->numDocEnumValues();
265}

References memberList.

◆ numDocMembers()

int MemberGroup::numDocMembers ( ) const

Definition at line 257 of file membergroup.cpp.

258{
259 return memberList->numDocMembers();
260}

References memberList.

◆ setAnchors()

void MemberGroup::setAnchors ( )

Definition at line 80 of file membergroup.cpp.

81{
82 memberList->setAnchors();
83}

References memberList.

◆ setAnonymousEnumType()

void MemberGroup::setAnonymousEnumType ( )

Definition at line 116 of file membergroup.cpp.

117{
118 memberList->setAnonymousEnumType();
119}

References memberList.

◆ setRefItems()

void MemberGroup::setRefItems ( const RefItemVector & sli)

Definition at line 278 of file membergroup.cpp.

279{
280 m_xrefListItems.insert(m_xrefListItems.end(), sli.cbegin(), sli.cend());
281}
RefItemVector m_xrefListItems

References m_xrefListItems.

◆ writeDeclarations()

void MemberGroup::writeDeclarations ( OutputList & ol,
const ClassDef * cd,
const NamespaceDef * nd,
const FileDef * fd,
const GroupDef * gd,
const ModuleDef * mod,
bool showInline = FALSE ) const

Definition at line 85 of file membergroup.cpp.

88{
89 //printf("MemberGroup::writeDeclarations() %s\n",qPrint(grpHeader));
90 QCString ldoc = doc;
91 memberList->writeDeclarations(ol,cd,nd,fd,gd,mod,grpHeader,ldoc,FALSE,showInline);
92}

References doc, FALSE, grpHeader, and memberList.

◆ writeDocumentation()

void MemberGroup::writeDocumentation ( OutputList & ol,
const QCString & scopeName,
const Definition * container,
bool showEnumValues,
bool showInline ) const

Definition at line 103 of file membergroup.cpp.

105{
106 //printf("MemberGroup::writeDocumentation() %s\n",qPrint(grpHeader));
107 memberList->writeDocumentation(ol,scopeName,container,QCString(),showEnumValues,showInline);
108}

References container(), and memberList.

◆ writeDocumentationPage()

void MemberGroup::writeDocumentationPage ( OutputList & ol,
const QCString & scopeName,
const DefinitionMutable * container ) const

Definition at line 110 of file membergroup.cpp.

112{
113 memberList->writeDocumentationPage(ol,scopeName,container);
114}

References container(), and memberList.

◆ writePlainDeclarations()

void MemberGroup::writePlainDeclarations ( OutputList & ol,
bool inGroup,
const ClassDef * cd,
const NamespaceDef * nd,
const FileDef * fd,
const GroupDef * gd,
const ModuleDef * mod,
int indentLevel,
const ClassDef * inheritedFrom,
const QCString & inheritId ) const

Definition at line 94 of file membergroup.cpp.

98{
99 //printf("MemberGroup::writePlainDeclarations() memberList->count()=%d\n",memberList->count());
100 memberList->writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,indentLevel,inheritedFrom,inheritId);
101}

References memberList.

◆ writeTagFile()

void MemberGroup::writeTagFile ( TextStream & tagFile,
bool qualifiedName = false )

Definition at line 283 of file membergroup.cpp.

284{
285 memberList->writeTagFile(tagFile,qualifiedName);
286}

References memberList.

Member Data Documentation

◆ doc

QCString MemberGroup::doc
private

◆ fileName

QCString MemberGroup::fileName
private

Definition at line 97 of file membergroup.h.

◆ grpHeader

QCString MemberGroup::grpHeader
private

Definition at line 96 of file membergroup.h.

Referenced by header(), MemberGroup(), and writeDeclarations().

◆ grpId

int MemberGroup::grpId = 0
private

Definition at line 95 of file membergroup.h.

Referenced by groupId(), and MemberGroup().

◆ inDeclSection

MemberList* MemberGroup::inDeclSection = nullptr
private

Definition at line 94 of file membergroup.h.

Referenced by addToDeclarationSection(), and insertMember().

◆ inSameSection

bool MemberGroup::inSameSection = true
private

Definition at line 99 of file membergroup.h.

Referenced by allMembersInSameSection(), and insertMember().

◆ m_container

const Definition* MemberGroup::m_container
private

◆ m_docFile

QCString MemberGroup::m_docFile
private

Definition at line 100 of file membergroup.h.

Referenced by docFile(), findSectionsInDocumentation(), and MemberGroup().

◆ m_docLine

int MemberGroup::m_docLine
private

Definition at line 101 of file membergroup.h.

Referenced by docLine(), and MemberGroup().

◆ m_xrefListItems

RefItemVector MemberGroup::m_xrefListItems
private

Definition at line 102 of file membergroup.h.

Referenced by setRefItems().

◆ memberList


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