Skip to main content

The MemberList Class Reference

A list of MemberDef objects as shown in documentation sections. More...

Declaration

class MemberList { ... }

Included Headers

#include <src/memberlist.h>

Base class

classMemberVector

A vector of MemberDef object. More...

Public Constructors Index

MemberList (MemberListType lt, MemberListContainer container)

Public Destructor Index

~MemberList ()

Public Member Functions Index

MemberListTypelistType () const
MemberListContainercontainer () const
intnumDecMembers (const ClassDef *inheritedFrom) const
intnumDecMembers () const
intnumDecEnumValues () const
intnumDocMembers () const
intnumDocEnumValues () const
boolneedsSorting () const
voidcountDecMembers () const
std::pair< int, int >countDecMembers (const ClassDef *inheritedFrom) const
voidcountDocMembers ()
intcountInheritableMembers (const ClassDef *inheritedFrom) const
voidwritePlainDeclarations (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
voidwriteDeclarations (OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const QCString &title, const QCString &subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt=MemberListType::PubMethods(), bool showSectionTitle=true) const

Writes the list of members to the output. More...

voidwriteDocumentation (OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, const QCString &anchor, bool showEnumValues=FALSE, bool showInline=FALSE) const
voidwriteSimpleDocumentation (OutputList &ol, const Definition *container) const
voidwriteDocumentationPage (OutputList &ol, const QCString &scopeName, const DefinitionMutable *container, int hierarchyLevel=0) const
voidwriteTagFile (TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
booldeclVisible () const
voidaddMemberGroup (MemberGroup *mg)
voidaddListReferences (Definition *def)
voidfindSectionsInDocumentation (const Definition *d)
voidsetNeedsSorting (bool b)
const MemberGroupRefList &getMemberGroupList () const
voidsetAnonymousEnumType ()
voidsetAnchors ()

Private Member Functions Index

intcountEnumValues (const MemberDef *md) const

Private Member Attributes Index

intm_numDecMembers
intm_numDecEnumValues
intm_numDocMembers
intm_numDocEnumValues
MemberGroupRefListm_memberGroupRefList
MemberListContainerm_container
MemberListTypem_listType
boolm_needsSorting

Description

A list of MemberDef objects as shown in documentation sections.

Definition at line 108 of file memberlist.h.

Public Constructors

MemberList()

MemberList::MemberList (MemberListType lt, MemberListContainer container)

Declaration at line 111 of file memberlist.h, definition at line 34 of file memberlist.cpp.

35{
36 //printf("%p: MemberList::MemberList(%d)\n",this,lt);
37 m_numDecMembers=-1; // special value indicating that value needs to be computed
39 m_numDocMembers=-1; // special value indicating that value needs to be computed
42}

References FALSE, m_container, m_listType, m_needsSorting, m_numDecEnumValues, m_numDecMembers, m_numDocEnumValues and m_numDocMembers.

Public Destructor

~MemberList()

MemberList::~MemberList ()

Declaration at line 112 of file memberlist.h, definition at line 44 of file memberlist.cpp.

Public Member Functions

addListReferences()

void MemberList::addListReferences (Definition * def)

Declaration at line 146 of file memberlist.h, definition at line 794 of file memberlist.cpp.

795{
796 for (const auto &imd : m_members)
797 {
799 if (md && !md->isAlias() && (md->getGroupDef()==nullptr || def->definitionType()==Definition::TypeGroup))
800 {
801 md->addListReference(def);
802 const MemberVector &enumFields = md->enumFieldList();
803 if (md->memberType()==MemberType::Enumeration && !enumFields.empty())
804 {
805 //printf(" Adding enum values!\n");
806 for (const auto &vmd : enumFields)
807 {
809 if (vmdm)
810 {
811 //printf(" adding %s\n",qPrint(vmd->name()));
812 vmdm->addListReference(def);
813 }
814 }
815 }
816 }
817 }
818 for (const auto &mg : m_memberGroupRefList)
819 {
820 mg->addListReferences(def);
821 }
822}

References MemberDefMutable::addListReference, Definition::definitionType, MemberVector::empty, Enumeration, MemberDef::enumFieldList, MemberDef::getGroupDef, Definition::isAlias, m_memberGroupRefList, MemberVector::m_members, MemberDef::memberType, toMemberDefMutable and Definition::TypeGroup.

addMemberGroup()

void MemberList::addMemberGroup (MemberGroup * mg)

Declaration at line 145 of file memberlist.h, definition at line 789 of file memberlist.cpp.

790{
791 m_memberGroupRefList.push_back(mg);
792}

Reference m_memberGroupRefList.

container()

MemberListContainer MemberList::container ()
inline

countDecMembers()

void MemberList::countDecMembers ()

Declaration at line 125 of file memberlist.h, definition at line 184 of file memberlist.cpp.

185{
186 if (m_numDecMembers!=-1) return; // already cached
187 std::tie(m_numDecMembers, m_numDecEnumValues) = countDecMembers(nullptr); // cache new values
188}

References countDecMembers, m_numDecEnumValues and m_numDecMembers.

Referenced by MemberGroup::addGroupedInheritedMembers, countDecMembers and numDecMembers.

countDecMembers()

std::pair< int, int > MemberList::countDecMembers (const ClassDef * inheritedFrom)

Count the number of members in this list that are visible in the declaration part of a compound's documentation page.

Declaration at line 126 of file memberlist.h, definition at line 122 of file memberlist.cpp.

122std::pair<int,int> MemberList::countDecMembers(const ClassDef *inheritedFrom) const
123{
124 //printf("----- countDecMembers count=%d ----\n",count());
125 int numDecMembers=0;
126 int numDecEnumValues=0;
127 for (const auto &md : m_members)
128 {
129 //printf("MemberList::countDecMembers(md=%s,%d)\n",qPrint(md->name()),md->isBriefSectionVisible());
130 if ((inheritedFrom==nullptr || !md->isReimplementedBy(inheritedFrom)) &&
131 md->isBriefSectionVisible())
132 {
133 switch(md->memberType())
134 {
135 case MemberType::Variable: // fall through
136 case MemberType::Event: // fall through
138 break;
139// apparently necessary to get this to show up in declarations section?
140 case MemberType::Interface: // fall through
141 case MemberType::Service: // fall through
142 case MemberType::Function: // fall through
143 case MemberType::Signal: // fall through
144 case MemberType::DCOP: // fall through
145 case MemberType::Slot: if (!md->isRelated() || md->getClassDef())
147 break;
150 break;
153 break;
155 break;
157 break;
159 break;
160 case MemberType::Define: if (Config_getBool(EXTRACT_ALL) ||
161 !md->argsString().isEmpty() ||
162 !md->initializer().isEmpty() ||
163 md->hasDocumentation()
164 ) numDecMembers++;
165 break;
167 break;
168 default:
169 err("Unknown member type found for member '{}'!\n",md->name());
170 }
171 }
172 }
173 for (const auto &mg : m_memberGroupRefList)
174 {
175 mg->countDecMembers();
176 numDecMembers+=mg->numDecMembers();
177 numDecEnumValues+=mg->numDecEnumValues();
178 }
179 //printf("----- end countDecMembers ----\n");
180
181 return std::make_pair(numDecMembers,numDecEnumValues);
182}

References Config_getBool, DCOP, Define, Dictionary, Enumeration, EnumValue, err, Event, Friend, Function, Interface, m_memberGroupRefList, MemberVector::m_members, numDecEnumValues, numDecMembers, Property, Sequence, Service, Signal, Slot, Typedef and Variable.

countDocMembers()

void MemberList::countDocMembers ()

Declaration at line 127 of file memberlist.h, definition at line 190 of file memberlist.cpp.

191{
192 if (m_numDocMembers!=-1) return; // used cached value
194 for (const auto &md : m_members)
195 {
196 if (md->isDetailedSectionVisible(m_container) && !md->isAlias())
197 {
198 // do not count enum values, since they do not produce entries of their own
199 if (md->memberType()==MemberType::EnumValue)
200 {
202 }
204 }
205 }
206 for (const auto &mg : m_memberGroupRefList)
207 {
208 mg->countDocMembers();
209 m_numDocMembers+=mg->numDocMembers();
210 m_numDocEnumValues+=mg->numDocEnumValues();
211 }
212 //printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
213}

References EnumValue, m_container, m_memberGroupRefList, MemberVector::m_members, m_numDocEnumValues and m_numDocMembers.

countInheritableMembers()

int MemberList::countInheritableMembers (const ClassDef * inheritedFrom)

Declaration at line 128 of file memberlist.h, definition at line 85 of file memberlist.cpp.

85int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const
86{
87 int count=0;
88 for (const auto &md : m_members)
89 {
90 if (md->isBriefSectionVisible())
91 {
92 if (md->memberType()!=MemberType::Friend &&
93 md->memberType()!=MemberType::EnumValue)
94 {
95 //printf("member %s: isReimplementedBy(%s)=%d\n",qPrint(md->name()),
96 // qPrint(inheritedFrom->name()),
97 // md->isReimplementedBy(inheritedFrom));
98 if (md->memberType()==MemberType::Function)
99 {
100 if (!md->isReimplementedBy(inheritedFrom)) count++;
101 }
102 else
103 {
104 count++;
105 }
106 }
107 }
108 }
109 for (const auto &mg : m_memberGroupRefList)
110 {
111 count+=mg->countInheritableMembers(inheritedFrom);
112 }
113 //printf("%s::countInheritableMembers(%s)=%d\n",
114 // qPrint(m_listType.toLabel()),
115 // qPrint(inheritedFrom->name()),count);
116 return count;
117}

References EnumValue, Friend, Function, m_memberGroupRefList and MemberVector::m_members.

Referenced by ClassDefImpl::countMembersIncludingGrouped.

declVisible()

bool MemberList::declVisible ()

Declaration at line 144 of file memberlist.h, definition at line 268 of file memberlist.cpp.

269{
270 for (const auto &md : m_members)
271 {
272 if (md->isBriefSectionVisible())
273 {
274 switch (md->memberType())
275 {
276 case MemberType::Define: // fall through
277 case MemberType::Typedef: // fall through
278 case MemberType::Variable: // fall through
279 case MemberType::Function: // fall through
280 case MemberType::Signal: // fall through
281 case MemberType::Slot: // fall through
282 case MemberType::DCOP: // fall through
283 case MemberType::Property: // fall through
284 case MemberType::Interface: // fall through
285 case MemberType::Service: // fall through
286 case MemberType::Sequence: // fall through
287 case MemberType::Dictionary: // fall through
289 return TRUE;
291 {
292 // if this is an anonymous enum and there are variables of this
293 // enum type (i.e. enumVars>0), then we do not show the enum here.
294 if (countEnumValues(md)==0) // show enum here
295 {
296 return TRUE;
297 }
298 }
299 break;
301 return TRUE;
303 {
305 {
306 return TRUE;
307 }
308 }
309 break;
310 }
311 }
312 }
313 return FALSE;
314}

References countEnumValues, DCOP, Define, Dictionary, Enumeration, EnumValue, Event, FALSE, Friend, Function, Group, Interface, m_container, MemberVector::m_members, Property, Sequence, Service, Signal, Slot, TRUE, Typedef and Variable.

Referenced by ClassDefImpl::writeSummaryLinks, FileDefImpl::writeSummaryLinks, GroupDefImpl::writeSummaryLinks, ModuleDefImpl::writeSummaryLinks and NamespaceDefImpl::writeSummaryLinks.

findSectionsInDocumentation()

void MemberList::findSectionsInDocumentation (const Definition * d)

Declaration at line 147 of file memberlist.h, definition at line 824 of file memberlist.cpp.

825{
826 for (const auto &imd : m_members)
827 {
829 if (md)
830 {
832 }
833 }
834 for (const auto &mg : m_memberGroupRefList)
835 {
836 mg->findSectionsInDocumentation(d);
837 }
838}

References MemberDefMutable::findSectionsInDocumentation, m_memberGroupRefList, MemberVector::m_members and toMemberDefMutable.

getMemberGroupList()

const MemberGroupRefList & MemberList::getMemberGroupList ()
inline

Definition at line 149 of file memberlist.h.

Reference m_memberGroupRefList.

Referenced by membersHaveSpecificType and VhdlDocGen::writeVHDLDeclarations.

listType()

needsSorting()

bool MemberList::needsSorting ()
inline

Definition at line 124 of file memberlist.h.

124 bool needsSorting() const { return m_needsSorting; }

Reference m_needsSorting.

Referenced by FileDefImpl::sortMemberLists.

numDecEnumValues()

int MemberList::numDecEnumValues ()
inline

Definition at line 121 of file memberlist.h.

121 int numDecEnumValues() const { return m_numDecEnumValues; }

Reference m_numDecEnumValues.

Referenced by countDecMembers, writeDeclarations and writePlainDeclarations.

numDecMembers()

int MemberList::numDecMembers (const ClassDef * inheritedFrom)
inline

Definition at line 117 of file memberlist.h.

117 int numDecMembers(const ClassDef *inheritedFrom) const
118 { return countDecMembers(inheritedFrom).first; }

Reference countDecMembers.

Referenced by countDecMembers, ClassDefImpl::countMemberDeclarations and FileDefImpl::numDecMembers.

numDecMembers()

int MemberList::numDecMembers ()
inline

Definition at line 119 of file memberlist.h.

119 int numDecMembers() const
120 { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; }

References ASSERT and m_numDecMembers.

Referenced by writeDeclarations and writePlainDeclarations.

numDocEnumValues()

int MemberList::numDocEnumValues ()
inline

Definition at line 123 of file memberlist.h.

123 int numDocEnumValues() const { return m_numDocEnumValues; }

Reference m_numDocEnumValues.

Referenced by writeDocumentation and writeSimpleDocumentation.

numDocMembers()

int MemberList::numDocMembers ()
inline

setAnchors()

void MemberList::setAnchors ()

Declaration at line 151 of file memberlist.h, definition at line 880 of file memberlist.cpp.

881{
882 //int count=0;
883 for (const auto &md : m_members)
884 {
886 if (mdm && !md->isReference())
887 {
888 mdm->setAnchor();
889 }
890 }
891}

References Definition::isReference, MemberVector::m_members, MemberDefMutable::setAnchor and toMemberDefMutable.

Referenced by FileDefImpl::computeAnchors and NamespaceDefImpl::computeAnchors.

setAnonymousEnumType()

void MemberList::setAnonymousEnumType ()

Declaration at line 150 of file memberlist.h, definition at line 215 of file memberlist.cpp.

216{
217 //printf("MemberList(%p)::setAnonymousEnumType()\n",this);
218 for (const auto &md : m_members)
219 {
220 if (md->isBriefSectionVisible())
221 {
222 QCString name(md->name());
223 int i=name.findRev("::");
224 if (i!=-1) name=name.right(name.length()-i-2);
225 if (md->memberType()==MemberType::Enumeration && name[0]=='@')
226 {
227 for (const auto &vmd : md->enumFieldList())
228 {
230 if (vmdm)
231 {
232 QCString vtype=vmd->typeString();
233 if ((vtype.find(name))!=-1)
234 {
235 vmdm->setAnonymousEnumType(md);
236 }
237 }
238 }
239 }
240 }
241 }
242 for (const auto &mg : m_memberGroupRefList)
243 {
244 mg->setAnonymousEnumType();
245 }
246}

References Enumeration, QCString::find, QCString::findRev, QCString::length, m_memberGroupRefList, MemberVector::m_members, QCString::right, MemberDefMutable::setAnonymousEnumType and toMemberDefMutable.

Referenced by ClassDefImpl::setAnonymousEnumType.

setNeedsSorting()

void MemberList::setNeedsSorting (bool b)

Declaration at line 148 of file memberlist.h, definition at line 840 of file memberlist.cpp.

841{
843}

Reference m_needsSorting.

Referenced by FileDefImpl::sortMemberLists.

writeDeclarations()

void MemberList::writeDeclarations (OutputList & ol, const ClassDef * cd, const NamespaceDef * nd, const FileDef * fd, const GroupDef * gd, const ModuleDef * mod, const QCString & title, const QCString & subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, const ClassDef * inheritedFrom=nullptr, MemberListType lt=MemberListType::PubMethods(), bool showSectionTitle=true)

Writes the list of members to the output.

Parameters
ol

Output list to write to

cd

non-null if this list is part of class documentation.

nd

non-null if this list is part of namespace documentation.

fd

non-null if this list is part of file documentation.

gd

non-null if this list is part of group documentation.

mod

non-null if this list is part of module documentation.

title

Title to use for the member list.

subtitle

Sub title to use for the member list.

showEnumValues

Obsolete, always set to FALSE.

showInline

if set to TRUE if title is rendered differently

inheritedFrom

if not 0, the list is shown inside the given class as inherited members, parameter cd points to the class containing the members.

lt

Type of list that is inherited from.

showSectionTitle

do we show the "additional members" header or not? When combining public and protected inherited members under a single header only for the first list it should be shown

Declaration at line 132 of file memberlist.h, definition at line 493 of file memberlist.cpp.

494 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
495 const QCString &title,const QCString &subtitle, bool showEnumValues,
496 bool showInline,const ClassDef *inheritedFrom,MemberListType lt,bool showSectionTitle) const
497{
498 (void)showEnumValues; // unused
499
500 //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
501 bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
502 QCString inheritId;
503
504 const Definition *ctx = cd;
505 if (ctx==nullptr && nd) ctx = nd;
506 if (ctx==nullptr && gd) ctx = gd;
507 if (ctx==nullptr && mod) ctx = mod;
508 if (ctx==nullptr && fd) ctx = fd;
509
510 //printf("%p: MemberList::writeDeclaration(title='%s',subtitle='%s')=%d inheritedFrom=%p\n",
511 // (void*)this,qPrint(title),qPrint(subtitle),numDecMembers(),(void*)inheritedFrom);
512
513 int num = numDecMembers(inheritedFrom);
514 int numEnumValues = numDecEnumValues();
515 if (inheritedFrom && num>0)
516 {
517 if (cd && !optimizeVhdl)
518 {
519 inheritId = substitute(lt.toLabel(),"-","_")+"_"+
521 if (showSectionTitle && !title.isEmpty())
522 {
525 cd->anchor(),title,cd->displayName());
526 }
527 }
528 }
529 else if (num>numEnumValues)
530 {
531 if (!title.isEmpty())
532 {
533 if (showInline)
534 {
536 }
537 else
538 {
539 ol.startMemberHeader(m_listType.toLabel());
540 }
541 ol.parseText(title);
542 if (showInline)
543 {
544 ol.endInlineHeader();
545 }
546 else
547 {
548 ol.endMemberHeader();
549 }
550 }
551 if (!subtitle.stripWhiteSpace().isEmpty())
552 {
554 ol.generateDoc("[generated]",-1,ctx,nullptr,subtitle,FALSE,FALSE,
557 }
558 }
559 if (num>numEnumValues)
560 {
562 // TODO: Two things need to be worked out for proper VHDL output:
563 // 1 Signals and types under the group need to be
564 // formatted to associate them with the group somehow
565 // indentation, or at the very least, extra space after
566 // the group is done
567 // 2 This might need to be repeated below for memberGroupLists
568 if (optimizeVhdl) // use specific declarations function
569 {
570 VhdlDocGen::writeVhdlDeclarations(this,ol,nullptr,cd,nullptr,nullptr,nullptr);
571 }
572 else
573 {
574 writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
575 }
576
577 //printf("memberGroupList=%p\n",memberGroupList);
578 int groupId=0;
579 for (const auto &mg : m_memberGroupRefList)
580 {
581 bool hasHeader=!mg->header().isEmpty();
582 if (inheritId.isEmpty())
583 {
584 QCString groupAnchor = QCString(listType().toLabel())+"-"+QCString().setNum(groupId++);
585 //printf("mg->header=%s hasHeader=%d\n",qPrint(mg->header()),hasHeader);
586 ol.startMemberGroupHeader(groupAnchor,hasHeader);
587 if (hasHeader)
588 {
589 ol.parseText(mg->header());
590 }
592 if (!mg->documentation().isEmpty())
593 {
594 //printf("Member group has docs!\n");
596 ol.generateDoc(mg->docFile(),mg->docLine(),mg->memberContainer(),nullptr,mg->documentation()+"\n",FALSE,FALSE,
599 }
601 }
602 //printf("--- mg->writePlainDeclarations ---\n");
603 mg->writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
604 if (inheritId.isEmpty())
605 {
606 ol.endMemberGroup(hasHeader);
607 }
608 }
609 }
610 if (inheritedFrom && cd)
611 {
612 // also add members that of this list type, that are grouped together
613 // in a separate list in class 'inheritedFrom'
614 cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId);
615 }
616 //printf("----- end writeDeclaration() ----\n");
617}

References ClassDef::addGroupedInheritedMembers, Definition::anchor, Config_getBool, Definition::displayName, OutputList::endInlineHeader, OutputList::endMemberGroup, OutputList::endMemberGroupDocs, OutputList::endMemberGroupHeader, OutputList::endMemberHeader, OutputList::endMemberSubtitle, FALSE, OutputList::generateDoc, Definition::getOutputFileBase, Definition::getReference, Group, QCString::isEmpty, listType, m_container, m_listType, m_memberGroupRefList, numDecEnumValues, numDecMembers, OutputList::parseText, QCString::setNum, OutputList::startInlineHeader, OutputList::startMemberGroup, OutputList::startMemberGroupDocs, OutputList::startMemberGroupHeader, OutputList::startMemberHeader, OutputList::startMemberSubtitle, stripPath, QCString::stripWhiteSpace, substitute, MemberListType::toLabel, OutputList::writeInheritedSectionTitle, writePlainDeclarations and VhdlDocGen::writeVhdlDeclarations.

Referenced by ClassDefImpl::writeMemberDeclarations, FileDefImpl::writeMemberDeclarations, GroupDefImpl::writeMemberDeclarations, ModuleDefImpl::writeMemberDeclarations and NamespaceDefImpl::writeMemberDeclarations.

writeDocumentation()

void MemberList::writeDocumentation (OutputList & ol, const QCString & scopeName, const Definition * container, const QCString & title, const QCString & anchor, bool showEnumValues=FALSE, bool showInline=FALSE)

Declaration at line 137 of file memberlist.h, definition at line 619 of file memberlist.cpp.

620 const QCString &scopeName, const Definition *container,
621 const QCString &title,const QCString &anchor,
622 bool showEnumValues,bool showInline) const
623{
624 if (numDocMembers()==-1)
625 {
626 err("MemberList::numDocMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n");
627 abort();
628 }
629
630 if (numDocMembers()==0) return;
631 if (!showEnumValues && numDocMembers()<=numDocEnumValues()) return;
632
633 if (!title.isEmpty())
634 {
637 ol.writeRuler();
639 if (container) ol.writeAnchor(container->getOutputFileBase(),anchor);
640 ol.startGroupHeader(anchor,showInline ? 2 : 0);
641 ol.parseText(title);
642 ol.endGroupHeader(showInline ? 2 : 0);
643 }
645
646 struct OverloadInfo
647 {
648 uint32_t count = 1;
649 uint32_t total = 0;
650 };
651 std::unordered_map<std::string,OverloadInfo> overloadInfo;
652 // count the number of overloaded members
653 for (const auto &md : m_members)
654 {
655 if (md->isDetailedSectionVisible(m_container) &&
656 !(md->isEnumValue() && !showInline))
657 {
658 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
659 it->second.total++;
660 }
661 }
662
663 for (const auto &md : m_members)
664 {
665 if (md->isDetailedSectionVisible(m_container) &&
666 !(md->isEnumValue() && !showInline))
667 {
668 auto it = overloadInfo.find(md->name().str());
669 uint32_t overloadCount = it->second.total;
670 uint32_t &count = it->second.count;
672 if (mdm)
673 {
674 mdm->writeDocumentation(this,count++,overloadCount,ol,scopeName,container,
675 m_container==MemberListContainer::Group,showEnumValues,showInline);
676 }
677 }
678 }
679 //printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
680 for (const auto &mg : m_memberGroupRefList)
681 {
682 mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
683 }
685}

