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;
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 lang = e.lang;
102 hidden = e.hidden;
105 id = e.id;
106 extends = e.extends;
107 groups = e.groups;
108 req = e.req;
111
112 m_parent = e.m_parent;
113 // deep copy child entries
114 m_sublist.reserve(e.m_sublist.size());
115 for (const auto &cur : e.m_sublist)
116 {
117 m_sublist.push_back(std::make_shared<Entry>(*cur));
118 }
119}
120
122{
123 //printf("Entry::~Entry(%p) num=%d\n",this,g_num);
124 //printf("Deleting entry %d name %s type %x children %d\n",
125 // num,qPrint(name),section,sublist->count());
126
127 g_num--;
128}
129
131{
132 current->m_parent=this;
133 m_sublist.emplace_back(current);
134 current = new Entry;
135}
136
137void Entry::moveToSubEntryAndRefresh(std::shared_ptr<Entry> &current)
138{
139 current->m_parent=this;
140 m_sublist.push_back(current);
141 current = std::make_shared<Entry>();
142}
143
145{
146 current->m_parent=this;
147 m_sublist.emplace_back(current);
148}
149
150void Entry::moveToSubEntryAndKeep(std::shared_ptr<Entry> current)
151{
152 current->m_parent=this;
153 m_sublist.push_back(current);
154}
155
157{
158 Entry *copy = new Entry(*current);
159 copy->m_parent=this;
160 m_sublist.emplace_back(copy);
161}
162
163void Entry::copyToSubEntry(const std::shared_ptr<Entry> &current)
164{
165 std::shared_ptr<Entry> copy = std::make_shared<Entry>(*current);
166 copy->m_parent=this;
167 m_sublist.push_back(copy);
168}
169
171{
172 auto it = std::find_if(m_sublist.begin(),m_sublist.end(),
173 [e](const std::shared_ptr<Entry>&elem) { return elem.get()==e; });
174 if (it!=m_sublist.end())
175 {
176 m_sublist.erase(it);
177 }
178}
179
180
182{
183 //printf("Entry::reset()\n");
184 name.clear();
185 type.clear();
186 args.clear();
187 bitfields.clear();
188 exception.clear();
189 program.str(std::string());
190 includeFile.clear();
191 includeName.clear();
192 doc.clear();
193 docFile.clear();
194 docLine=-1;
195 relates.clear();
197 brief.clear();
198 briefFile.clear();
199 briefLine=-1;
200 inbodyDocs.clear();
201 inbodyFile.clear();
202 inbodyLine=-1;
203 inside.clear();
204 fileName.clear();
205 initializer.str(std::string());
206 initLines = -1;
207 startLine = 1;
208 startColumn = 1;
209 bodyLine = -1;
210 bodyColumn = 1;
211 endBodyLine = -1;
212 mGrpId = -1;
213 commandOverrides.reset();
214 exported = false;
215 section = EntryType::makeEmpty();
218 isStatic = false;
219 proto = false;
220 explicitExternal = false;
221 spec.reset();
224 hidden = false;
225 artificial = false;
226 subGrouping = true;
229 id.clear();
230 metaData.clear();
231 m_sublist.clear();
232 extends.clear();
233 groups.clear();
234 anchors.clear();
235 argList.reset();
236 tArgLists.clear();
237 typeConstr.reset();
238 sli.clear();
239 req.clear();
240 m_fileDef = nullptr;
241 qualifiers.clear();
242}
243
245{
246 m_fileDef = fd;
247 for (const auto &childNode : m_sublist)
248 {
249 childNode->setFileDef(fd);
250 }
251}
252
253//------------------------------------------------------------------
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
void setFileDef(FileDef *fd)
Definition entry.cpp:244
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
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
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
@ GROUPDOC_NORMAL
defgroup
Definition entry.h:121
SrcLangExt lang
programming language in which this entry was found
Definition entry.h:227
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
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
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
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
Wrapper class for the Entry type.
Definition types.h:631
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:229
#define AtomicInt
Definition doxygen.h:31
static AtomicInt g_num
Definition entry.cpp:31
#define FALSE
Definition qcstring.h:34
@ Public
Definition types.h:26
@ Unknown
Definition types.h:43
@ Normal
Definition types.h:29
A bunch of utility functions.