Marble

GeoDataSimpleArrayData.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Niko Sams <niko.sams@gmail.com>
4//
5
6#include "GeoDataSimpleArrayData.h"
7
8#include "GeoDataTypes.h"
9#include "MarbleDebug.h"
10
11#include <QVariant>
12
13namespace Marble
14{
15
16class GeoDataSimpleArrayDataPrivate
17{
18public:
19 GeoDataSimpleArrayDataPrivate() = default;
20
21 QList<QVariant> m_values;
22};
23
24GeoDataSimpleArrayData::GeoDataSimpleArrayData()
25 : d(new GeoDataSimpleArrayDataPrivate())
26{
27}
28
29GeoDataSimpleArrayData::GeoDataSimpleArrayData(const GeoDataSimpleArrayData &other)
30 : GeoDataObject(other)
31 , d(new GeoDataSimpleArrayDataPrivate(*other.d))
32{
33}
34
35bool GeoDataSimpleArrayData::operator==(const GeoDataSimpleArrayData &other) const
36{
37 return equals(other) && d->m_values == other.d->m_values;
38}
39
40bool GeoDataSimpleArrayData::operator!=(const GeoDataSimpleArrayData &other) const
41{
42 return !this->operator==(other);
43}
44
45GeoDataSimpleArrayData::~GeoDataSimpleArrayData()
46{
47 delete d;
48}
49
50int GeoDataSimpleArrayData::size() const
51{
52 return d->m_values.size();
53}
54
55QVariant GeoDataSimpleArrayData::valueAt(int index) const
56{
57 return d->m_values.at(index);
58}
59
60QList<QVariant> GeoDataSimpleArrayData::valuesList() const
61{
62 return d->m_values;
63}
64
65void GeoDataSimpleArrayData::append(const QVariant &value)
66{
67 d->m_values.append(value);
68}
69
70const char *GeoDataSimpleArrayData::nodeType() const
71{
72 return GeoDataTypes::GeoDataSimpleArrayDataType;
73}
74
75void GeoDataSimpleArrayData::pack(QDataStream &stream) const
76{
77 GeoDataObject::pack(stream);
78}
79
80void GeoDataSimpleArrayData::unpack(QDataStream &stream)
81{
82 GeoDataObject::unpack(stream);
83}
84
85}
bool equals(const QVariant &lhs, const QVariant &rhs)
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
void append(QList< T > &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.