References container, OutputList::disable, OutputList::endGroupHeader, OutputList::endMemberDocList, err, Group, Html, QCString::isEmpty, m_container, m_memberGroupRefList, MemberVector::m_members, numDocEnumValues, numDocMembers, OutputList::parseText, OutputList::popGeneratorState, OutputList::pushGeneratorState, OutputList::startGroupHeader, OutputList::startMemberDocList, toMemberDefMutable, OutputList::writeAnchor, MemberDefMutable::writeDocumentation and OutputList::writeRuler.

Referenced by ClassDefImpl::writeMemberDocumentation, FileDefImpl::writeMemberDocumentation, GroupDefImpl::writeMemberDocumentation, ModuleDefImpl::writeMemberDocumentation and NamespaceDefImpl::writeMemberDocumentation.

writeDocumentationPage()

void MemberList::writeDocumentationPage (OutputList & ol, const QCString & scopeName, const DefinitionMutable * container, int hierarchyLevel=0)

Declaration at line 141 of file memberlist.h, definition at line 712 of file memberlist.cpp.

713 const QCString &scopeName, const DefinitionMutable *container, int hierarchyLevel) const
714{
715 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
716
717 struct OverloadInfo
718 {
719 uint32_t count = 1;
720 uint32_t total = 0;
721 };
722 std::unordered_map<std::string,OverloadInfo> overloadInfo;
723
724 // count the number of overloaded members
725 for (const auto &imd : m_members)
726 {
728
729 if (md && md->hasDetailedDescription())
730 {
731 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
732 it->second.total++;
733 }
734 }
735
736 for (const auto &imd : m_members)
737 {
738 Definition *container_d = toDefinition(const_cast<DefinitionMutable*>(container));
740 if (md && md->hasDetailedDescription())
741 {
742 auto it = overloadInfo.find(md->name().str());
743 uint32_t overloadCount = it->second.total;
744 uint32_t &count = it->second.count;
745 QCString diskName=md->getOutputFileBase();
746 QCString title=md->qualifiedName();
747 startFile(ol,diskName,md->name(),title,HighlightedItem::None,!generateTreeView,diskName, hierarchyLevel);
748 if (!generateTreeView)
749 {
750 container->writeNavigationPath(ol);
751 ol.endQuickIndices();
752 }
753 ol.startContents();
754
755 if (generateTreeView)
756 {
757 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
758
759 ol.endContents();
761 }
762 else
763 {
764 ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"
765 " <tr>\n"
766 " <td valign=\"top\">\n");
767
768 container->writeQuickMemberLinks(ol,md);
769
770 ol.writeString(" </td>\n");
771 ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
772
773 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
774
775 ol.writeString(" </td>\n");
776 ol.writeString(" </tr>\n");
777 ol.writeString("</table>\n");
778
779 endFile(ol);
780 }
781 }
782 }
783 for (const auto &mg : m_memberGroupRefList)
784 {
785 mg->writeDocumentationPage(ol,scopeName,container);
786 }
787}

