File indexing completed on 2025-01-05 03:58:58
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2012 Thibaut Gridel <tgridel@free.fr> 0004 0005 #ifndef MARBLE_GEODATAMULTITRACKPRIVATE_H 0006 #define MARBLE_GEODATAMULTITRACKPRIVATE_H 0007 0008 #include "GeoDataGeometry_p.h" 0009 0010 #include "GeoDataTrack.h" 0011 0012 namespace Marble 0013 { 0014 0015 class GeoDataMultiTrackPrivate : public GeoDataGeometryPrivate 0016 { 0017 public: 0018 GeoDataMultiTrackPrivate() 0019 { 0020 } 0021 0022 ~GeoDataMultiTrackPrivate() override 0023 { 0024 qDeleteAll(m_vector); 0025 } 0026 0027 GeoDataMultiTrackPrivate& operator=( const GeoDataMultiTrackPrivate &other) 0028 { 0029 GeoDataGeometryPrivate::operator=( other ); 0030 0031 qDeleteAll( m_vector ); 0032 m_vector.clear(); 0033 0034 m_vector.reserve(other.m_vector.size()); 0035 for( GeoDataTrack *track: other.m_vector ) { 0036 m_vector.append( new GeoDataTrack( *track ) ); 0037 } 0038 return *this; 0039 } 0040 0041 GeoDataGeometryPrivate *copy() const override 0042 { 0043 GeoDataMultiTrackPrivate* copy = new GeoDataMultiTrackPrivate; 0044 *copy = *this; 0045 return copy; 0046 } 0047 0048 QVector<GeoDataTrack*> m_vector; 0049 }; 0050 0051 } // namespace Marble 0052 0053 #endif