Doxygen
MemberGroup类 参考

A class representing a group of members. 更多...

#include <membergroup.h>

+ MemberGroup 的协作图:

Public 成员函数

 MemberGroup (const Definition *container, int id, const QCString &header, const QCString &docs, const QCString &docFile, int docLine, MemberListContainer con)
 
 ~MemberGroup ()
 
QCString header () const
 
int groupId () const
 
void insertMember (const MemberDef *md)
 
void setAnchors ()
 
void writePlainDeclarations (OutputList &ol, bool inGroup, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, 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, 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 &)
 
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
 
int countInheritableMembers (const ClassDef *inheritedFrom) const
 
void addListReferences (Definition *d)
 
void setRefItems (const RefItemVector &sli)
 
const MemberListmembers () const
 
QCString anchor () const
 
QCString docFile () const
 
int docLine () const
 

Private 属性

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

详细描述

A class representing a group of members.

在文件 membergroup.h41 行定义.

构造及析构函数说明

◆ MemberGroup()

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

在文件 membergroup.cpp32 行定义.

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 }

引用了 Config_getBool , 以及 memberList.

◆ ~MemberGroup()

MemberGroup::~MemberGroup ( )

在文件 membergroup.cpp44 行定义.

45 {
46 }

成员函数说明

◆ addGroupedInheritedMembers()

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

在文件 membergroup.cpp129 行定义.

132 {
133  //printf("** addGroupedInheritedMembers()\n");
134  for (const auto &md : *memberList)
135  {
136  //printf("matching %d == %d\n",lt,md->getSectionList()->listType());
137  const MemberList *ml = md->getSectionList(m_container);
138  if (ml && lt==ml->listType())
139  {
141  mml.push_back(md);
142  mml.countDecMembers();
143  mml.writePlainDeclarations(ol,false,cd,0,0,0,0,inheritedFrom,inheritId);
144  }
145  }
146 }

引用了 Class, MemberList::countDecMembers(), MemberList::listType(), m_container, memberList, MemberVector::push_back() , 以及 MemberList::writePlainDeclarations().

◆ addListReferences()

void MemberGroup::addListReferences ( Definition d)

在文件 membergroup.cpp269 行定义.

270 {
271  memberList->addListReferences(def);
272  if (def)
273  {
274  QCString name = def->getOutputFileBase()+"#"+anchor();
276  name,
278  name,
279  grpHeader,QCString(),def);
280  }
281 }

引用了 addRefItem(), anchor(), Definition::getOutputFileBase(), grpHeader, m_xrefListItems, memberList, theTranslator, Translator::trGroup() , 以及 TRUE.

◆ addToDeclarationSection()

void MemberGroup::addToDeclarationSection ( )

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

在文件 membergroup.cpp168 行定义.

169 {
170  if (inDeclSection)
171  {
172  //printf("Adding group %p to list %p (type=%d) memberList=%p\n",this,
173  // inDeclSection,inDeclSection->listType(),memberList);
175  }
176 }

引用了 MemberList::addMemberGroup() , 以及 inDeclSection.

◆ allMembersInSameSection()

bool MemberGroup::allMembersInSameSection ( ) const
inline

在文件 membergroup.h69 行定义.

69 { return inSameSection; }

引用了 inSameSection.

◆ anchor()

QCString MemberGroup::anchor ( ) const

在文件 membergroup.cpp258 行定义.

259 {
260  uchar md5_sig[16];
261  char sigStr[33];
262  QCString locHeader = grpHeader;
263  if (locHeader.isEmpty()) locHeader="[NOHEADER]";
264  MD5Buffer((const unsigned char *)locHeader.data(),locHeader.length(),md5_sig);
265  MD5SigToString(md5_sig,sigStr);
266  return QCString("amgrp")+sigStr;
267 }

引用了 QCString::data(), grpHeader, QCString::isEmpty() , 以及 QCString::length().

被这些函数引用 addListReferences(), MemberGroupInfoContext::Private::groupAnchor() , 以及 writeDeclarations().

◆ container()

const Definition * MemberGroup::container ( ) const

在文件 membergroup.cpp188 行定义.

189 {
190  return m_container;
191 }

引用了 m_container.

被这些函数引用 writeDocumentation() , 以及 writeDocumentationPage().

◆ countDecMembers()

void MemberGroup::countDecMembers ( )

在文件 membergroup.cpp178 行定义.

179 {
180  memberList->countDecMembers();
181 }

引用了 memberList.

◆ countDocMembers()

void MemberGroup::countDocMembers ( )

在文件 membergroup.cpp183 行定义.

184 {
185  memberList->countDocMembers();
186 }

引用了 memberList.

◆ countGroupedInheritedMembers()

int MemberGroup::countGroupedInheritedMembers ( MemberListType  lt)

在文件 membergroup.cpp148 行定义.

149 {
150  //printf("** countGroupedInheritedMembers()\n");
151  int count=0;
152  for (const auto &md : *memberList)
153  {
154  //printf("matching %d == %d\n",lt,md->getSectionList()->listType());
155  const MemberList *ml = md->getSectionList(m_container);
156  if (ml && lt==ml->listType())
157  {
158  count++;
159  }
160  }
161  return count;
162 }

引用了 MemberList::listType(), m_container , 以及 memberList.

◆ countInheritableMembers()

int MemberGroup::countInheritableMembers ( const ClassDef inheritedFrom) const

在文件 membergroup.cpp193 行定义.

194 {
195  return memberList->countInheritableMembers(inheritedFrom);
196 }

引用了 memberList.

◆ distributeMemberGroupDocumentation()

void MemberGroup::distributeMemberGroupDocumentation ( )

在文件 membergroup.cpp199 行定义.

200 {
201  //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",qPrint(grpHeader));
202  const MemberDef *md = 0;
203  for (const auto &smd : *memberList)
204  {
205  //printf("checking md=%s\n",qPrint(md->name()));
206  // find the first member of the group with documentation
207  if (!smd->documentation().isEmpty() ||
208  !smd->briefDescription().isEmpty() ||
209  !smd->inbodyDocumentation().isEmpty()
210  )
211  {
212  //printf("found it!\n");
213  md = smd;
214  break;
215  }
216  }
217  if (md) // distribute docs of md to other members of the list
218  {
219  //printf("Member %s has documentation!\n",qPrint(md->name()));
220  for (const auto &iomd : *memberList)
221  {
223  if (omd && md!=omd && omd->documentation().isEmpty() &&
224  omd->briefDescription().isEmpty() &&
226  )
227  {
228  //printf("Copying documentation to member %s\n",qPrint(omd->name()));
230  omd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
232  }
233  }
234  }
235 }

引用了 MemberDef::briefDescription(), Definition::briefFile(), Definition::briefLine(), Definition::docFile(), Definition::docLine(), MemberDef::documentation(), Definition::inbodyDocumentation(), Definition::inbodyFile(), Definition::inbodyLine(), QCString::isEmpty(), memberList, MemberDefMutable::setBriefDescription(), MemberDefMutable::setDocumentation(), MemberDefMutable::setInbodyDocumentation() , 以及 toMemberDefMutable().

◆ docFile()

QCString MemberGroup::docFile ( ) const
inline

在文件 membergroup.h88 行定义.

88 { return m_docFile; }

引用了 m_docFile.

◆ docLine()

int MemberGroup::docLine ( ) const
inline

在文件 membergroup.h89 行定义.

89 { return m_docLine; }

引用了 m_docLine.

◆ documentation()

const QCString& MemberGroup::documentation ( ) const
inline

在文件 membergroup.h68 行定义.

68 { return doc; }

引用了 doc.

被这些函数引用 MemberGroupInfoContext::Private::createDocs().

◆ findSectionsInDocumentation()

void MemberGroup::findSectionsInDocumentation ( const Definition d)

