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#ifndef QV4SETITERATOR_P_H
5#define QV4SETITERATOR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qv4object_p.h"
19#include "qv4iterator_p.h"
20
21QT_BEGIN_NAMESPACE
22
23namespace QV4 {
24
25namespace Heap {
26
27#define SetIteratorObjectMembers(class, Member) \
28 Member(class, Pointer, Object *, iteratedSet) \
29 Member(class, NoMark, IteratorKind, iterationKind) \
30 Member(class, NoMark, quint32, setNextIndex)
31
32DECLARE_HEAP_OBJECT(SetIteratorObject, Object) {
33 DECLARE_MARKOBJECTS(SetIteratorObject)
34 void init(Object *obj, QV4::ExecutionEngine *engine)
35 {
36 Object::init();
37 this->iteratedSet.set(e: engine, newVal: obj);
38 this->setNextIndex = 0;
39 }
40};
41
42}
43
44struct SetIteratorPrototype : Object
45{
46 V4_PROTOTYPE(iteratorPrototype)
47 void init(ExecutionEngine *engine);
48
49 static ReturnedValue method_next(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc);
50};
51
52struct SetIteratorObject : Object
53{
54 V4_OBJECT2(SetIteratorObject, Object)
55 Q_MANAGED_TYPE(SetIteratorObject)
56 V4_PROTOTYPE(setIteratorPrototype)
57
58 void init(ExecutionEngine *engine);
59};
60
61
62}
63
64QT_END_NAMESPACE
65
66#endif // QV4SETITERATOR_P_H
67
68

source code of qtdeclarative/src/qml/jsruntime/qv4setiterator_p.h