Qt 6.x
The Qt SDK
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_PRIVATE_EXPORT IdentifierTable
28{
30
36
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 PropertyKey asPropertyKey(const QString &s);
59 PropertyKey asPropertyKey(const char *s, int len);
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
Definition qset.h:18
bool remove(const T &value)
Definition qset.h:63
iterator insert(const T &value)
Definition qset.h:155
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QHash< int, QWidget * > hash
[35multi]
QString str
[2]
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
GLfloat GLfloat GLfloat GLfloat h
GLenum GLsizei len
GLdouble s
[6]
Definition qopenglext.h:235
unsigned int uint
Definition qtypes.h:29
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