Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qv4objectiterator_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 QV4OBJECTITERATOR_H
4
#define QV4OBJECTITERATOR_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 "
qv4global_p.h
"
18
#include "
qv4object_p.h
"
19
20
QT_BEGIN_NAMESPACE
21
22
namespace
QV4
{
23
24
struct
Q_QML_EXPORT
ObjectIterator
25
{
26
enum
Flags
{
27
NoFlags = 0,
28
EnumerableOnly = 0x1,
29
WithSymbols = 0x2
30
};
31
32
ExecutionEngine
*
engine
;
33
Object
*
object
;
34
OwnPropertyKeyIterator
*iterator =
nullptr
;
35
uint
flags
;
36
37
ObjectIterator
(
Scope
&scope,
const
Object
*
o
,
uint
flags
)
38
{
39
engine
= scope.
engine
;
40
object
=
static_cast<
Object
*
>
(scope.
alloc
());
41
this->flags =
flags
;
42
object
->setM(
o
?
o
->m() :
nullptr
);
43
if
(
o
)
44
iterator =
object
->ownPropertyKeys(
object
);
45
}
46
~ObjectIterator
()
47
{
48
delete
iterator;
49
}
50
51
PropertyKey
next
(
Property
*pd =
nullptr
,
PropertyAttributes
*attributes =
nullptr
);
52
ReturnedValue
nextPropertyName(
Value
*
value
);
53
ReturnedValue
nextPropertyNameAsString(
Value
*
value
);
54
ReturnedValue
nextPropertyNameAsString();
55
};
56
57
namespace
Heap {
58
59
#define ForInIteratorObjectMembers(class, Member) \
60
Member(class, Pointer, Object *, object) \
61
Member(class, Pointer, Object *, current) \
62
Member(class, Pointer, Object *, target) \
63
Member(class, NoMark, OwnPropertyKeyIterator *, iterator)
64
65
DECLARE_HEAP_OBJECT
(
ForInIteratorObject
,
Object
) {
66
void
init
(
QV4::Object
*
o
);
67
Value
workArea[2];
68
69
static
void
markObjects(
Heap::Base
*that,
MarkStack
*markStack);
70
void
destroy();
71
};
72
73
}
74
75
struct
ForInIteratorPrototype
:
Object
76
{
77
V4_PROTOTYPE
(iteratorPrototype)
78
void
init
(
ExecutionEngine
*
engine
);
79
80
static
ReturnedValue
method_next
(
const
FunctionObject
*
b
,
const
Value
*thisObject,
const
Value
*argv,
int
argc);
81
};
82
83
struct
ForInIteratorObject
:
Object
{
84
V4_OBJECT2
(
ForInIteratorObject
,
Object
)
85
Q_MANAGED_TYPE
(ForInIterator)
86
V4_PROTOTYPE
(forInIteratorPrototype)
87
V4_NEEDS_DESTROY
88
89
PropertyKey
nextProperty
()
const
;
90
};
91
92
inline
93
void
Heap::ForInIteratorObject::init(
QV4::Object
*
o
)
94
{
95
Object::init();
96
if
(!
o
)
97
return
;
98
object
.set(
o
->engine(),
o
->d());
99
current.set(
o
->engine(),
o
->d());
100
Scope
scope(
o
);
101
ScopedObject
obj
(scope);
102
iterator =
o
->ownPropertyKeys(
obj
.getRef());
103
target
.set(
o
->engine(),
obj
->d());
104
}
105
106
107
}
108
109
QT_END_NAMESPACE
110
111
#endif
next
short next
Definition
keywords.cpp:445
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
QV4
\qmltype Particle \inqmlmodule QtQuick.Particles
Definition
qquickv4particledata.cpp:234
QV4::ReturnedValue
quint64 ReturnedValue
Definition
qv4staticvalue_p.h:38
value
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Definition
qeglstreamconvenience_p.h:46
b
GLboolean GLboolean GLboolean b
Definition
qopengles2ext.h:337
target
GLenum target
Definition
qopengles2ext.h:751
flags
GLbitfield flags
Definition
qopengles2ext.h:1026
obj
GLhandleARB obj
[2]
Definition
qopenglext.h:4164
init
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
Definition
qtextboundaryfinder.cpp:10
uint
unsigned int uint
Definition
qtypes.h:29
qv4global_p.h
V4_NEEDS_DESTROY
#define V4_NEEDS_DESTROY
Definition
qv4managed_p.h:39
Q_MANAGED_TYPE
#define Q_MANAGED_TYPE(type)
Definition
qv4managed_p.h:64
DECLARE_HEAP_OBJECT
#define DECLARE_HEAP_OBJECT(name, base)
Definition
qv4mmdefs_p.h:313
qv4object_p.h
V4_PROTOTYPE
#define V4_PROTOTYPE(p)
Definition
qv4vtable_p.h:256
V4_OBJECT2
#define V4_OBJECT2(DataClass, superClass)
Definition
qv4vtable_p.h:237
o
TestClass o
Definition
src_concurrent_qtconcurrentrun.cpp:86
engine
QJSEngine engine
[0]
Definition
src_script_qjsvalue.cpp:14
QV4::ExecutionEngine
Definition
qv4engine_p.h:135
QV4::ForInIteratorObject
Definition
qv4objectiterator_p.h:83
QV4::ForInIteratorObject::nextProperty
V4_NEEDS_DESTROY PropertyKey nextProperty() const
Definition
qv4objectiterator.cpp:122
QV4::ForInIteratorPrototype
Definition
qv4objectiterator_p.h:76
QV4::ForInIteratorPrototype::init
void init(ExecutionEngine *engine)
Definition
qv4objectiterator.cpp:11
QV4::ForInIteratorPrototype::method_next
static ReturnedValue method_next(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
Definition
qv4objectiterator.cpp:107
QV4::FunctionObject
Definition
qv4functionobject_p.h:137
QV4::Heap::Base
Definition
qv4heap_p.h:58
QV4::Managed::engine
ExecutionEngine * engine() const
Definition
qv4managed_p.h:131
QV4::MarkStack
Definition
qv4mmdefs_p.h:230
QV4::ObjectIterator
Definition
qv4objectiterator_p.h:25
QV4::ObjectIterator::object
Object * object
Definition
qv4objectiterator_p.h:33
QV4::ObjectIterator::flags
uint flags
Definition
qv4objectiterator_p.h:35
QV4::ObjectIterator::~ObjectIterator
~ObjectIterator()
Definition
qv4objectiterator_p.h:46
QV4::ObjectIterator::engine
ExecutionEngine * engine
Definition
qv4objectiterator_p.h:32
QV4::ObjectIterator::ObjectIterator
ObjectIterator(Scope &scope, const Object *o, uint flags)
Definition
qv4objectiterator_p.h:37
QV4::ObjectIterator::Flags
Flags
Definition
qv4objectiterator_p.h:26
QV4::Object
Definition
qv4object_p.h:104
QV4::OwnPropertyKeyIterator
Definition
qv4vtable_p.h:27
QV4::PropertyAttributes
Definition
qv4global_p.h:193
QV4::PropertyKey
Definition
qv4propertykey_p.h:28
QV4::Property
Definition
qv4property_p.h:26
QV4::Scope
Definition
qv4scopedvalue_p.h:59
QV4::Scope::alloc
Value * alloc(qint64 nValues) const =delete
QV4::Scope::engine
ExecutionEngine * engine
Definition
qv4scopedvalue_p.h:139
QV4::Scoped
Definition
qv4scopedvalue_p.h:266
QV4::Value
Definition
qv4value_p.h:38
qtdeclarative
src
qml
jsruntime
qv4objectiterator_p.h
Generated by
1.9.7