ISLEman
namespacedef.h
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 NAMESPACEDEF_H
19 #define NAMESPACEDEF_H
20 
21 #include <qstrlist.h>
22 #include <qdict.h>
23 #include "sortdict.h"
24 #include "definition.h"
25 #include "filedef.h"
26 
27 class MemberList;
28 class ClassDef;
29 class ClassList;
30 class OutputList;
31 class ClassSDict;
32 class MemberDef;
33 class NamespaceList;
34 class MemberGroupSDict;
35 class NamespaceSDict;
36 class FTextStream;
37 
39 class NamespaceDef : public Definition
40 {
41  public:
42  NamespaceDef(const char *defFileName,int defLine,int defColumn,
43  const char *name,const char *ref=0,
44  const char *refFile=0,const char*type=0,
45  bool isPublished=false);
46  ~NamespaceDef();
47  DefType definitionType() const { return TypeNamespace; }
49  QCString anchor() const { return QCString(); }
50  void insertUsedFile(FileDef *fd);
51 
52  void writeDocumentation(OutputList &ol);
53  void writeMemberPages(OutputList &ol);
54  void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const;
55  void writeTagFile(FTextStream &);
56 
57  void insertClass(ClassDef *cd);
58  void insertNamespace(NamespaceDef *nd);
59  void insertMember(MemberDef *md);
60 
61  void computeAnchors();
62  int countMembers();
63  void addUsingDirective(NamespaceDef *nd);
64  NamespaceSDict *getUsedNamespaces() const;
65  void addUsingDeclaration(Definition *def);
66  SDict<Definition> *getUsedClasses() const { return usingDeclList; }
67  void combineUsingRelations();
68  QCString displayName(bool=TRUE) const;
69  QCString localName() const;
70 
71  bool isConstantGroup() const { return CONSTANT_GROUP == m_type; }
72  bool isModule() const { return MODULE == m_type; }
73  bool isLibrary() const { return LIBRARY == m_type; }
74 
75  bool isLinkableInProject() const;
76  bool isLinkable() const;
77  bool hasDetailedDescription() const;
78  void addMembersToMemberGroup();
79  void distributeMemberGroupDocumentation();
80  void findSectionsInDocumentation();
81  void sortMemberLists();
82 
83  virtual Definition *findInnerCompound(const char *name);
84  void addInnerCompound(Definition *d);
85  void addListReferences();
86  void setFileName(const QCString &fn);
87 
88  bool subGrouping() const { return m_subGrouping; }
89 
90  MemberList *getMemberList(MemberListType lt) const;
91  const QList<MemberList> &getMemberLists() const { return m_memberLists; }
92  MemberDef *getMemberByName(const QCString &) const;
93 
95  MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
96 
98  ClassSDict *getClassSDict() const { return classSDict; }
99 
101  NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; }
102 
103  QCString title() const;
104  QCString compoundTypeString() const;
105 
106  bool visited;
107 
108  private:
109  MemberList *createMemberList(MemberListType lt);
110  void addMemberToList(MemberListType lt,MemberDef *md);
111  void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
112  void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title);
113  void writeDetailedDescription(OutputList &ol,const QCString &title);
114  void writeBriefDescription(OutputList &ol);
115  void startMemberDeclarations(OutputList &ol);
116  void endMemberDeclarations(OutputList &ol);
117  void writeClassDeclarations(OutputList &ol,const QCString &title);
118  void writeInlineClasses(OutputList &ol);
119  void writeNamespaceDeclarations(OutputList &ol,const QCString &title,
120  bool isConstantGroup=false);
121  void writeMemberGroups(OutputList &ol);
122  void writeAuthorSection(OutputList &ol);
123  void startMemberDocumentation(OutputList &ol);
124  void endMemberDocumentation(OutputList &ol);
125  void writeSummaryLinks(OutputList &ol);
126  void addNamespaceAttributes(OutputList &ol);
127 
128  QCString fileName;
129  FileList files;
130 
131  NamespaceSDict *usingDirList;
132  SDict<Definition> *usingDeclList;
133  SDict<Definition> *m_innerCompounds;
134 
135  MemberSDict *m_allMembersDict;
136  QList<MemberList> m_memberLists;
137  MemberGroupSDict *memberGroupSDict;
138  ClassSDict *classSDict;
139  NamespaceSDict *namespaceSDict;
140  bool m_subGrouping;
141  enum { NAMESPACE, MODULE, CONSTANT_GROUP, LIBRARY } m_type;
142  bool m_isPublished;
143 };
144 
146 class NamespaceList : public QList<NamespaceDef>
147 {
148  public:
149  ~NamespaceList() {}
150  int compareValues(const NamespaceDef *nd1,const NamespaceDef *nd2) const
151  {
152  return qstricmp(nd1->name(), nd2->name());
153  }
154 };
155 
157 class NamespaceListIterator : public QListIterator<NamespaceDef>
158 {
159  public:
162 };
163 
165 class NamespaceDict : public QDict<NamespaceDef>
166 {
167  public:
168  NamespaceDict(int size) : QDict<NamespaceDef>(size) {}
169  ~NamespaceDict() {}
170 };
171 
173 class NamespaceSDict : public SDict<NamespaceDef>
174 {
175  public:
176  NamespaceSDict(int size=17) : SDict<NamespaceDef>(size) {}
177  ~NamespaceSDict() {}
178  void writeDeclaration(OutputList &ol,const char *title,
179  bool isConstantGroup=false, bool localName=FALSE);
180  bool declVisible() const;
181  private:
182  int compareValues(const NamespaceDef *item1,const NamespaceDef *item2) const
183  {
184  return qstricmp(item1->name(),item2->name());
185  }
186 };
187 
188 
189 
190 #endif
The common base class of all entity definitions found in the sources.
Definition: definition.h:92
A model of a namespace symbol.
Definition: namespacedef.h:39
QCString displayName(bool=TRUE) const
Definition: namespacedef.cpp:871
A model of a class/file/namespace member symbol.
Definition: memberdef.h:43
bool isLinkableInProject() const
Definition: namespacedef.cpp:1116
MemberGroupSDict * getMemberGroupSDict() const
Definition: namespacedef.h:95
An iterator for NamespaceDef objects in a NamespaceList.
Definition: namespacedef.h:157
A model of a file symbol.
Definition: filedef.h:64
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
A sorted dictionary of ClassDef objects.
Definition: classlist.h:56
A list of NamespaceDef objects.
Definition: namespacedef.h:146
DefType definitionType() const
Definition: namespacedef.h:47
QCString anchor() const
Definition: namespacedef.h:49
const QCString & name() const
Definition: definition.h:114
DefType
Definition: definition.h:71
An unsorted dictionary of NamespaceDef objects.
Definition: namespacedef.h:165
A list of ClassDef objects.
Definition: classlist.h:30
A list of MemberDef objects.
Definition: memberlist.h:32
Definition: qlist.h:126
A sorted dictionary of NamespaceDef objects.
Definition: namespacedef.h:173
Class representing a list of FileDef objects.
Definition: filedef.h:240
NamespaceSDict * getNamespaceSDict() const
Definition: namespacedef.h:101
Class representing a list of output generators that are written to in parallel.
Definition: outputlist.h:54
QCString getOutputFileBase() const
Definition: namespacedef.cpp:816
bool isLinkable() const
Definition: namespacedef.cpp:1134
This is an alternative implementation of QCString.
Definition: qcstring.h:131
A sorted dictionary of MemberGroup objects.
Definition: membergroup.h:129
A class representing of a compound symbol.
Definition: classdef.h:59
A sorted dictionary of MemberDef objects.
Definition: memberlist.h:131
ClassSDict * getClassSDict() const
Definition: namespacedef.h:98