在文件 membergroup.cpp283 行定义.

284 {
286  memberList->findSectionsInDocumentation(d);
287 }

引用了 doc, docFindSections(), m_docFile , 以及 memberList.

◆ groupId()

int MemberGroup::groupId ( ) const
inline

在文件 membergroup.h49 行定义.

49 { return grpId; }

引用了 grpId.

◆ header()

QCString MemberGroup::header ( ) const
inline

在文件 membergroup.h48 行定义.

48 { return grpHeader; }

引用了 grpHeader.

被这些函数引用 MemberGroupInfoContext::Private::groupTitle() , 以及 MemberDefImpl::visibleMemberGroup().

◆ insertMember()

void MemberGroup::insertMember ( const MemberDef md)

在文件 membergroup.cpp48 行定义.

49 {
50  //printf("MemberGroup::insertMember memberList=%p count=%d"
51  // " member section list: %p: md=%p:%s\n",
52  // memberList->first() ? memberList->first()->getSectionList() : 0,
53  // memberList->count(),
54  // md->getSectionList(),
55  // md,qPrint(md->name()));
56 
57  const MemberDef *firstMd = memberList->empty() ? 0 : memberList->front();
58  if (inSameSection && firstMd &&
60  {
62  }
63  else if (inDeclSection==0)
64  {
66  //printf("inDeclSection=%p type=%d\n",inDeclSection,inDeclSection->listType());
67  }
68  memberList->push_back(md);
69 
70  // copy the group of the first member in the memberGroup
71  GroupDef *gd;
72  if (firstMd && !firstMd->isAlias() && (gd=const_cast<GroupDef*>(firstMd->getGroupDef())))
73  {
75  if (mdm)
76  {
77  mdm->setGroupDef(gd, firstMd->getGroupPri(),
78  firstMd->getGroupFileName(),
79  firstMd->getGroupStartLine(),
80  firstMd->getGroupHasDocs());
81  }
82  gd->insertMember(md);
83  }
84 }

引用了 FALSE, MemberDef::getGroupDef(), MemberDef::getGroupFileName(), MemberDef::getGroupHasDocs(), MemberDef::getGroupPri(), MemberDef::getGroupStartLine(), MemberDef::getSectionList(), inDeclSection, inSameSection, GroupDef::insertMember(), Definition::isAlias(), m_container, memberList, MemberDefMutable::setGroupDef() , 以及 toMemberDefMutable().

被这些函数引用 addMembersToMemberGroup().

◆ members()

const MemberList& MemberGroup::members ( ) const
inline

在文件 membergroup.h85 行定义.

85 { return *memberList.get(); }

引用了 memberList.

被这些函数引用 MemberGroupInfoContext::Private::createMembers().

◆ numDecEnumValues()

int MemberGroup::numDecEnumValues ( ) const

在文件 membergroup.cpp243 行定义.

244 {
245  return memberList->numDecEnumValues();
246 }

引用了 memberList.

◆ numDecMembers()

int MemberGroup::numDecMembers ( ) const

在文件 membergroup.cpp238 行定义.

239 {
240  return memberList->numDecMembers();
241 }

引用了 memberList.

◆ numDocEnumValues()

int MemberGroup::numDocEnumValues ( ) const

在文件 membergroup.cpp253 行定义.

254 {
255  return memberList->numDocEnumValues();
256 }

引用了 memberList.

◆ numDocMembers()

int MemberGroup::numDocMembers ( ) const

在文件 membergroup.cpp248 行定义.

249 {
250  return memberList->numDocMembers();
251 }

引用了 memberList.

◆ setAnchors()

void MemberGroup::setAnchors ( )

在文件 membergroup.cpp87 行定义.

88 {
89  memberList->setAnchors();
90 }

引用了 memberList.

◆ setAnonymousEnumType()

void MemberGroup::setAnonymousEnumType ( )

在文件 membergroup.cpp124 行定义.

125 {
126  memberList->setAnonymousEnumType();
127 }

引用了 memberList.

◆ setRefItems()

void MemberGroup::setRefItems ( const RefItemVector sli)

在文件 membergroup.cpp289 行定义.

290 {
291  m_xrefListItems.insert(m_xrefListItems.end(), sli.cbegin(), sli.cend());
292 }

引用了 m_xrefListItems.

◆ writeDeclarations()

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

在文件 membergroup.cpp92 行定义.

95 {
96  //printf("MemberGroup::writeDeclarations() %s\n",qPrint(grpHeader));
97  QCString ldoc = doc;
98  if (!ldoc.isEmpty()) ldoc.prepend("<a name=\""+anchor()+"\" id=\""+anchor()+"\"></a>");
99  memberList->writeDeclarations(ol,cd,nd,fd,gd,grpHeader,ldoc,FALSE,showInline);
100 }

引用了 anchor(), doc, FALSE, grpHeader, QCString::isEmpty(), memberList , 以及 QCString::prepend().

◆ writeDocumentation()

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

在文件 membergroup.cpp111 行定义.

113 {
114  //printf("MemberGroup::writeDocumentation() %s\n",qPrint(grpHeader));
115  memberList->writeDocumentation(ol,scopeName,container,QCString(),showEnumValues,showInline);
116 }

引用了 container() , 以及 memberList.

◆ writeDocumentationPage()

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

在文件 membergroup.cpp118 行定义.

120 {
121  memberList->writeDocumentationPage(ol,scopeName,container);
122 }

引用了 container() , 以及 memberList.

◆ writePlainDeclarations()

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

在文件 membergroup.cpp102 行定义.

106 {
107  //printf("MemberGroup::writePlainDeclarations() memberList->count()=%d\n",memberList->count());
108  memberList->writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,indentLevel,inheritedFrom,inheritId);
109 }

