1 | // Copyright (C) 2018 Crimson AS <info@crimson.no> |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | // |
5 | // W A R N I N G |
6 | // ------------- |
7 | // |
8 | // This file is not part of the Qt API. It exists purely as an |
9 | // implementation detail. This header file may change from version to |
10 | // version without notice, or even be removed. |
11 | // |
12 | // We mean it. |
13 | // |
14 | |
15 | #ifndef QV4ESTABLE_P_H |
16 | #define QV4ESTABLE_P_H |
17 | |
18 | #include "qv4value_p.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | namespace QV4 |
23 | { |
24 | |
25 | class ESTable |
26 | { |
27 | public: |
28 | ESTable(); |
29 | ~ESTable(); |
30 | |
31 | void markObjects(MarkStack *s, bool isWeakMap); |
32 | void clear(); |
33 | void set(const Value &k, const Value &v); |
34 | bool has(const Value &k) const; |
35 | ReturnedValue get(const Value &k, bool *hasValue = nullptr) const; |
36 | bool remove(const Value &k); |
37 | uint size() const; |
38 | void iterate(uint idx, Value *k, Value *v); |
39 | |
40 | void removeUnmarkedKeys(); |
41 | |
42 | private: |
43 | Value *m_keys = nullptr; |
44 | Value *m_values = nullptr; |
45 | uint m_size = 0; |
46 | uint m_capacity = 0; |
47 | }; |
48 | |
49 | } |
50 | |
51 | QT_END_NAMESPACE |
52 | |
53 | #endif |
54 | |