• 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
  • plugins
  • render
  • weather
BBCStation.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 2009 Bastian Holst <bastianholst@gmx.de>
9 //
10 
11 // Self
12 #include "BBCStation.h"
13 
14 // Marble
15 #include "GeoDataCoordinates.h"
16 
17 // Qt
18 #include <QAtomicInt>
19 #include <QString>
20 
21 namespace Marble
22 {
23 
24 class BBCStationPrivate
25 {
26  public:
27  BBCStationPrivate()
28  : m_bbcId( 0 ),
29  m_priority( 0 ),
30  ref( 1 )
31  {
32  }
33 
34  BBCStationPrivate( const BBCStationPrivate &other )
35  : m_name( other.m_name ),
36  m_coordinate( other.m_coordinate ),
37  m_bbcId( other.m_bbcId ),
38  m_priority( other.m_priority ),
39  ref( other.ref )
40  {
41  }
42 
43  BBCStationPrivate& operator=( const BBCStationPrivate &other )
44  {
45  m_name = other.m_name;
46  m_coordinate = other.m_coordinate;
47  m_bbcId = other.m_bbcId;
48  m_priority = other.m_priority;
49  ref = other.ref;
50  return *this;
51  }
52 
53  QString m_name;
54  GeoDataCoordinates m_coordinate;
55  quint32 m_bbcId;
56  quint8 m_priority;
57 
58  QAtomicInt ref;
59 };
60 
61 BBCStation::BBCStation()
62  : d ( new BBCStationPrivate() )
63 {
64 }
65 
66 BBCStation::BBCStation( const BBCStation& other )
67  : d( other.d )
68 {
69  d->ref.ref();
70 }
71 
72 BBCStation::~BBCStation()
73 {
74  if ( !d->ref.deref() )
75  delete d;
76 }
77 
78 void BBCStation::detach()
79 {
80  qAtomicDetach( d );
81 }
82 
83 BBCStation& BBCStation::operator=( const BBCStation &other )
84 {
85  qAtomicAssign( d, other.d );
86  return *this;
87 }
88 
89 bool BBCStation::operator<( const BBCStation& other ) const
90 {
91  return priority() > other.priority();
92 }
93 
94 QString BBCStation::name() const
95 {
96  return d->m_name;
97 }
98 
99 void BBCStation::setName( const QString& name )
100 {
101  detach();
102  d->m_name = name;
103 }
104 
105 GeoDataCoordinates BBCStation::coordinate() const
106 {
107  return d->m_coordinate;
108 }
109 
110 void BBCStation::setCoordinate( const GeoDataCoordinates& coordinate )
111 {
112  detach();
113  d->m_coordinate = coordinate;
114 }
115 
116 quint32 BBCStation::bbcId() const
117 {
118  return d->m_bbcId;
119 }
120 
121 void BBCStation::setBbcId( quint32 id )
122 {
123  detach();
124  d->m_bbcId = id;
125 }
126 
127 quint8 BBCStation::priority() const
128 {
129  return d->m_priority;
130 }
131 
132 void BBCStation::setPriority( quint8 priority )
133 {
134  detach();
135  d->m_priority = priority;
136 }
137 
138 } // namespace Marble
GeoDataCoordinates.h
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::BBCStation::setCoordinate
void setCoordinate(const GeoDataCoordinates &coordinate)
Definition: BBCStation.cpp:110
Marble::BBCStation::name
QString name() const
Definition: BBCStation.cpp:94
Marble::BBCStation::setName
void setName(const QString &name)
Definition: BBCStation.cpp:99
Marble::BBCStation::BBCStation
BBCStation()
Definition: BBCStation.cpp:61
Marble::BBCStation::~BBCStation
~BBCStation()
Definition: BBCStation.cpp:72
BBCStation.h
Marble::BBCStation::operator=
BBCStation & operator=(const BBCStation &other)
Definition: BBCStation.cpp:83
Marble::BBCStation::coordinate
GeoDataCoordinates coordinate() const
Definition: BBCStation.cpp:105
Marble::BBCStation::bbcId
quint32 bbcId() const
Definition: BBCStation.cpp:116
Marble::BBCStation::setPriority
void setPriority(quint8 priority)
Definition: BBCStation.cpp:132
Marble::BBCStation::setBbcId
void setBbcId(quint32 id)
Definition: BBCStation.cpp:121
QAtomicInt
QString
Marble::BBCStation
Definition: BBCStation.h:24
Marble::BBCStation::priority
quint8 priority() const
Definition: BBCStation.cpp:127
Marble::BBCStation::detach
void detach()
Definition: BBCStation.cpp:78
Marble::BBCStation::operator<
bool operator<(const BBCStation &other) const
Definition: BBCStation.cpp:89
coordinate
Coordinate coordinate
Definition: tools/osm-addresses/OsmParser.cpp:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 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