Doxygen
Loading...
Searching...
No Matches
entry.cpp
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#include <algorithm>
19#include <atomic>
20#include <stdlib.h>
21
22#include "entry.h"
23#include "util.h"
24#include "section.h"
25#include "doxygen.h"
26#include "arguments.h"
27#include "config.h"
28
29//------------------------------------------------------------------
30
32
33Entry::Entry() : section(EntryType::makeEmpty()), program(static_cast<size_t>(0)), initializer(static_cast<size_t>(0))
34{
35 //printf("Entry::Entry(%p)\n",this);
36 g_num++;
37 m_parent=nullptr;
38 //printf("Entry::Entry() tArgList=0\n");
39 mGrpId = -1;
40 hasTagInfo = false;
41 relatesType = RelatesType::Simple;
42 hidden = FALSE;
44 reset();
45}
46
48{
49 //printf("Entry::Entry(%p):copy\n",this);
50 g_num++;
51 type = e.type;
52 name = e.name;
56 mtype = e.mtype;
57 spec = e.spec;
63 proto = e.proto;
67 virt = e.virt;
68 args = e.args;
70 argList = e.argList;
72 program.str(e.program.str());
76 doc = e.doc;
77 docLine = e.docLine;
78 docFile = e.docFile;
79 brief = e.brief;
85 relates = e.relates;
87 read = e.read;
88 write = e.write;
89 inside = e.inside;
95 mGrpId = e.mGrpId;
96 anchors = e.anchors;
100 sli = e.sli;
101 rqli = e.rqli;
102 lang = e.lang;
103 hidden = e.hidden;
106 id = e.id;
107 extends = e.extends;
108 groups = e.groups;
109 req = e.req;
112
113 m_parent = e.m_parent;
114 // deep copy child entries
115 m_sublist.reserve(e.m_sublist.size());
116 for (const auto &cur : e.m_sublist)
117 {
118 m_sublist.push_back(std::make_shared<Entry>(*cur));
119 }
120}
121
123{
124 //printf("Entry::~Entry(%p) num=%d\n",this,g_num);
125 //printf("Deleting entry %d name %s type %x children %d\n",
126 // num,qPrint(name),section,sublist->count());
127
128 g_num--;
129}
130
132{
133 current->m_parent=this;
134 m_sublist.emplace_back(current);
135 current = new Entry;
136}
137
138void Entry::moveToSubEntryAndRefresh(std::shared_ptr<Entry> &current)
139{
140 current->m_parent=this;
141 m_sublist.push_back(current);
142 current = std::make_shared<Entry>();
143}
144
146{
147 current->m_parent=this;
148 m_sublist.emplace_back(current);
149}
150
151void Entry::moveToSubEntryAndKeep(std::shared_ptr<Entry> current)
152{
153 current->m_parent=this;
154 m_sublist.push_back(current);
155}
156
158{
159 Entry *copy = new Entry(*current);
160 copy->m_parent=this;
161 m_sublist.emplace_back(copy);
162}
163
164void Entry::copyToSubEntry(const std::shared_ptr<Entry> &current)
165{
166 std::shared_ptr<Entry> copy = std::make_shared<Entry>(*current);
167 copy->m_parent=this;
168 m_sublist.push_back(copy);
169}
170
172{
173 auto it = std::find_if(m_sublist.begin(),m_sublist.end(),
174 [e](const std::shared_ptr<Entry>&elem) { return elem.get()==e; });
175 if (it!=m_sublist.end())
176 {
177 m_sublist.erase(it);
178 }
179}
180
181
183{
184 //printf("Entry::reset()\n");
185 name.clear();
186 type.clear();
187 args.clear();
188 bitfields.clear();
189 exception.clear();
190 program.str(std::string());
191 includeFile.clear();
192 includeName.clear();
193 doc.clear();
194 docFile.clear();
195 docLine=-1;
196 relates.clear();
197 relatesType=RelatesType::Simple;
198 brief.clear();
199 briefFile.clear();
200 briefLine=-1;
201 inbodyDocs.clear();
202 inbodyFile.clear();
203 inbodyLine=-1;
204 inside.clear();
205 fileName.clear();
206 initializer.str(std::string());
207 initLines = -1;
208 startLine = 1;
209 startColumn = 1;
210 bodyLine = -1;
211 bodyColumn = 1;
212 endBodyLine = -1;
213 mGrpId = -1;
214 commandOverrides.reset();
215 exported = false;
216 section = EntryType::makeEmpty();
217 mtype = MethodTypes::Method;
218 virt = Specifier::Normal;
219 isStatic = false;
220 proto = false;
221 explicitExternal = false;
222 spec.reset();
224 lang = SrcLangExt::Unknown;
225 hidden = false;
226 artificial = false;
227 subGrouping = true;
228 protection = Protection::Public;
230 id.clear();
231 metaData.clear();
232 m_sublist.clear();
233 extends.clear();
234 groups.clear();
235 anchors.clear();
236 argList.reset();
237 tArgLists.clear();
238 typeConstr.reset();
239 sli.clear();
240 rqli.clear();
241 req.clear();
242 m_fileDef = nullptr;
243 qualifiers.clear();
244}
245
247{
248 m_fileDef = fd;
249 for (const auto &childNode : m_sublist)
250 {
251 childNode->setFileDef(fd);
252 }
253}
254
255//------------------------------------------------------------------
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
void setFileDef(FileDef *fd)
Definition entry.cpp:246
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
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
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
@ GROUPDOC_NORMAL
defgroup
Definition entry.h:122
SrcLangExt lang
programming language in which this entry was found
Definition entry.h:229
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
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
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
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
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:216
#define AtomicInt
Definition doxygen.h:31
static AtomicInt g_num
Definition entry.cpp:31
#define FALSE
Definition qcstring.h:34
A bunch of utility functions.