1 /******************************************************************************
5 * Copyright (C) 1997-2015 by Dimitri van Heesch.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
22 #include "memberdef.h"
28 class MemberGroupList;
31 /** A list of MemberDef objects. */
32 class MemberList : private QList<MemberDef>
34 friend class MemberListIterator;
37 MemberList(MemberListType lt);
39 MemberListType listType() const { return m_listType; }
40 static QCString listTypeAsString(MemberListType type);
42 /* ---- standard QList methods ---- */
43 void inSort(const MemberDef *md);
44 void append(const MemberDef *md);
45 void remove(const MemberDef *md);
48 int findRef(const MemberDef *md) const;
49 MemberDef *getFirst() const;
50 MemberDef *take(uint index);
53 int varCount() const { ASSERT(m_numDecMembers!=-1); return m_varCnt; }
54 int funcCount() const { ASSERT(m_numDecMembers!=-1); return m_funcCnt; }
55 int enumCount() const { ASSERT(m_numDecMembers!=-1); return m_enumCnt; }
56 int enumValueCount() const { ASSERT(m_numDecMembers!=-1); return m_enumValCnt; }
57 int typedefCount() const { ASSERT(m_numDecMembers!=-1); return m_typeCnt; }
58 int protoCount() const { ASSERT(m_numDecMembers!=-1); return m_protoCnt; }
59 int defineCount() const { ASSERT(m_numDecMembers!=-1); return m_defCnt; }
60 int friendCount() const { ASSERT(m_numDecMembers!=-1); return m_friendCnt; }
61 int numDecMembers() const { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; }
62 int numDocMembers() const { ASSERT(m_numDocMembers!=-1); return m_numDocMembers; }
63 bool needsSorting() const { return m_needsSorting; }
64 void countDecMembers(bool countEnumValues=FALSE,GroupDef *gd=0);
65 void countDocMembers(bool countEnumValues=FALSE);
66 int countInheritableMembers(ClassDef *inheritedFrom) const;
67 void writePlainDeclarations(OutputList &ol,
68 ClassDef *cd,NamespaceDef *nd,FileDef *fd, GroupDef *gd,
69 ClassDef *inheritedFrom,const char *inheritId);
70 void writeDeclarations(OutputList &ol,
71 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
72 const char *title,const char *subtitle,
73 bool showEnumValues=FALSE,bool showInline=FALSE,
74 ClassDef *inheritedFrom=0,MemberListType lt=MemberListType_pubMethods);
75 void writeDocumentation(OutputList &ol,const char *scopeName,
76 Definition *container,const char *title,bool showEnumValues=FALSE,bool showInline=FALSE);
77 void writeSimpleDocumentation(OutputList &ol,Definition *container);
78 void writeDocumentationPage(OutputList &ol,
79 const char *scopeName, Definition *container);
80 void writeTagFile(FTextStream &);
81 bool declVisible() const;
82 void addMemberGroup(MemberGroup *mg);
83 void setInGroup(bool inGroup) { m_inGroup=inGroup; }
84 void setInFile(bool inFile) { m_inFile=inFile; }
85 void addListReferences(Definition *def);
86 void findSectionsInDocumentation();
87 void setNeedsSorting(bool b);
88 MemberGroupList *getMemberGroupList() const { return memberGroupList; }
90 void marshal(StorageIntf *s);
91 void unmarshal(StorageIntf *s);
94 int compareValues(const MemberDef *item1,const MemberDef *item2) const;
95 int countEnumValues(MemberDef *md,bool setAnonEnumType) const;
104 int m_numDecMembers; // number of members in the brief part of the memberlist
105 int m_numDocMembers; // number of members in the detailed part of the memberlist
106 MemberGroupList *memberGroupList;
107 bool m_inGroup; // is this list part of a group definition
108 bool m_inFile; // is this list part of a file definition
109 MemberListType m_listType;
111 QDict<int> m_overloadCount;
114 /** An iterator for MemberDef objects in a MemberList. */
115 class MemberListIterator : public QListIterator<MemberDef>
118 MemberListIterator(const MemberList &list);
119 virtual ~MemberListIterator() {}
122 /** An unsorted dictionary of MemberDef objects. */
123 class MemberDict : public QDict<MemberDef>
126 MemberDict(int size) : QDict<MemberDef>(size) {}
127 virtual ~MemberDict() {}
130 /** A sorted dictionary of MemberDef objects. */
131 class MemberSDict : public SDict<MemberDef>
134 MemberSDict(int size=17) : SDict<MemberDef>(size) {}
135 virtual ~MemberSDict() {}
137 int compareValues(const MemberDef *item1,const MemberDef *item2) const;