File indexing completed on 2025-01-05 03:58:53
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2009 Patrick Spendrin <ps_ml@gmx.de> 0004 // 0005 0006 #ifndef MARBLE_GEODATACONTAINERPRIVATE_H 0007 #define MARBLE_GEODATACONTAINERPRIVATE_H 0008 0009 #include "GeoDataFeature_p.h" 0010 0011 #include "GeoDataTypes.h" 0012 0013 namespace Marble 0014 { 0015 0016 class GeoDataContainerPrivate : public GeoDataFeaturePrivate 0017 { 0018 public: 0019 GeoDataContainerPrivate() 0020 { 0021 } 0022 0023 GeoDataContainerPrivate(const GeoDataContainerPrivate& other) 0024 : GeoDataFeaturePrivate(other) 0025 { 0026 m_vector.reserve(other.m_vector.size()); 0027 for (GeoDataFeature *feature: other.m_vector) { 0028 m_vector.append(feature->clone()); 0029 } 0030 } 0031 0032 ~GeoDataContainerPrivate() override 0033 { 0034 qDeleteAll( m_vector ); 0035 } 0036 0037 GeoDataContainerPrivate& operator=( const GeoDataContainerPrivate &other) 0038 { 0039 GeoDataFeaturePrivate::operator=( other ); 0040 qDeleteAll( m_vector ); 0041 m_vector.clear(); 0042 m_vector.reserve(other.m_vector.size()); 0043 for( GeoDataFeature *feature: other.m_vector ) 0044 { 0045 m_vector.append(feature->clone()); 0046 } 0047 return *this; 0048 } 0049 0050 EnumFeatureId featureId() const override 0051 { 0052 return GeoDataFolderId; 0053 } 0054 0055 void setParent(GeoDataObject *parent) 0056 { 0057 for (GeoDataFeature *feature: m_vector) { 0058 feature->setParent(parent); 0059 } 0060 } 0061 0062 QVector<GeoDataFeature*> m_vector; 0063 }; 0064 0065 } // namespace Marble 0066 0067 #endif