1// Copyright (C) 2024 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
4#include <QtProtobuf/qprotobufmessage.h>
5#include <QtProtobuf/qprotobufregistration.h>
6#include <QtProtobuf/qprotobufrepeatediterator.h>
7
8/*!
9 \class QProtobufRepeatedIterator
10 \inmodule QtProtobuf
11 \since 6.8
12
13 \brief Allows iterating over repeated protobuf types.
14
15 Allows iterating over repeated protobuf types and access the repeated field elements as
16 reference to QProtobufMessage.
17*/
18
19/*!
20 \fn QProtobufRepeatedIterator::~QProtobufRepeatedIterator()
21 Destroys iterator.
22*/
23
24/*!
25 \fn QProtobufRepeatedIterator::QProtobufRepeatedIterator(QProtobufRepeatedIterator &&other) noexcept
26
27 Move-constructs a new QProtobufRepeatedIterator from \a other.
28*/
29
30/*!
31 \fn QProtobufRepeatedIterator &QProtobufRepeatedIterator::operator=(QProtobufRepeatedIterator &&other) noexcept
32
33 Move-assigns \a other to this QProtobufRepeatedIterator and returns a reference to
34 the updated object.
35*/
36
37/*!
38 \fn bool QProtobufRepeatedIterator::isValid() const noexcept
39
40 Returns \c true if the iterator points to a valid data object.
41*/
42
43/*!
44 \fn bool QProtobufRepeatedIterator::hasNext() const noexcept
45
46 Returns \c true if the iterator can read the next element from the repeated field.
47*/
48
49/*!
50 \fn QProtobufMessage *QProtobufRepeatedIterator::next()
51
52 Returns the next element under from the repeated field.
53*/
54
55/*!
56 \fn QProtobufMessage *QProtobufRepeatedIterator::addNext()
57
58 Returns a new temporary element in the repeated field.
59*/
60
61/*!
62 \fn void QProtobufRepeatedIterator::push()
63
64 Adds the element, created by addNext function, to the repeated field.
65*/
66
67/*!
68 \fn template<typename T> static QProtobufRepeatedIterator fromList(QList<T> &list)
69
70 Creates a QProtobufRepeatedIterator instance from a \a list.
71*/
72
73/*!
74 \fn template<typename K, typename V> static QProtobufRepeatedIterator fromHash(QHash<K, V> &hash)
75
76 Creates a QProtobufRepeatedIterator instance from a \a hash.
77*/
78

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtgrpc/src/protobuf/qprotobufrepeatediterator.cpp