引用了 memberList.

◆ writeTagFile()

void MemberGroup::writeTagFile ( TextStream tagFile)

在文件 membergroup.cpp294 行定义.

295 {
296  memberList->writeTagFile(tagFile);
297 }

引用了 memberList.

类成员变量说明

◆ doc

QCString MemberGroup::doc
private

在文件 membergroup.h98 行定义.

被这些函数引用 documentation(), findSectionsInDocumentation() , 以及 writeDeclarations().

◆ fileName

QCString MemberGroup::fileName
private

在文件 membergroup.h97 行定义.

◆ grpHeader

QCString MemberGroup::grpHeader
private

在文件 membergroup.h96 行定义.

被这些函数引用 addListReferences(), anchor(), header() , 以及 writeDeclarations().

◆ grpId

int MemberGroup::grpId = 0
private

在文件 membergroup.h95 行定义.

被这些函数引用 groupId().

◆ inDeclSection

MemberList* MemberGroup::inDeclSection = 0
private

在文件 membergroup.h94 行定义.

被这些函数引用 addToDeclarationSection() , 以及 insertMember().

◆ inSameSection

bool MemberGroup::inSameSection = true
private

在文件 membergroup.h99 行定义.

被这些函数引用 allMembersInSameSection() , 以及 insertMember().

◆ m_container

const Definition* MemberGroup::m_container
private

在文件 membergroup.h92 行定义.

被这些函数引用 addGroupedInheritedMembers(), container(), countGroupedInheritedMembers() , 以及 insertMember().

◆ m_docFile

QCString MemberGroup::m_docFile
private

在文件 membergroup.h100 行定义.

被这些函数引用 docFile() , 以及 findSectionsInDocumentation().

◆ m_docLine

int MemberGroup::m_docLine
private

在文件 membergroup.h101 行定义.

被这些函数引用 docLine().

◆ m_xrefListItems

RefItemVector MemberGroup::m_xrefListItems
private

在文件 membergroup.h102 行定义.

被这些函数引用 addListReferences() , 以及 setRefItems().

◆ memberList


