• 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
GeoDataData.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 2010 Harshit Jain <hjain.itbhu@gmail.com>
9 //
10 
11 #include "GeoDataData.h"
12 #include "GeoDataData_p.h"
13 
14 #include <QDataStream>
15 
16 #include "GeoDataTypes.h"
17 
18 namespace Marble
19 {
20 
21 GeoDataData::GeoDataData()
22  : GeoDataObject(), d( new GeoDataDataPrivate )
23 {
24 }
25 
26 GeoDataData::GeoDataData( const GeoDataData& other )
27  : GeoDataObject( other ), d( new GeoDataDataPrivate( *other.d ) )
28 {
29 }
30 
31 GeoDataData::~GeoDataData()
32 {
33  delete d;
34 }
35 
36 GeoDataData& GeoDataData::operator=( const GeoDataData& other )
37 {
38  GeoDataObject::operator=( other );
39  *d = *other.d;
40  return *this;
41 }
42 
43 bool GeoDataData::operator==( const GeoDataData& other) const
44 {
45  return equals(other) &&
46  d->m_name == other.d->m_name &&
47  d->m_value == other.d->m_value &&
48  d->m_displayName == other.d->m_displayName;
49 }
50 
51 bool GeoDataData::operator!=( const GeoDataData &other ) const
52 {
53  return !this->operator==(other);
54 }
55 
56 GeoDataData::GeoDataData( const QString &name, const QVariant &value )
57  : d( new GeoDataDataPrivate )
58 {
59  d->m_name = name;
60  d->m_value = value;
61 }
62 
63 const char* GeoDataData::nodeType() const
64 {
65  return d->nodeType();
66 }
67 
68 QVariant GeoDataData::value() const
69 {
70  return d->m_value;
71 }
72 
73 void GeoDataData::setValue( const QVariant& value )
74 {
75  d->m_value = value;
76 }
77 
78 QString GeoDataData::name() const
79 {
80  return d->m_name;
81 }
82 
83 void GeoDataData::setName( const QString& name )
84 {
85  d->m_name = name;
86 }
87 
88 QString GeoDataData::displayName() const
89 {
90  return d->m_displayName;
91 }
92 
93 void GeoDataData::setDisplayName( const QString& displayName )
94 {
95  d->m_displayName = displayName;
96 }
97 
98 void GeoDataData::pack( QDataStream& stream ) const
99 {
100  GeoDataObject::pack( stream );
101 
102  stream << d->m_value;
103  stream << d->m_displayName;
104 }
105 
106 void GeoDataData::unpack( QDataStream& stream )
107 {
108  GeoDataObject::unpack( stream );
109 
110  stream >> d->m_value;
111  stream >> d->m_displayName;
112 }
113 
114 }
Marble::GeoDataData::GeoDataData
GeoDataData()
Definition: GeoDataData.cpp:21
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::GeoDataData::pack
virtual void pack(QDataStream &stream) const
Serialize the contents of the feature to stream.
Definition: GeoDataData.cpp:98
Marble::GeoDataData::operator!=
bool operator!=(const GeoDataData &other) const
Definition: GeoDataData.cpp:51
Marble::GeoDataData::setValue
void setValue(const QVariant &value)
set the value of data
Definition: GeoDataData.cpp:73
Marble::GeoDataData::setDisplayName
void setDisplayName(const QString &displayName)
set the displayName of data
Definition: GeoDataData.cpp:93
Marble::GeoDataData::displayName
QString displayName() const
return the displayName of data
Definition: GeoDataData.cpp:88
Marble::GeoDataDataPrivate::m_displayName
QString m_displayName
Definition: GeoDataData_p.h:32
Marble::GeoDataDataPrivate
Definition: GeoDataData_p.h:22
GeoDataData_p.h
QString
Marble::GeoDataData::unpack
virtual void unpack(QDataStream &stream)
Unserialize the contents of the feature from stream.
Definition: GeoDataData.cpp:106
Marble::GeoDataData::value
QVariant value() const
return the value of data
Definition: GeoDataData.cpp:68
Marble::GeoDataDataPrivate::m_value
QVariant m_value
Definition: GeoDataData_p.h:30
Marble::GeoDataDataPrivate::nodeType
const char * nodeType() const
Definition: GeoDataData_p.h:25
Marble::GeoDataData
Definition: GeoDataData.h:26
GeoDataData.h
Marble::GeoDataObject::operator=
GeoDataObject & operator=(const GeoDataObject &)
Definition: GeoDataObject.cpp:54
Marble::GeoDataData::operator==
bool operator==(const GeoDataData &other) const
Definition: GeoDataData.cpp:43
Marble::GeoDataObject::unpack
virtual void unpack(QDataStream &steam)
Reimplemented from Serializable.
Definition: GeoDataObject.cpp:120
Marble::GeoDataData::setName
void setName(const QString &name)
set the name of data
Definition: GeoDataData.cpp:83
Marble::GeoDataData::operator=
GeoDataData & operator=(const GeoDataData &other)
assignment operator
Definition: GeoDataData.cpp:36
Marble::GeoDataData::name
QString name() const
return the name of data
Definition: GeoDataData.cpp:78
Marble::GeoDataData::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataData.cpp:63
Marble::GeoDataData::~GeoDataData
virtual ~GeoDataData()
Definition: GeoDataData.cpp:31
GeoDataTypes.h
Marble::GeoDataDataPrivate::m_name
QString m_name
Definition: GeoDataData_p.h:31
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