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