• 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
GeoDataTimeSpan.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 // Own
12 #include "GeoDataTimeSpan.h"
13 
14 // Private
15 #include "GeoDataTimeSpan_p.h"
16 
17 // Qt
18 #include <QDataStream>
19 
20 // GeoData
21 #include "GeoDataTypes.h"
22 #include "MarbleDebug.h"
23 
24 namespace Marble
25 {
26 
27 GeoDataTimeSpan::GeoDataTimeSpan()
28  : GeoDataTimePrimitive(), d( new GeoDataTimeSpanPrivate )
29 {
30 }
31 
32 GeoDataTimeSpan::GeoDataTimeSpan( const GeoDataTimeSpan& other )
33  : GeoDataTimePrimitive( other ), d( new GeoDataTimeSpanPrivate( *other.d ) )
34 {
35 }
36 
37 GeoDataTimeSpan::~GeoDataTimeSpan()
38 {
39  delete d;
40 }
41 
42 const char* GeoDataTimeSpan::nodeType() const
43 {
44  return d->nodeType();
45 }
46 
47 QDateTime GeoDataTimeSpan::end() const
48 {
49  return d->m_end;
50 }
51 
52 void GeoDataTimeSpan::setEnd( const QDateTime& end )
53 {
54  d->m_end = end;
55 }
56 
57 QDateTime GeoDataTimeSpan::begin() const
58 {
59  return d->m_begin;
60 }
61 
62 void GeoDataTimeSpan::setBegin( const QDateTime& begin )
63 {
64  d->m_begin = begin;
65 }
66 
67 GeoDataTimeSpan& GeoDataTimeSpan::operator=( const GeoDataTimeSpan& other )
68 {
69  GeoDataTimePrimitive::operator=( other );
70  *d = *other.d;
71  return *this;
72 }
73 
74 void GeoDataTimeSpan::pack( QDataStream& stream ) const
75 {
76  GeoDataTimePrimitive::pack( stream );
77 
78  stream << d->m_begin;
79  stream << d->m_end;
80 }
81 
82 void GeoDataTimeSpan::unpack( QDataStream& stream )
83 {
84  GeoDataTimePrimitive::unpack( stream );
85 
86  stream >> d->m_begin;
87  stream >> d->m_end;
88 }
89 
90 }
Marble::GeoDataTimePrimitive::operator=
GeoDataTimePrimitive & operator=(const GeoDataTimePrimitive &other)
Definition: GeoDataTimePrimitive.cpp:41
Marble::GeoDataTimeSpan::unpack
virtual void unpack(QDataStream &stream)
Unserialize the timespan from a stream.
Definition: GeoDataTimeSpan.cpp:82
Marble::GeoDataTimePrimitive
a base class for the style classes
Definition: GeoDataTimePrimitive.h:34
Marble::GeoDataTimeSpan::end
QDateTime end() const
return the ending instant of a timespan
Definition: GeoDataTimeSpan.cpp:47
Marble::GeoDataTimeSpan::begin
QDateTime begin() const
return the beginning instant of a timespan
Definition: GeoDataTimeSpan.cpp:57
Marble::GeoDataTimePrimitive::unpack
virtual void unpack(QDataStream &stream)
Unserialize the styleselector from a stream.
Definition: GeoDataTimePrimitive.cpp:58
Marble::GeoDataTimeSpan::operator=
GeoDataTimeSpan & operator=(const GeoDataTimeSpan &other)
assignment operator
Definition: GeoDataTimeSpan.cpp:67
Marble::GeoDataTimeSpanPrivate
Definition: GeoDataTimeSpan_p.h:21
Marble::GeoDataTimeSpanPrivate::m_end
QDateTime m_end
Definition: GeoDataTimeSpan_p.h:30
MarbleDebug.h
GeoDataTimeSpan.h
Marble::GeoDataTimeSpan::~GeoDataTimeSpan
~GeoDataTimeSpan()
Definition: GeoDataTimeSpan.cpp:37
Marble::GeoDataTimeSpan::setEnd
void setEnd(const QDateTime &end)
Set the ending instant of a timespan.
Definition: GeoDataTimeSpan.cpp:52
Marble::GeoDataTimeSpan::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataTimeSpan.cpp:42
Marble::GeoDataTimeSpan::setBegin
void setBegin(const QDateTime &begin)
Set the beginning instant of a timespan.
Definition: GeoDataTimeSpan.cpp:62
Marble::GeoDataTimeSpan::pack
virtual void pack(QDataStream &stream) const
Serialize the timespan to a stream.
Definition: GeoDataTimeSpan.cpp:74
Marble::GeoDataTimeSpan::GeoDataTimeSpan
GeoDataTimeSpan()
Definition: GeoDataTimeSpan.cpp:27
Marble::GeoDataTimeSpanPrivate::nodeType
const char * nodeType() const
Definition: GeoDataTimeSpan_p.h:24
Marble::GeoDataTimePrimitive::pack
virtual void pack(QDataStream &stream) const
Serialize the styleselector to a stream.
Definition: GeoDataTimePrimitive.cpp:53
Marble::GeoDataTimeSpan
Definition: GeoDataTimeSpan.h:27
GeoDataTimeSpan_p.h
Marble::GeoDataTimeSpanPrivate::m_begin
QDateTime m_begin
Definition: GeoDataTimeSpan_p.h:29
GeoDataTypes.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 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