memberlist.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
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.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 
18 #ifndef MEMBERLIST_H
19 #define MEMBERLIST_H
20 
21 #include <qlist.h>
22 #include "memberdef.h"
23 #include "sortdict.h"
24 #include "types.h"
25 
26 class GroupDef;
27 class MemberGroup;
28 class MemberGroupList;
29 class StorageIntf;
30 
31 /** A list of MemberDef objects. */
32 class MemberList : public QList<MemberDef>
33 {
34  public:
35  MemberList();
37  ~MemberList();
38  MemberListType listType() const { return m_listType; }
40  bool insert(uint index,const MemberDef *md);
41  void inSort(const MemberDef *md);
42  void append(const MemberDef *md);
43  int varCount() const { ASSERT(m_numDecMembers!=-1); return m_varCnt; }
44  int funcCount() const { ASSERT(m_numDecMembers!=-1); return m_funcCnt; }
45  int enumCount() const { ASSERT(m_numDecMembers!=-1); return m_enumCnt; }
46  int enumValueCount() const { ASSERT(m_numDecMembers!=-1); return m_enumValCnt; }
47  int typedefCount() const { ASSERT(m_numDecMembers!=-1); return m_typeCnt; }
48  int protoCount() const { ASSERT(m_numDecMembers!=-1); return m_protoCnt; }
49  int defineCount() const { ASSERT(m_numDecMembers!=-1); return m_defCnt; }
50  int friendCount() const { ASSERT(m_numDecMembers!=-1); return m_friendCnt; }
51  int numDecMembers() const { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; }
52  int numDocMembers() const { ASSERT(m_numDocMembers!=-1); return m_numDocMembers; }
53  bool needsSorting() const { return m_needsSorting; }
54  void countDecMembers(bool countEnumValues=FALSE,GroupDef *gd=0);
55  void countDocMembers(bool countEnumValues=FALSE);
56  int countInheritableMembers(ClassDef *inheritedFrom) const;
58  ClassDef *cd,NamespaceDef *nd,FileDef *fd, GroupDef *gd,
59  ClassDef *inheritedFrom,const char *inheritId);
61  ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
62  const char *title,const char *subtitle,
63  bool showEnumValues=FALSE,bool showInline=FALSE,
65  void writeDocumentation(OutputList &ol,const char *scopeName,
66  Definition *container,const char *title,bool showEnumValues=FALSE,bool showInline=FALSE);
67  void writeSimpleDocumentation(OutputList &ol,Definition *container);
69  const char *scopeName, Definition *container);
70  void writeTagFile(FTextStream &);
71  bool declVisible() const;
73  void setInGroup(bool inGroup) { m_inGroup=inGroup; }
74  void setInFile(bool inFile) { m_inFile=inFile; }
75  void addListReferences(Definition *def);
77  void setNeedsSorting(bool b);
79 
80  void marshal(StorageIntf *s);
81  void unmarshal(StorageIntf *s);
82 
83  private:
84  int compareValues(const MemberDef *item1,const MemberDef *item2) const;
85  int m_varCnt;
86  int m_funcCnt;
87  int m_enumCnt;
89  int m_typeCnt;
91  int m_defCnt;
93  int m_numDecMembers; // number of members in the brief part of the memberlist
94  int m_numDocMembers; // number of members in the detailed part of the memberlist
96  bool m_inGroup; // is this list part of a group definition
97  bool m_inFile; // is this list part of a file definition
100 };
101 
102 /** An iterator for MemberDef objects in a MemberList. */
103 class MemberListIterator : public QListIterator<MemberDef>
104 {
105  public:
107  virtual ~MemberListIterator() {}
108 };
109 
110 /** An unsorted dictionary of MemberDef objects. */
111 class MemberDict : public QDict<MemberDef>
112 {
113  public:
114  MemberDict(int size) : QDict<MemberDef>(size) {}
115  virtual ~MemberDict() {}
116 };
117 
118 /** A sorted dictionary of MemberDef objects. */
119 class MemberSDict : public SDict<MemberDef>
120 {
121  public:
123  virtual ~MemberSDict() {}
124  private:
125  int compareValues(const MemberDef *item1,const MemberDef *item2) const;
126 };
127 
128 
129 #endif
int m_numDocMembers
Definition: memberlist.h:94
MemberListType listType() const
Definition: memberlist.h:38
bool m_inGroup
Definition: memberlist.h:96
int funcCount() const
Definition: memberlist.h:44
void append(const MemberDef *md)
Definition: memberlist.cpp:246
MemberGroupList * getMemberGroupList() const
Definition: memberlist.h:78
int protoCount() const
Definition: memberlist.h:48
bool m_needsSorting
Definition: memberlist.h:99
This file contains a number of basic enums and types.
bool m_inFile
Definition: memberlist.h:97
int m_typeCnt
Definition: memberlist.h:89
void setInFile(bool inFile)
Definition: memberlist.h:74
int enumCount() const
Definition: memberlist.h:45
int m_funcCnt
Definition: memberlist.h:86
void writeDocumentation(OutputList &ol, const char *scopeName, Definition *container, const char *title, bool showEnumValues=FALSE, bool showInline=FALSE)
Definition: memberlist.cpp:655
const bool FALSE
Definition: qglobal.h:370
MemberSDict(int size=17)
Definition: memberlist.h:122
Abstract interface for file based memory storage operations.
Definition: store.h:27
int m_numDecMembers
Definition: memberlist.h:93
int compareValues(const MemberDef *item1, const MemberDef *item2) const
Definition: memberlist.cpp:77
void writeTagFile(FTextStream &)
Definition: memberlist.cpp:963
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
static constexpr double mg
Definition: Units.h:145
virtual ~MemberDict()
Definition: memberlist.h:115
int defineCount() const
Definition: memberlist.h:49
void addMemberGroup(MemberGroup *mg)
Definition: memberlist.cpp:774
bool declVisible() const
Definition: memberlist.cpp:256
int m_friendCnt
Definition: memberlist.h:92
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
void countDocMembers(bool countEnumValues=FALSE)
Definition: memberlist.cpp:208
Definition: sortdict.h:73
int enumValueCount() const
Definition: memberlist.h:46
void marshal(StorageIntf *s)
Definition: memberlist.cpp:837
void findSectionsInDocumentation()
Definition: memberlist.cpp:818
MemberGroupList * memberGroupList
Definition: memberlist.h:95
int m_defCnt
Definition: memberlist.h:91
int numDocMembers() const
Definition: memberlist.h:52
void inSort(const MemberDef *md)
Definition: memberlist.cpp:241
MemberDict(int size)
Definition: memberlist.h:114
void setNeedsSorting(bool b)
Definition: memberlist.cpp:902
void setInGroup(bool inGroup)
Definition: memberlist.h:73
void writeSimpleDocumentation(OutputList &ol, Definition *container)
Definition: memberlist.cpp:697
int typedefCount() const
Definition: memberlist.h:47
int m_enumCnt
Definition: memberlist.h:87
void writeDocumentationPage(OutputList &ol, const char *scopeName, Definition *container)
Definition: memberlist.cpp:715
TFile * inFile
Definition: makeDST.cxx:36
int friendCount() const
Definition: memberlist.h:50
virtual ~MemberSDict()
Definition: memberlist.h:123
int countInheritableMembers(ClassDef *inheritedFrom) const
Definition: memberlist.cpp:92
void unmarshal(StorageIntf *s)
Definition: memberlist.cpp:869
virtual ~MemberListIterator()
Definition: memberlist.h:107
void countDecMembers(bool countEnumValues=FALSE, GroupDef *gd=0)
Definition: memberlist.cpp:136
static bool * b
Definition: config.cpp:1043
int varCount() const
Definition: memberlist.h:43
bool needsSorting() const
Definition: memberlist.h:53
static QCString listTypeAsString(MemberListType type)
Definition: memberlist.cpp:907
MemberListType
Definition: types.h:104
void writeDeclarations(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, const char *title, const char *subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, ClassDef *inheritedFrom=0, MemberListType lt=MemberListType_pubMethods)
Definition: memberlist.cpp:519
unsigned uint
Definition: qglobal.h:351
int m_enumValCnt
Definition: memberlist.h:88
void addListReferences(Definition *def)
Definition: memberlist.cpp:784
static QCString * s
Definition: config.cpp:1042
MemberListType m_listType
Definition: memberlist.h:98
bool insert(uint index, const MemberDef *md)
Definition: memberlist.cpp:236
int numDecMembers() const
Definition: memberlist.h:51
void writePlainDeclarations(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, ClassDef *inheritedFrom, const char *inheritId)
Definition: memberlist.cpp:321
Definition: qlist.h:54
#define ASSERT(x)
Definition: qglobal.h:590
int m_varCnt
Definition: memberlist.h:85
int m_protoCnt
Definition: memberlist.h:90