该类的文档由以下文件生成:
MemberGroup::m_container
const Definition * m_container
Definition: membergroup.h:92
MemberGroup::inDeclSection
MemberList * inDeclSection
Definition: membergroup.h:94
GroupDef::insertMember
virtual bool insertMember(const MemberDef *def, bool docOnly=FALSE)=0
MemberGroup::inSameSection
bool inSameSection
Definition: membergroup.h:99
Definition::docLine
virtual int docLine() const =0
toMemberDefMutable
MemberDefMutable * toMemberDefMutable(Definition *d)
Definition: memberdef.cpp:6125
MemberDef::briefDescription
virtual QCString briefDescription(bool abbr=FALSE) const =0
MemberDef::documentation
virtual QCString documentation() const =0
MemberDef::getGroupPri
virtual Grouping::GroupPri_t getGroupPri() const =0
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
MemberDef::getGroupFileName
virtual QCString getGroupFileName() const =0
MemberGroup::docFile
QCString docFile() const
Definition: membergroup.h:88
MemberGroup::anchor
QCString anchor() const
Definition: membergroup.cpp:258
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
MemberGroup::grpId
int grpId
Definition: membergroup.h:95
Definition::inbodyLine
virtual int inbodyLine() const =0
Definition::briefLine
virtual int briefLine() const =0
MemberDefMutable::setBriefDescription
virtual void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)=0
MemberDefMutable
Definition: memberdef.h:296
Definition::docFile
virtual QCString docFile() const =0
MemberGroup::m_docLine
int m_docLine
Definition: membergroup.h:101
GroupDef
A model of a group of symbols.
Definition: groupdef.h:49
MemberGroup::m_xrefListItems
RefItemVector m_xrefListItems
Definition: membergroup.h:102
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
uchar
unsigned char uchar
Definition: qcstring.h:38
MemberList::listType
MemberListType listType() const
Definition: memberlist.h:86
Definition::isAlias
virtual bool isAlias() const =0
MemberDef::getGroupHasDocs
virtual bool getGroupHasDocs() const =0
theTranslator
Translator * theTranslator
Definition: language.cpp:156
Definition::inbodyDocumentation
virtual QCString inbodyDocumentation() const =0
MemberGroup::grpHeader
QCString grpHeader
Definition: membergroup.h:96
Definition::inbodyFile
virtual QCString inbodyFile() const =0
MemberDefMutable::setInbodyDocumentation
virtual void setInbodyDocumentation(const QCString &d, const QCString &inbodyFile, int inbodyLine)=0
MemberDefMutable::setGroupDef
virtual void setGroupDef(const GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=0)=0
TRUE
#define TRUE
Definition: qcstring.h:36
MemberGroup::container
const Definition * container() const
Definition: membergroup.cpp:188
addRefItem
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
Definition: util.cpp:4880
Definition::briefFile
virtual QCString briefFile() const =0
MemberGroup::docLine
int docLine() const
Definition: membergroup.h:89
docFindSections
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
Definition: docparser.cpp:7681
MemberGroup::doc
QCString doc
Definition: membergroup.h:98
MemberDef::getSectionList
virtual const MemberList * getSectionList(const Definition *container) const =0
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
MemberDefMutable::setDocumentation
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
MemberGroup::memberList
std::unique_ptr< MemberList > memberList
Definition: membergroup.h:93
MemberList::addMemberGroup
void addMemberGroup(MemberGroup *mg)
Definition: memberlist.cpp:826
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
MemberDef::getGroupStartLine
virtual int getGroupStartLine() const =0
MemberGroup::m_docFile
QCString m_docFile
Definition: membergroup.h:100
MemberListContainer::Class
@ Class
MemberList
A list of MemberDef objects as shown in documentation sections.
Definition: memberlist.h:81
MemberListType_memberGroup
@ MemberListType_memberGroup
Definition: types.h:181
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
MemberDef::getGroupDef
virtual const GroupDef * getGroupDef() const =0
Translator::trGroup
virtual QCString trGroup(bool first_capital, bool singular)=0
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108