Marble

GeoDataTimeStamp.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Harshit Jain <[email protected]>
4 //
5 
6 // Own
7 #include "GeoDataTimeStamp.h"
8 
9 // Private
10 #include "GeoDataTimeStamp_p.h"
11 
12 // Qt
13 #include <QDataStream>
14 
15 // GeoData
16 #include "GeoDataTypes.h"
17 
18 namespace Marble
19 {
20 
21 GeoDataTimeStamp::GeoDataTimeStamp()
22  : GeoDataTimePrimitive(), d( new GeoDataTimeStampPrivate )
23 {
24 }
25 
26 GeoDataTimeStamp::GeoDataTimeStamp( const GeoDataTimeStamp& other )
27  : GeoDataTimePrimitive( other ) , d( new GeoDataTimeStampPrivate( *other.d ) )
28 {
29 }
30 
31 GeoDataTimeStamp::~GeoDataTimeStamp()
32 {
33  delete d;
34 }
35 
36 GeoDataTimeStamp& GeoDataTimeStamp::operator=( const GeoDataTimeStamp& other )
37 {
38  GeoDataTimePrimitive::operator=( other );
39  *d = *other.d;
40  return *this;
41 }
42 
43 bool GeoDataTimeStamp::operator==( const GeoDataTimeStamp& other ) const
44 {
45  return equals(other) &&
46  d->m_resolution == other.d->m_resolution &&
47  d->m_when == other.d->m_when;
48 }
49 
50 bool GeoDataTimeStamp::operator!=( const GeoDataTimeStamp& other ) const
51 {
52  return !this->operator==( other );
53 }
54 
55 
56 const char* GeoDataTimeStamp::nodeType() const
57 {
58  return GeoDataTypes::GeoDataTimeStampType;
59 }
60 
61 QDateTime GeoDataTimeStamp::when() const
62 {
63  return d->m_when;
64 }
65 
66 void GeoDataTimeStamp::setWhen( const QDateTime& when )
67 {
68  d->m_when = when;
69 }
70 
71 void GeoDataTimeStamp::setResolution( GeoDataTimeStamp::TimeResolution resolution )
72 {
73  d->m_resolution = resolution;
74 }
75 
76 GeoDataTimeStamp::TimeResolution GeoDataTimeStamp::resolution() const
77 {
78  return d->m_resolution;
79 }
80 
81 void GeoDataTimeStamp::pack( QDataStream& stream ) const
82 {
84 
85  stream << d->m_when;
86 }
87 
88 void GeoDataTimeStamp::unpack( QDataStream& stream )
89 {
91 
92  stream >> d->m_when;
93 }
94 
95 }
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
void pack(QDataStream &stream) const override
Serialize the styleselector to a stream.
Binds a QML item to a specific geodetic location in screen coordinates.
void unpack(QDataStream &stream) override
Unserialize the styleselector from a stream.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Sep 25 2023 03:50:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.