Doxygen
Loading...
Searching...
No Matches
entry.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 ENTRY_H
19#define ENTRY_H
20
21#include <vector>
22#include <memory>
23#include <sstream>
24#include <functional>
25
26#include "types.h"
27#include "arguments.h"
28#include "reflist.h"
29#include "textstream.h"
30#include "configvalues.h"
31
32class SectionInfo;
33class FileDef;
34
35//--------------------------------------------------------------
36
37#define COMMAND_OVERRIDES \
38 OVERRIDE_ENTRY(bool, bool, 1, callGraph ) \
39 OVERRIDE_ENTRY(bool, bool, 1, callerGraph ) \
40 OVERRIDE_ENTRY(bool, bool, 1, referencedByRelation ) \
41 OVERRIDE_ENTRY(bool, bool, 1, referencesRelation ) \
42 OVERRIDE_ENTRY(bool, bool, 1, inlineSource ) \
43 OVERRIDE_ENTRY(bool, bool, 1, includeGraph ) \
44 OVERRIDE_ENTRY(bool, bool, 1, includedByGraph ) \
45 OVERRIDE_ENTRY(bool, bool, 1, directoryGraph ) \
46 OVERRIDE_ENTRY(bool, bool, 1, collaborationGraph ) \
47 OVERRIDE_ENTRY(bool, bool, 1, groupGraph ) \
48 OVERRIDE_ENTRY(bool, bool, 1, enumValues ) \
49 OVERRIDE_ENTRY(CLASS_GRAPH_t, int, 3, inheritanceGraph )
50
52{
53 private:
54#define OVERRIDE_ENTRY(type,store_type,bits,name) \
55 store_type m_##name : bits; \
56 bool m_##name##ExplicitlySet : 1;
58#undef OVERRIDE_ENTRY
59
60 public:
62 void reset() { std::memset(this, 0, sizeof(*this)); }
63
64 // conversions between type and store_type
65 bool to_store_type(bool t) const { return t; }
66 int to_store_type(CLASS_GRAPH_t t) const { return static_cast<int>(t); }
67 bool from_store_type(bool t) const { return t; }
68 CLASS_GRAPH_t from_store_type(int t) const { return static_cast<CLASS_GRAPH_t>(t); }
69
70#define OVERRIDE_ENTRY(type,store_type,bits,name) \
71 void override_##name(type value) { \
72 m_##name = to_store_type(value); \
73 m_##name##ExplicitlySet = true; \
74 /* printf("overrule_%s(%d) isSet=%d\n",#name,value,m_##name##ExplicitlySet); */ \
75 } \
76 void apply_##name(std::function<void(type)> func) const { \
77 /* printf("apply_%s(%d) isSet=%d\n",#name,m_##name,m_##name##ExplicitlySet); */ \
78 if (m_##name##ExplicitlySet) func(from_store_type(m_##name)); \
79 }
81#undef OVERRIDE_ENTRY
82
83};
84
85//--------------------------------------------------------------
86
87/** This class stores information about an inheritance relation
88 */
90{
91 /*! Creates an object representing an inheritance relation */
92 BaseInfo(const QCString &n,Protection p,Specifier v) :
93 name(n),prot(p),virt(v) {}
94 QCString name; //!< the name of the base class
95 Protection prot; //!< inheritance type
96 Specifier virt; //!< virtualness
97};
98
99/** This struct is used to capture the tag file information
100 * for an Entry.
101 */
103{
104 QCString tagName;
105 QCString fileName;
106 QCString anchor;
107};
108
109/** Represents an unstructured piece of information, about an
110 * entity found in the sources.
111 *
112 * parseMain() in scanner.l will generate a tree of these
113 * entries.
114 */
115class Entry
116{
117 public:
118
120 {
121 GROUPDOC_NORMAL, //!< defgroup
122 GROUPDOC_ADD, //!< addtogroup
123 GROUPDOC_WEAK //!< weakgroup
124 }; //!< kind of group
125
126 Entry();
127 Entry(const Entry &);
128 Entry &operator=(const Entry &) = delete;
129 Entry(Entry &&) = delete;
130 Entry &operator=(Entry &&) = delete;
131 ~Entry();
132
133 /*! Returns the parent for this Entry or nullptr if this entry has no parent. */
134 Entry *parent() const { return m_parent; }
135
136 /*! Returns the list of children for this Entry
137 * @see addSubEntry() and removeSubEntry()
138 */
139 const std::vector< std::shared_ptr<Entry> > &children() const { return m_sublist; }
140
141 /*! @name add entry as a child and pass ownership.
142 * @note This makes the entry passed invalid!
143 * @{
144 */
146 void moveToSubEntryAndKeep(std::shared_ptr<Entry> e);
147 /*! @} */
148
149 /*! @name add entry as a child, pass ownership and reinitialize entry */
151 void moveToSubEntryAndRefresh(std::shared_ptr<Entry> &e);
152
153 /*! make a copy of \a e and add it as a child to this entry */
154 void copyToSubEntry (Entry* e);
155 void copyToSubEntry (const std::shared_ptr<Entry> &e);
156
157 /*! Removes entry \a e from the list of children.
158 * The entry will be deleted if found.
159 */
160 void removeSubEntry(const Entry *e);
161
162 /*! Restore the state of this Entry to the default value it has
163 * at construction time.
164 */
165 void reset();
166
167 void markAsProcessed() const { (const_cast<Entry*>(this))->section = EntryType::makeEmpty(); }
168 void setFileDef(FileDef *fd);
169 FileDef *fileDef() const { return m_fileDef; }
170
171 // identification
172 EntryType section; //!< entry type (see Sections);
173 QCString type; //!< member type
174 QCString name; //!< member name
175 bool hasTagInfo; //!< is tag info valid
176 TagInfo tagInfoData; //!< tag file info data
177 const TagInfo *tagInfo() const { return hasTagInfo ? &tagInfoData : nullptr; }
178
179 // content
180 Protection protection; //!< class protection
181 MethodTypes mtype; //!< signal, slot, (dcop) method, or property?
182 TypeSpecifier spec; //!< class/member specifiers
183 VhdlSpecifier vhdlSpec; //!< VHDL specifiers
184 int initLines; //!< define/variable initializer lines to show
185 bool isStatic; //!< static ?
186 bool explicitExternal; //!< explicitly defined as external?
187 bool proto; //!< prototype ?
188 bool subGrouping; //!< automatically group class members?
189 bool exported; //!< is the symbol exported from a C++20 module
190 CommandOverrides commandOverrides; //!< store info for commands whose default can be overridden
191 Specifier virt; //!< virtualness of the entry
192 QCString args; //!< member argument string
193 QCString bitfields; //!< member's bit fields
194 ArgumentList argList; //!< member arguments as a list
195 ArgumentLists tArgLists; //!< template argument declarations
196 TextStream program; //!< the program text
197 TextStream initializer; //!< initial value (for variables)
198 QCString includeFile; //!< include file (2 arg of \\class, must be unique)
199 QCString includeName; //!< include name (3 arg of \\class)
200 QCString doc; //!< documentation block (partly parsed)
201 int docLine; //!< line number at which the documentation was found
202 QCString docFile; //!< file in which the documentation was found
203 QCString brief; //!< brief description (doc block)
204 int briefLine; //!< line number at which the brief desc. was found
205 QCString briefFile; //!< file in which the brief desc. was found
206 QCString inbodyDocs; //!< documentation inside the body of a function
207 int inbodyLine; //!< line number at which the body doc was found
208 QCString inbodyFile; //!< file in which the body doc was found
209 QCString relates; //!< related class (doc block)
210 RelatesType relatesType; //!< how relates is handled
211 QCString read; //!< property read accessor
212 QCString write; //!< property write accessor
213 QCString inside; //!< name of the class in which documents are found
214 QCString exception; //!< throw specification
215 ArgumentList typeConstr; //!< where clause (C#) for type constraints
216 int bodyLine; //!< line number of the body in the source
217 int bodyColumn; //!< column of the body in the source
218 int endBodyLine; //!< line number where the definition ends
219 int mGrpId; //!< member group id
220 std::vector<BaseInfo> extends; //!< list of base classes
221 std::vector<Grouping> groups; //!< list of groups this entry belongs to
222 std::vector<const SectionInfo*> anchors; //!< list of anchors defined in this entry
223 QCString fileName; //!< file this entry was extracted from
224 int startLine; //!< start line of entry in the source
225 int startColumn; //!< start column of entry in the source
226 RefItemVector sli; //!< special lists (test/todo/bug/deprecated/..) this entry is in
227 SrcLangExt lang; //!< programming language in which this entry was found
228 bool hidden; //!< does this represent an entity that is hidden from the output
229 bool artificial; //!< Artificially introduced item
231 QCString id; //!< libclang id
232 LocalToc localToc;
233 QCString metaData; //!< Slice metadata
234 QCString req; //!< C++20 requires clause
235 std::vector<std::string> qualifiers; //!< qualifiers specified with the qualifier command
236
237 /// return the command name used to define GROUPDOC_SEC
238 const char *groupDocCmd() const
239 {
240 switch( groupDocType )
241 {
242 case GROUPDOC_NORMAL: return "\\defgroup";
243 case GROUPDOC_ADD: return "\\addtogroup";
244 case GROUPDOC_WEAK: return "\\weakgroup";
245 default: return "unknown group command";
246 }
247 }
249 {
250 if( !section.isGroupDoc() )
251 {
253 }
254 switch( groupDocType )
255 {
259 default: return Grouping::GROUPING_LOWEST;
260 }
261 }
262
263 private:
264 Entry *m_parent; //!< parent node in the tree
265 std::vector< std::shared_ptr<Entry> > m_sublist;
266 FileDef *m_fileDef;
267};
268
269typedef std::vector< std::shared_ptr<Entry> > EntryList;
270
271#endif
std::vector< ArgumentList > ArgumentLists
Definition arguments.h:138
bool from_store_type(bool t) const
Definition entry.h:67
bool to_store_type(bool t) const
Definition entry.h:65
void reset()
Definition entry.h:62
CLASS_GRAPH_t from_store_type(int t) const
Definition entry.h:68
int to_store_type(CLASS_GRAPH_t t) const
Definition entry.h:66
TextStream initializer
initial value (for variables)
Definition entry.h:197
void moveToSubEntryAndKeep(Entry *e)
Definition entry.cpp:144
VhdlSpecifier vhdlSpec
VHDL specifiers.
Definition entry.h:183
bool subGrouping
automatically group class members?
Definition entry.h:188
Entry & operator=(const Entry &)=delete
void setFileDef(FileDef *fd)
Definition entry.cpp:244
const std::vector< std::shared_ptr< Entry > > & children() const
Definition entry.h:139
TextStream program
the program text
Definition entry.h:196
bool proto
prototype ?
Definition entry.h:187
std::vector< std::shared_ptr< Entry > > m_sublist
Definition entry.h:265
GroupDocType groupDocType
Definition entry.h:230
QCString metaData
Slice metadata.
Definition entry.h:233
int docLine
line number at which the documentation was found
Definition entry.h:201
QCString bitfields
member's bit fields
Definition entry.h:193
ArgumentList typeConstr
where clause (C#) for type constraints
Definition entry.h:215
void markAsProcessed() const
Definition entry.h:167
int endBodyLine
line number where the definition ends
Definition entry.h:218
bool hasTagInfo
is tag info valid
Definition entry.h:175
bool exported
is the symbol exported from a C++20 module
Definition entry.h:189
const TagInfo * tagInfo() const
Definition entry.h:177
const char * groupDocCmd() const
return the command name used to define GROUPDOC_SEC
Definition entry.h:238
QCString includeName
include name (3 arg of \class)
Definition entry.h:199
QCString id
libclang id
Definition entry.h:231
ArgumentLists tArgLists
template argument declarations
Definition entry.h:195
LocalToc localToc
Definition entry.h:232
MethodTypes mtype
signal, slot, (dcop) method, or property?
Definition entry.h:181
GroupDocType
Definition entry.h:120
@ GROUPDOC_WEAK
weakgroup
Definition entry.h:123
@ GROUPDOC_ADD
addtogroup
Definition entry.h:122
@ GROUPDOC_NORMAL
defgroup
Definition entry.h:121
SrcLangExt lang
programming language in which this entry was found
Definition entry.h:227
Entry * parent() const
Definition entry.h:134
QCString inbodyDocs
documentation inside the body of a function
Definition entry.h:206
TagInfo tagInfoData
tag file info data
Definition entry.h:176
int startColumn
start column of entry in the source
Definition entry.h:225
QCString relates
related class (doc block)
Definition entry.h:209
bool explicitExternal
explicitly defined as external?
Definition entry.h:186
std::vector< const SectionInfo * > anchors
list of anchors defined in this entry
Definition entry.h:222
void moveToSubEntryAndRefresh(Entry *&e)
Definition entry.cpp:130
QCString fileName
file this entry was extracted from
Definition entry.h:223
RelatesType relatesType
how relates is handled
Definition entry.h:210
QCString write
property write accessor
Definition entry.h:212
QCString args
member argument string
Definition entry.h:192
QCString type
member type
Definition entry.h:173
std::vector< Grouping > groups
list of groups this entry belongs to
Definition entry.h:221
CommandOverrides commandOverrides
store info for commands whose default can be overridden
Definition entry.h:190
QCString exception
throw specification
Definition entry.h:214
int startLine
start line of entry in the source
Definition entry.h:224
Entry()
Definition entry.cpp:33
QCString req
C++20 requires clause.
Definition entry.h:234
ArgumentList argList
member arguments as a list
Definition entry.h:194
QCString name
member name
Definition entry.h:174
QCString includeFile
include file (2 arg of \class, must be unique)
Definition entry.h:198
Grouping::GroupPri_t groupingPri() const
Definition entry.h:248
Entry(Entry &&)=delete
int inbodyLine
line number at which the body doc was found
Definition entry.h:207
FileDef * m_fileDef
Definition entry.h:266
EntryType section
entry type (see Sections);
Definition entry.h:172
QCString briefFile
file in which the brief desc. was found
Definition entry.h:205
int bodyLine
line number of the body in the source
Definition entry.h:216
int mGrpId
member group id
Definition entry.h:219
void copyToSubEntry(Entry *e)
Definition entry.cpp:156
std::vector< BaseInfo > extends
list of base classes
Definition entry.h:220
Specifier virt
virtualness of the entry
Definition entry.h:191
std::vector< std::string > qualifiers
qualifiers specified with the qualifier command
Definition entry.h:235
QCString doc
documentation block (partly parsed)
Definition entry.h:200
QCString read
property read accessor
Definition entry.h:211
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
Definition entry.h:226
QCString docFile
file in which the documentation was found
Definition entry.h:202
Protection protection
class protection
Definition entry.h:180
bool artificial
Artificially introduced item.
Definition entry.h:229
bool hidden
does this represent an entity that is hidden from the output
Definition entry.h:228
~Entry()
Definition entry.cpp:121
QCString brief
brief description (doc block)
Definition entry.h:203
int briefLine
line number at which the brief desc. was found
Definition entry.h:204
Entry * m_parent
parent node in the tree
Definition entry.h:264
FileDef * fileDef() const
Definition entry.h:169
int initLines
define/variable initializer lines to show
Definition entry.h:184
bool isStatic
static ?
Definition entry.h:185
int bodyColumn
column of the body in the source
Definition entry.h:217
Entry & operator=(Entry &&)=delete
void reset()
Definition entry.cpp:181
QCString inbodyFile
file in which the body doc was found
Definition entry.h:208
TypeSpecifier spec
class/member specifiers
Definition entry.h:182
QCString inside
name of the class in which documents are found
Definition entry.h:213
void removeSubEntry(const Entry *e)
Definition entry.cpp:170
A model of a file symbol.
Definition filedef.h:99
class that provide information about a section.
Definition section.h:57
#define COMMAND_OVERRIDES
Definition entry.h:37
std::vector< std::shared_ptr< Entry > > EntryList
Definition entry.h:269
std::vector< RefItem * > RefItemVector
Definition reflist.h:133
Protection prot
inheritance type
Definition entry.h:95
BaseInfo(const QCString &n, Protection p, Specifier v)
Definition entry.h:92
Specifier virt
virtualness
Definition entry.h:96
QCString name
the name of the base class
Definition entry.h:94
GroupPri_t
Grouping priority.
Definition types.h:68
@ GROUPING_LOWEST
Definition types.h:69
@ GROUPING_AUTO_ADD
membership in group was defined via @add[to]group
Definition types.h:71
@ GROUPING_AUTO_WEAK
membership in group was defined via @weakgroup
Definition types.h:70
@ GROUPING_AUTO_DEF
membership in group was defined via @defgroup
Definition types.h:72
This struct is used to capture the tag file information for an Entry.
Definition entry.h:103
QCString anchor
Definition entry.h:106
QCString fileName
Definition entry.h:105
QCString tagName
Definition entry.h:104
This file contains a number of basic enums and types.
MethodTypes
Kind of method.
Definition types.h:32
Protection
Protection level of members.
Definition types.h:26
SrcLangExt
Language as given by extension.
Definition types.h:42
RelatesType
Type of member relation.
Definition types.h:35
Specifier
Virtualness of a member.
Definition types.h:29
VhdlSpecifier
Definition types.h:548