Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qv4identifiertable_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QV4IDENTIFIERTABLE_H
4#define QV4IDENTIFIERTABLE_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include "qv4identifierhash_p.h"
18#include "qv4string_p.h"
19#include "qv4engine_p.h"
20#include <qset.h>
21#include <limits.h>
22
24
25namespace QV4 {
26
27struct Q_QML_EXPORT IdentifierTable
28{
30
36
37 QSet<IdentifierHashData *> idHashes;
38
39 void addEntry(Heap::StringOrSymbol *str);
40
41public:
42
43 IdentifierTable(ExecutionEngine *engine, int numBits = 8);
45
46 Heap::String *insertString(const QString &s);
47 Heap::Symbol *insertSymbol(const QString &s);
48
50 if (str->identifier.isValid())
51 return str->identifier;
52 return asPropertyKeyImpl(str);
53 }
55 return asPropertyKey(str->d());
56 }
57
58 enum KeyConversionBehavior { Default, ForceConversionToId };
59 PropertyKey asPropertyKey(const QString &s, KeyConversionBehavior conversionBehavior = Default);
60
61 PropertyKey asPropertyKeyImpl(const Heap::String *str);
62
63 Heap::StringOrSymbol *resolveId(PropertyKey i) const;
64 Heap::String *stringForId(PropertyKey i) const;
65 Heap::Symbol *symbolForId(PropertyKey i) const;
66
67 void markObjects(MarkStack *markStack);
68 void sweep();
69
71 idHashes.insert(h);
72 }
74 idHashes.remove(h);
75 }
76
77private:
78 Heap::String *resolveStringEntry(const QString &s, uint hash, uint subtype);
79};
80
81}
82
84
85#endif
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QHash< int, QWidget * > hash
[35multi]
QString str
[2]
Combined button and popup list for selecting options.
GLfloat GLfloat GLfloat GLfloat h
GLdouble s
[6]
Definition qopenglext.h:235
static QT_BEGIN_NAMESPACE const uint Default
Definition qsplitter_p.h:27
unsigned int uint
Definition qtypes.h:34
QJSEngine engine
[0]
PropertyKey asPropertyKey(const QV4::String *str)
void removeIdentifierHash(IdentifierHashData *h)
PropertyKey asPropertyKey(const Heap::String *str)
Heap::StringOrSymbol ** entriesById
void addIdentifierHash(IdentifierHashData *h)
QSet< IdentifierHashData * > idHashes
Heap::StringOrSymbol ** entriesByHash