References Config_getBool, container, OutputList::endContents, endFile, endFileWithNavPath, OutputList::endQuickIndices, Definition::getOutputFileBase, Group, MemberDef::hasDetailedDescription, m_container, m_memberGroupRefList, MemberVector::m_members, Definition::name, None, Definition::qualifiedName, OutputList::startContents, startFile, QCString::str, toDefinition, toMemberDefMutable, MemberDefMutable::writeDocumentation and OutputList::writeString.

writePlainDeclarations()

void MemberList::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)

Declaration at line 129 of file memberlist.h, definition at line 316 of file memberlist.cpp.

317 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd, const GroupDef *gd,const ModuleDef *mod,
318 int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId
319 ) const
320{
321 //printf("----- writePlainDeclaration() ----\n");
322 if (numDecMembers()==-1)
323 {
324 err("MemberList::numDecMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n");
325 abort();
326 }
328 {
329 //printf(" --> no members!\n");
330 return; // no members in this list
331 }
332 //printf(" --> writePlainDeclaration() numDecMembers()=%d\n",
333 // numDecMembers());
334
336
337 bool first=TRUE;
338 for (const auto &md : m_members)
339 {
340 //printf(">>> Member '%s' type=%d visible=%d inheritedFrom=%p inheritId=%s\n",
341 // qPrint(md->name()),md->memberType(),md->isBriefSectionVisible(),(void*)inheritedFrom,qPrint(inheritId));
342 if ((inheritedFrom==nullptr || !md->isReimplementedBy(inheritedFrom)) &&
343 md->isBriefSectionVisible())
344 {
345 //printf(">>> rendering\n");
346 switch(md->memberType())
347 {
348 case MemberType::Define: // fall through
349 //case MemberType::Prototype: // fall through
350 case MemberType::Typedef: // fall through
351 case MemberType::Variable: // fall through
352 case MemberType::Function: // fall through
353 case MemberType::Signal: // fall through
354 case MemberType::Slot: // fall through
355 case MemberType::DCOP: // fall through
356 case MemberType::Property: // fall through
357 case MemberType::Interface: // fall through
358 case MemberType::Service: // fall through
359 case MemberType::Sequence: // fall through
360 case MemberType::Dictionary: // fall through
362 {
363 if (first) ol.startMemberList(),first=FALSE;
364 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
365 break;
366 }
368 {
369 // if this is an anonymous enum and there are variables of this
370 // enum type (i.e. enumVars>0), then we do not show the enum here.
371 if (countEnumValues(md)==0) // show enum here
372 {
373 //printf("Enum!!\n");
374 if (first)
375 {
376 ol.startMemberList();
377 first=FALSE;
378 }
381 bool detailsLinkable = md->hasDetailedDescription();
382 if (!detailsLinkable)
383 {
384 ol.startDoxyAnchor(md->getOutputFileBase(),QCString(),md->anchor(),md->name(),QCString());
385 ol.addLabel(md->getOutputFileBase(),md->anchor());
386 }
387 if (md->isSliceLocal())
388 {
389 ol.writeString("local ");
390 }
391 ol.writeString("enum ");
392 if (md->getLanguage()==SrcLangExt::Cpp && md->isStrong())
393 {
394 if (md->isEnumStruct())
395 {
396 ol.writeString("struct ");
397 }
398 else
399 {
400 ol.writeString("class ");
401 }
402 }
404 md->writeEnumDeclaration(ol,cd,nd,fd,gd,mod);
405 if (!detailsLinkable)
406 {
407 ol.endDoxyAnchor(md->getOutputFileBase(),md->anchor());
408 }
410 if (!md->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
411 {
412 auto parser { createDocParser() };
413 auto ast { validatingParseDoc(*parser.get(),
414 md->briefFile(),md->briefLine(),
415 cd,md,
416 md->briefDescription(),
417 TRUE,FALSE,
418 QCString(),TRUE,FALSE) };
419 if (!ast->isEmpty())
420 {
421 ol.startMemberDescription(md->anchor());
422 ol.writeDoc(ast.get(),cd,md);
423 if (md->hasDetailedDescription())
424 {
426 ol.docify(" ");
427 ol.startTextLink(md->getOutputFileBase(),
428 md->anchor());
429 ol.parseText(theTranslator->trMore());
430 ol.endTextLink();
431 ol.enableAll();
432 }
434 }
435 }
436 ol.endMemberDeclaration(md->anchor(),inheritId);
437 }
438 md->warnIfUndocumented();
439 break;
440 }
442 if (inheritedFrom==nullptr)
443 {
444 if (first)
445 {
446 ol.startMemberList();
447 first=FALSE;
448 }
449 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
450 break;
451 }
453 {
454 if (inGroup)
455 {
456 //printf("EnumValue!\n");
457 if (first) ol.startMemberList(),first=FALSE;
458 md->writeDeclaration(ol,cd,nd,fd,gd,mod,true,indentLevel,inheritedFrom,inheritId);
459 }
460 }
461 break;
462 }
463 }
464 }
465
466 if (!first)
467 {
468 ol.endMemberList();
469 }
470
472 //printf("----- end writePlainDeclaration() ----\n");
473}

References OutputList::addLabel, Definition::briefDescription, Config_getBool, countEnumValues, createDocParser, DCOP, Define, Dictionary, OutputList::disableAllBut, OutputList::docify, OutputList::enableAll, OutputList::endDoxyAnchor, OutputList::endMemberDeclaration, OutputList::endMemberDescription, OutputList::endMemberItem, OutputList::endMemberList, OutputList::endTextLink, Enumeration, EnumValue, err, Event, FALSE, Friend, Function, Html, OutputList::insertMemberAlign, Interface, MemberVector::m_members, OutputGenerator::Normal, numDecEnumValues, numDecMembers, OutputList::parseText, OutputList::popGeneratorState, Property, OutputList::pushGeneratorState, Sequence, Service, Signal, Slot, OutputList::startDoxyAnchor, OutputList::startMemberDeclaration, OutputList::startMemberDescription, OutputList::startMemberItem, OutputList::startMemberList, OutputList::startTextLink, theTranslator, TRUE, Typedef, validatingParseDoc, Variable, OutputList::writeDoc and OutputList::writeString.

Referenced by MemberGroup::addGroupedInheritedMembers, writeDeclarations and ClassDefImpl::writePlainMemberDeclaration.

writeSimpleDocumentation()

void MemberList::writeSimpleDocumentation (OutputList & ol, const Definition * container)

Declaration at line 140 of file memberlist.h, definition at line 688 of file memberlist.cpp.

689 const Definition *container) const
690{
691 //printf("MemberList count=%d enumValues=%d\n",numDocMembers(),numDocEnumValues());
692 if (numDocMembers()<=numDocEnumValues()) return; // only enum values and they should be excluded
693
694 const ClassDef *cd = nullptr;
695 if (container && container->definitionType()==Definition::TypeClass)
696 {
698 }
699 ol.startMemberDocSimple(cd && cd->isJavaEnum());
700 for (const auto &md : m_members)
701 {
703 if (mdm)
704 {
706 }
707 }
708 ol.endMemberDocSimple(cd && cd->isJavaEnum());
709}

