• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataSimpleArrayData.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2011 Niko Sams <niko.sams@gmail.com>
9 //
10 
11 #include "GeoDataSimpleArrayData.h"
12 
13 #include "GeoDataTypes.h"
14 #include "MarbleDebug.h"
15 
16 #include <QMap>
17 #include <QLinkedList>
18 
19 namespace Marble {
20 
21 class GeoDataSimpleArrayDataPrivate
22 {
23 public:
24  GeoDataSimpleArrayDataPrivate()
25  {
26  }
27 
28  QList< QVariant > m_values;
29 };
30 
31 GeoDataSimpleArrayData::GeoDataSimpleArrayData()
32  : d( new GeoDataSimpleArrayDataPrivate() )
33 {
34 }
35 
36 GeoDataSimpleArrayData::GeoDataSimpleArrayData( const GeoDataSimpleArrayData& other )
37  : GeoDataObject( other ), d( new GeoDataSimpleArrayDataPrivate( *other.d ) )
38 {
39 }
40 
41 bool GeoDataSimpleArrayData::operator==( const GeoDataSimpleArrayData &other ) const
42 {
43  return equals(other) && d->m_values == other.d->m_values;
44 }
45 
46 bool GeoDataSimpleArrayData::operator!=( const GeoDataSimpleArrayData &other ) const
47 {
48  return !this->operator==(other);
49 }
50 
51 GeoDataSimpleArrayData::~GeoDataSimpleArrayData()
52 {
53  delete d;
54 }
55 
56 int GeoDataSimpleArrayData::size() const
57 {
58  return d->m_values.size();
59 }
60 
61 QVariant GeoDataSimpleArrayData::valueAt(int index) const
62 {
63  return d->m_values.at( index );
64 }
65 
66 QList< QVariant > GeoDataSimpleArrayData::valuesList() const
67 {
68  return d->m_values;
69 }
70 
71 void GeoDataSimpleArrayData::append( const QVariant& value )
72 {
73  d->m_values.append( value );
74 }
75 
76 
77 const char* GeoDataSimpleArrayData::nodeType() const
78 {
79  return GeoDataTypes::GeoDataSimpleArrayDataType;
80 }
81 
82 void GeoDataSimpleArrayData::pack( QDataStream& stream ) const
83 {
84  GeoDataObject::pack( stream );
85 }
86 
87 void GeoDataSimpleArrayData::unpack( QDataStream& stream )
88 {
89  GeoDataObject::unpack( stream );
90 }
91 
92 }
Marble::GeoDataSimpleArrayData::~GeoDataSimpleArrayData
~GeoDataSimpleArrayData()
Definition: GeoDataSimpleArrayData.cpp:51
QDataStream
Marble::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
Marble::GeoDataObject::equals
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
Definition: GeoDataObject.cpp:126
Marble::GeoDataObject::pack
virtual void pack(QDataStream &stream) const
Reimplemented from Serializable.
Definition: GeoDataObject.cpp:114
Marble::GeoDataSimpleArrayData::operator==
bool operator==(const GeoDataSimpleArrayData &other) const
Definition: GeoDataSimpleArrayData.cpp:41
MarbleDebug.h
Marble::GeoDataSimpleArrayData::pack
virtual void pack(QDataStream &stream) const
Reimplemented from Serializable.
Definition: GeoDataSimpleArrayData.cpp:82
Marble::GeoDataSimpleArrayData::append
void append(const QVariant &value)
Append a value to the array.
Definition: GeoDataSimpleArrayData.cpp:71
Marble::GeoDataSimpleArrayData
Definition: GeoDataSimpleArrayData.h:22
QList< QVariant >
Marble::GeoDataSimpleArrayData::GeoDataSimpleArrayData
GeoDataSimpleArrayData()
Definition: GeoDataSimpleArrayData.cpp:31
Marble::GeoDataSimpleArrayData::unpack
virtual void unpack(QDataStream &stream)
Reimplemented from Serializable.
Definition: GeoDataSimpleArrayData.cpp:87
GeoDataSimpleArrayData.h
Marble::GeoDataSimpleArrayData::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataSimpleArrayData.cpp:77
Marble::GeoDataSimpleArrayData::size
int size() const
Returns the number of value in the array.
Definition: GeoDataSimpleArrayData.cpp:56
Marble::GeoDataObject::unpack
virtual void unpack(QDataStream &steam)
Reimplemented from Serializable.
Definition: GeoDataObject.cpp:120
Marble::GeoDataSimpleArrayData::valuesList
QList< QVariant > valuesList() const
Returns all values in the array.
Definition: GeoDataSimpleArrayData.cpp:66
GeoDataTypes.h
Marble::GeoDataSimpleArrayData::valueAt
QVariant valueAt(int index) const
Returns the value at index index.
Definition: GeoDataSimpleArrayData.cpp:61
Marble::GeoDataSimpleArrayData::operator!=
bool operator!=(const GeoDataSimpleArrayData &other) const
Definition: GeoDataSimpleArrayData.cpp:46
Marble::GeoDataTypes::GeoDataSimpleArrayDataType
const char * GeoDataSimpleArrayDataType
Definition: GeoDataTypes.cpp:75
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal