File indexing completed on 2024-05-12 03:50:18

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
0004 // SPDX-FileCopyrightText: 2014 Calin Cruceru <calin@rosedu.org>
0005 //
0006 
0007 #ifndef MARBLE_GEODATATOURPRIVATE_H
0008 #define MARBLE_GEODATATOURPRIVATE_H
0009 
0010 #include "GeoDataFeature_p.h"
0011 #include "GeoDataTypes.h"
0012 #include "GeoDataPlaylist.h"
0013 
0014 
0015 namespace Marble
0016 {
0017 
0018 class GeoDataTourPrivate : public GeoDataFeaturePrivate
0019 {
0020 public:
0021     GeoDataTourPrivate()
0022         : m_playlist( nullptr )
0023     {
0024         // nothing to do
0025     }
0026     GeoDataTourPrivate(const GeoDataTourPrivate &other)
0027       : GeoDataFeaturePrivate(other),
0028         m_playlist(nullptr)
0029     {
0030         if (other.m_playlist) {
0031             m_playlist = new GeoDataPlaylist(*other.m_playlist);
0032         }
0033     }
0034 
0035     ~GeoDataTourPrivate() override
0036     {
0037         delete m_playlist;
0038     }
0039 
0040     GeoDataTourPrivate& operator=( const GeoDataTourPrivate &other )
0041     {
0042         if ( this == &other ) {
0043             return *this;
0044         }
0045 
0046         GeoDataFeaturePrivate::operator=( other );
0047 
0048         GeoDataPlaylist *newPlaylist = nullptr;
0049         if ( other.m_playlist ) {
0050             newPlaylist = new GeoDataPlaylist( *other.m_playlist );
0051         }
0052         delete m_playlist;
0053         m_playlist = newPlaylist;
0054 
0055         return *this;
0056     }
0057 
0058     GeoDataPlaylist *m_playlist;
0059 };
0060 
0061 }
0062 
0063 #endif // MARBLE_GEODATATOURPRIVATE_H