References container, OutputList::endMemberDocSimple, ClassDef::isJavaEnum, MemberVector::m_members, numDocEnumValues, numDocMembers, OutputList::startMemberDocSimple, toClassDef, toMemberDefMutable, Definition::TypeClass and MemberDefMutable::writeMemberDocSimple.

Referenced by ClassDefImpl::writeSimpleMemberDocumentation.

writeTagFile()

void MemberList::writeTagFile (TextStream & tagFile, bool useQualifiedName=false, bool showNamespaceMembers=true)

Declaration at line 143 of file memberlist.h, definition at line 845 of file memberlist.cpp.

845void MemberList::writeTagFile(TextStream &tagFile,bool useQualifiedName,bool showNamespaceMembers)
846{
847 for (const auto &imd : m_members)
848 {
850 if (md)
851 {
852 if (md->getLanguage()!=SrcLangExt::VHDL)
853 {
854 md->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
855 if (md->memberType()==MemberType::Enumeration && !md->isStrong())
856 {
857 for (const auto &ivmd : md->enumFieldList())
858 {
860 if (vmd)
861 {
862 vmd->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
863 }
864 }
865 }
866 }
867 else
868 {
869 VhdlDocGen::writeTagFile(md,tagFile);
870 }
871 }
872 }
873 for (const auto &mg : m_memberGroupRefList)
874 {
875 mg->writeTagFile(tagFile,useQualifiedName);
876 }
877}

