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// own header
19#include "entry.h"
20
21// standard includes
22#include <algorithm>
23#include <atomic>
24
25// other includes
26#include "doxygen.h"
27#include "util.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;
71 argList = e.argList;
77 doc = e.doc;
79 docLine = e.docLine;
80 docFile = e.docFile;
81 brief = e.brief;
87 relates = e.relates;
89 read = e.read;
90 write = e.write;
91 inside = e.inside;
97 mGrpId = e.mGrpId;
98 anchors = e.anchors;
102 sli = e.sli;
103 rqli = e.rqli;
104 lang = e.lang;
105 hidden = e.hidden;
108 id = e.id;
109 extends = e.extends;
110 groups = e.groups;
111 req = e.req;
114
115 m_parent = e.m_parent;
116 // deep copy child entries
117 m_sublist.reserve(e.m_sublist.size());
118 for (const auto &cur : e.m_sublist)
119 {
120 m_sublist.push_back(std::make_shared<Entry>(*cur));
121 }
122}
123
125{
126 //printf("Entry::~Entry(%p) num=%d\n",this,g_num);
127 //printf("Deleting entry %d name %s type %x children %d\n",
128 // num,qPrint(name),section,sublist->count());
129
130 g_num--;
131}
132
134{
135 current->m_parent=this;
136 m_sublist.emplace_back(current);
137 current = new Entry;
138}
139
140void Entry::moveToSubEntryAndRefresh(std::shared_ptr<Entry> &current)
141{
142 current->m_parent=this;
143 m_sublist.push_back(current);
144 current = std::make_shared<Entry>();
145}
146
148{
149 current->m_parent=this;
150 m_sublist.emplace_back(current);
151}
152
153void Entry::moveToSubEntryAndKeep(std::shared_ptr<Entry> current)
154{
155 current->m_parent=this;
156 m_sublist.push_back(current);
157}
158
160{
161 Entry *copy = new Entry(*current);
162 copy->m_parent=this;
163 m_sublist.emplace_back(copy);
164}
165
166void Entry::copyToSubEntry(const std::shared_ptr<Entry> &current)
167{
168 std::shared_ptr<Entry> copy = std::make_shared<Entry>(*current);
169 copy->m_parent=this;
170 m_sublist.push_back(copy);
171}
172
174{
175 auto it = std::find_if(m_sublist.begin(),m_sublist.end(),
176 [e](const std::shared_ptr<Entry>&elem) { return elem.get()==e; });
177 if (it!=m_sublist.end())
178 {
179 m_sublist.erase(it);
180 }
181}
182
183
185{
186 //printf("Entry::reset()\n");
187 name.clear();
188 type.clear();
189 args.clear();
193 program.str(std::string());
196 doc.clear();
197 fieldDocs.clear();
198 docFile.clear();
199 docLine=-1;
200 relates.clear();
201 relatesType=RelatesType::Simple;
202 brief.clear();
204 briefLine=-1;
207 inbodyLine=-1;
208 inside.clear();
209 fileName.clear();
210 initializer.str(std::string());
211 initLines = -1;
212 startLine = 1;
213 startColumn = 1;
214 bodyLine = -1;
215 bodyColumn = 1;
216 endBodyLine = -1;
217 mGrpId = -1;
219 exported = false;
220 section = EntryType::makeEmpty();
221 mtype = MethodTypes::Method;
222 virt = Specifier::Normal;
223 isStatic = false;
224 proto = false;
225 explicitExternal = false;
226 spec.reset();
228 lang = SrcLangExt::Unknown;
229 hidden = false;
230 artificial = false;
231 subGrouping = true;
232 protection = Protection::Public;
234 id.clear();
235 metaData.clear();
236 m_sublist.clear();
237 extends.clear();
238 groups.clear();
239 anchors.clear();
240 argList.reset();
241 tArgLists.clear();
243 sli.clear();
244 rqli.clear();
245 req.clear();
246 m_fileDef = nullptr;
247 qualifiers.clear();
248}
249
251{
252 m_fileDef = fd;
253 for (const auto &childNode : m_sublist)
254 {
255 childNode->setFileDef(fd);
256 }
257}
258
259//------------------------------------------------------------------
void reset()
Definition arguments.h:81
void reset()
Definition entry.h:68
void clear()
Definition dstring.h:214
TextStream initializer
initial value (for variables)
Definition entry.h:205
void moveToSubEntryAndKeep(Entry *e)
Definition entry.cpp:147
VhdlSpecifier vhdlSpec
VHDL specifiers.
Definition entry.h:190
bool subGrouping
automatically group class members?
Definition entry.h:195
RequirementRefs rqli
references to requirements
Definition entry.h:236
void setFileDef(FileDef *fd)
Definition entry.cpp:250
TextStream program
the program text
Definition entry.h:204
bool proto
prototype ?
Definition entry.h:194
std::vector< std::shared_ptr< Entry > > m_sublist
Definition entry.h:275
GroupDocType groupDocType
Definition entry.h:240
int docLine
line number at which the documentation was found
Definition entry.h:210
DString includeName
include name (3 arg of \class)
Definition entry.h:207
DString bitfields
member's bit fields
Definition entry.h:200
ArgumentList typeConstr
where clause (C#) for type constraints
Definition entry.h:224
int endBodyLine
line number where the definition ends
Definition entry.h:227
bool hasTagInfo
is tag info valid
Definition entry.h:182
DString write
property write accessor
Definition entry.h:221
bool exported
is the symbol exported from a C++20 module
Definition entry.h:196
DString includeFile
include file (2 arg of \class, must be unique)
Definition entry.h:206
DString fileName
file this entry was extracted from
Definition entry.h:232
ArgumentLists tArgLists
template argument declarations
Definition entry.h:203
DString docFile
file in which the documentation was found
Definition entry.h:211
LocalToc localToc
Definition entry.h:242
MethodTypes mtype
signal, slot, (dcop) method, or property?
Definition entry.h:188
std::vector< FieldDocumentation > fieldDocs
documentation from \field commands
Definition entry.h:209
@ GROUPDOC_NORMAL
defgroup
Definition entry.h:128
DString args
member argument string
Definition entry.h:199
SrcLangExt lang
programming language in which this entry was found
Definition entry.h:237
TagInfo tagInfoData
tag file info data
Definition entry.h:183
DString inside
name of the class in which documents are found
Definition entry.h:222
DString doc
documentation block (partly parsed)
Definition entry.h:208
DString req
C++20 requires clause.
Definition entry.h:244
bool explicitExternal
explicitly defined as external?
Definition entry.h:193
DString brief
brief description (doc block)
Definition entry.h:212
std::vector< const SectionInfo * > anchors
list of anchors defined in this entry
Definition entry.h:231
void moveToSubEntryAndRefresh(Entry *&e)
Definition entry.cpp:133
RelatesType relatesType
how relates is handled
Definition entry.h:219
std::vector< Grouping > groups
list of groups this entry belongs to
Definition entry.h:230
CommandOverrides commandOverrides
store info for commands whose default can be overridden
Definition entry.h:197
int startLine
start line of entry in the source
Definition entry.h:233
Entry()
Definition entry.cpp:33
size_t startColumn
start column of entry in the source
Definition entry.h:234
ArgumentList argList
member arguments as a list
Definition entry.h:202
DString type
member type
Definition entry.h:180
int inbodyLine
line number at which the body doc was found
Definition entry.h:216
FileDef * m_fileDef
Definition entry.h:276
EntryType section
entry type (see Sections);
Definition entry.h:179
int bodyLine
line number of the body in the source
Definition entry.h:225
DString exception
throw specification
Definition entry.h:223
DString relates
related class (doc block)
Definition entry.h:218
int mGrpId
member group id
Definition entry.h:228
void copyToSubEntry(Entry *e)
Definition entry.cpp:159
std::vector< BaseInfo > extends
list of base classes
Definition entry.h:229
DString inbodyFile
file in which the body doc was found
Definition entry.h:217
DString attributes
member's attributes (e.g. [[nodiscard]])
Definition entry.h:201
Specifier virt
virtualness of the entry
Definition entry.h:198
DString metaData
Slice metadata.
Definition entry.h:243
std::vector< std::string > qualifiers
qualifiers specified with the qualifier command
Definition entry.h:245
DString name
member name
Definition entry.h:181
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
Definition entry.h:235
Protection protection
class protection
Definition entry.h:187
bool artificial
Artificially introduced item.
Definition entry.h:239
bool hidden
does this represent an entity that is hidden from the output
Definition entry.h:238
~Entry()
Definition entry.cpp:124
DString inbodyDocs
documentation inside the body of a function
Definition entry.h:215
int briefLine
line number at which the brief desc. was found
Definition entry.h:213
Entry * m_parent
parent node in the tree
Definition entry.h:274
DString id
libclang id
Definition entry.h:241
int initLines
define/variable initializer lines to show
Definition entry.h:191
bool isStatic
static ?
Definition entry.h:192
void reset()
Definition entry.cpp:184
TypeSpecifier spec
class/member specifiers
Definition entry.h:189
DString briefFile
file in which the brief desc. was found
Definition entry.h:214
DString read
property read accessor
Definition entry.h:220
size_t bodyColumn
column of the body in the source
Definition entry.h:226
void removeSubEntry(const Entry *e)
Definition entry.cpp:173
Wrapper class for the Entry type.
Definition types.h:859
A model of a file symbol.
Definition filedef.h:97
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:232
#define AtomicInt
Definition doxygen.h:30
static AtomicInt g_num
Definition entry.cpp:31
A bunch of utility functions.