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

marble

  • sources
  • kde-4.12
  • 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 GeoDataData::GeoDataData( const QString &name, const QVariant &value )
44  : d( new GeoDataDataPrivate )
45 {
46  d->m_name = name;
47  d->m_value = value;
48 }
49 
50 const char* GeoDataData::nodeType() const
51 {
52  return d->nodeType();
53 }
54 
55 QVariant GeoDataData::value() const
56 {
57  return d->m_value;
58 }
59 
60 void GeoDataData::setValue( const QVariant& value )
61 {
62  d->m_value = value;
63 }
64 
65 QString GeoDataData::name() const
66 {
67  return d->m_name;
68 }
69 
70 void GeoDataData::setName( const QString& name )
71 {
72  d->m_name = name;
73 }
74 
75 QString GeoDataData::displayName() const
76 {
77  return d->m_displayName;
78 }
79 
80 void GeoDataData::setDisplayName( const QString& displayName )
81 {
82  d->m_displayName = displayName;
83 }
84 
85 void GeoDataData::pack( QDataStream& stream ) const
86 {
87  GeoDataObject::pack( stream );
88 
89  stream << d->m_value;
90  stream << d->m_displayName;
91 }
92 
93 void GeoDataData::unpack( QDataStream& stream )
94 {
95  GeoDataObject::unpack( stream );
96 
97  stream >> d->m_value;
98  stream >> d->m_displayName;
99 }
100 
101 }
Marble::GeoDataData::GeoDataData
GeoDataData()
Definition: GeoDataData.cpp:21
Marble::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
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:85
Marble::GeoDataData::setValue
void setValue(const QVariant &value)
set the value of data
Definition: GeoDataData.cpp:60
Marble::GeoDataData::setDisplayName
void setDisplayName(const QString &displayName)
set the displayName of data
Definition: GeoDataData.cpp:80
Marble::GeoDataData::displayName
QString displayName() const
return the displayName of data
Definition: GeoDataData.cpp:75
Marble::GeoDataDataPrivate::m_displayName
QString m_displayName
Definition: GeoDataData_p.h:32
Marble::GeoDataDataPrivate
Definition: GeoDataData_p.h:22
GeoDataData_p.h
Marble::GeoDataData::unpack
virtual void unpack(QDataStream &stream)
Unserialize the contents of the feature from stream.
Definition: GeoDataData.cpp:93
Marble::GeoDataData::value
QVariant value() const
return the value of data
Definition: GeoDataData.cpp:55
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::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:70
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:65
Marble::GeoDataData::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataData.cpp:50
Marble::GeoDataData::~GeoDataData
virtual ~GeoDataData()
Definition: GeoDataData.cpp:31
GeoDataTypes.h
Marble::GeoDataDataPrivate::m_name
QString m_name
Definition: GeoDataData_p.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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