References Enumeration, MemberDef::enumFieldList, Definition::getLanguage, MemberDef::isStrong, m_memberGroupRefList, MemberVector::m_members, MemberDef::memberType, toMemberDefMutable, MemberDefMutable::writeTagFile and VhdlDocGen::writeTagFile.

Referenced by ClassDefImpl::writeTagFile, FileDefImpl::writeTagFile, GroupDefImpl::writeTagFile, ModuleDefImpl::writeTagFile and NamespaceDefImpl::writeTagFile.

Private Member Functions

countEnumValues()

int MemberList::countEnumValues (const MemberDef * md)

Declaration at line 154 of file memberlist.h, definition at line 248 of file memberlist.cpp.

249{
250 int numEnumValues=0;
251 QCString name(md->name());
252 int i=name.findRev("::");
253 if (i!=-1) name=name.right(name.length()-i-2);
254 if (name[0]=='@')
255 {
256 for (const auto &vmd : m_members)
257 {
258 QCString vtype=vmd->typeString();
259 if ((vtype.find(name))!=-1)
260 {
261 numEnumValues++;
262 }
263 }
264 }
265 return numEnumValues;
266}

References QCString::find, QCString::findRev, QCString::length, MemberVector::m_members, Definition::name and QCString::right.

Referenced by declVisible and writePlainDeclarations.

Private Member Attributes

m_container

MemberListContainer MemberList::m_container

m_listType

MemberListType MemberList::m_listType

Definition at line 161 of file memberlist.h.

Referenced by listType, MemberList and writeDeclarations.

m_memberGroupRefList

m_needsSorting

bool MemberList::m_needsSorting

Definition at line 162 of file memberlist.h.

Referenced by MemberList, needsSorting and setNeedsSorting.

m_numDecEnumValues

int MemberList::m_numDecEnumValues
mutable

Definition at line 156 of file memberlist.h.

156 mutable int m_numDecEnumValues;

Referenced by countDecMembers, MemberList and numDecEnumValues.

m_numDecMembers

int MemberList::m_numDecMembers
mutable

Definition at line 155 of file memberlist.h.

155 mutable int m_numDecMembers; // number of members in the brief part of the memberlist

Referenced by countDecMembers, MemberList and numDecMembers.

m_numDocEnumValues

int MemberList::m_numDocEnumValues

Definition at line 158 of file memberlist.h.

Referenced by countDocMembers, MemberList and numDocEnumValues.

m_numDocMembers

int MemberList::m_numDocMembers

Definition at line 157 of file memberlist.h.

157 int m_numDocMembers; // number of members in the detailed part of the memberlist

Referenced by countDocMembers, MemberList and numDocMembers.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.