C++: prevent overwriting types in copy constructors of price spec
authorjani <jani@asema.com>
Sat, 25 Jan 2020 00:03:24 +0000 (02:03 +0200)
committerjani <jani@asema.com>
Sat, 25 Jan 2020 00:03:24 +0000 (02:03 +0200)
objects

Common/C++/SmartAPI/smartapi/model/DistanceDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/DurationAtDistanceDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/ObjectOperationDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/PriceListSpecification.cpp
Common/C++/SmartAPI/smartapi/model/PropertyDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/ScriptDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/TimeDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/TravelDistanceDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/TravelDistanceDurationDependentPriceSpecification.cpp
Common/C++/SmartAPI/smartapi/model/ZonePopulationDependentPriceSpecification.cpp

index 74c893ba9ec7eae5bc57d8505b91d92abb525970..0ecf80f39f9a1af7808aaf47847ede56aaf148e3 100644 (file)
@@ -26,7 +26,6 @@ DistanceDependentPriceSpecification::DistanceDependentPriceSpecification(Distanc
        TravelDistanceDependentPriceSpecification(o)
 {
        SET_PROPERTY_REFERENCE(PROPERTY__LOCATION, mCoordinates, Coordinates)
-       setType(RESOURCE__DISTANCEDEPENDENTPRICESPECIFICATION);
 }
 
 DistanceDependentPriceSpecification::~DistanceDependentPriceSpecification()
index f602592d4602002d72a870bb4bf941eb9a803bd7..92ad87e4f4136d680b5ac0f897075a08fd9c857a 100644 (file)
@@ -24,7 +24,6 @@ DurationAtDistanceDependentPriceSpecification::DurationAtDistanceDependentPriceS
        LocationDependentPriceSpecification(o)
 {
        SET_PROPERTY_REFERENCE(PROPERTY__LOCATION, mCoordinates, Coordinates)
-       setType(RESOURCE__DURATIONATDISTANCEDEPENDENTPRICESPECIFICATION);
 }
 
 DurationAtDistanceDependentPriceSpecification::~DurationAtDistanceDependentPriceSpecification()
index beb8e2af4f471a14f5fc26fd00e3883002bb390c..ac677279896f3b4b2e62233836b6d69c5c75cc24 100644 (file)
@@ -3,24 +3,24 @@
 #include "smartapi/common/RESOURCE.h"
 
 ObjectOperationDependentPriceSpecification::ObjectOperationDependentPriceSpecification(QString identifierUri) :
-    PropertyDependentPriceSpecification(identifierUri)
+       PropertyDependentPriceSpecification(identifierUri)
 {
-    setType(RESOURCE__OBJECTOPERATIONDEPENDENTPRICESPECIFICATION);
+       setType(RESOURCE__OBJECTOPERATIONDEPENDENTPRICESPECIFICATION);
 }
 
 ObjectOperationDependentPriceSpecification::ObjectOperationDependentPriceSpecification(QString unit, QString secondaryUnit, QString secondaryQuantity, QDateTime validFrom, QDateTime validThrough) :
-    PropertyDependentPriceSpecification()
+       PropertyDependentPriceSpecification()
 {
-    setQuantity(RESOURCE__CURRENCY);
-    setUnit(unit);
-    setSecondaryUnit(secondaryUnit);
-    setSecondaryQuantity(secondaryQuantity);
-    setValidFrom(validFrom);
-    setValidThrough(validThrough);
+       setQuantity(RESOURCE__CURRENCY);
+       setUnit(unit);
+       setSecondaryUnit(secondaryUnit);
+       setSecondaryQuantity(secondaryQuantity);
+       setValidFrom(validFrom);
+       setValidThrough(validThrough);
 }
 
 ObjectOperationDependentPriceSpecification::ObjectOperationDependentPriceSpecification(ObjectOperationDependentPriceSpecification* o) :
-    PropertyDependentPriceSpecification(o)
+       PropertyDependentPriceSpecification(o)
 {
 }
 
@@ -30,18 +30,18 @@ ObjectOperationDependentPriceSpecification::~ObjectOperationDependentPriceSpecif
 
 void ObjectOperationDependentPriceSpecification::clearReferences(QSet<GraphItem*>* trash)
 {
-    INIT_CLEAR(PropertyDependentPriceSpecification,trash);
-    FINISH_CLEAR(PropertyDependentPriceSpecification,trash);
+       INIT_CLEAR(PropertyDependentPriceSpecification,trash);
+       FINISH_CLEAR(PropertyDependentPriceSpecification,trash);
 }
 
 Resource* ObjectOperationDependentPriceSpecification::serialize(Model* model)
 {
-    INIT_SERIALIZE(PropertyDependentPriceSpecification,model)
-    FINISH_SERIALIZE(PropertyDependentPriceSpecification)
+       INIT_SERIALIZE(PropertyDependentPriceSpecification,model)
+       FINISH_SERIALIZE(PropertyDependentPriceSpecification)
 }
 
 void ObjectOperationDependentPriceSpecification::parse(Statement* statement)
 {
-    INIT_PARSE(statement)
-    FINISH_PARSE(PropertyDependentPriceSpecification)
+       INIT_PARSE(statement)
+       FINISH_PARSE(PropertyDependentPriceSpecification)
 }
index 0bf2d3b538034d18ea6a7dfe55d1da3ca5ec5c1f..b849a18c32ca22bae80909b18f7e3eb0bc25fee9 100644 (file)
@@ -24,7 +24,6 @@ PriceListSpecification::PriceListSpecification(PriceListSpecification* o) :
        PriceSpecification(o)
 {
        SET_PROPERTYLIST_REFERENCE(PROPERTY__HASPRICESPECIFICATION,mPriceSpecifications,PriceSpecification);
-       setType(RESOURCE__PRICELISTSPECIFICATION);
 }
 
 PriceListSpecification::~PriceListSpecification()
index 6e62f3bbbeb1eba159dc07842f04b40f7b0da0d4..2ade655d7f372722ff2644db96fb47d20664d15e 100644 (file)
@@ -26,7 +26,6 @@ PropertyDependentPriceSpecification::PropertyDependentPriceSpecification(Propert
 {
        SET_PROPERTY_REFERENCE(PROPERTY__REFERENCEOBJECT,mReferenceObject,Variant);
        SET_PROPERTY_REFERENCE(PROPERTY__SMARTAPI_PROPERTY,mProperty,Variant);
-       setType(RESOURCE__PROPERTYDEPENDENTPRICESPECIFICATION);
 }
 
 PropertyDependentPriceSpecification::~PropertyDependentPriceSpecification()
index bcfca94c7b01876187d32c0dc7d4ad436d73ce1c..0e07378b2938dfed235f579d4acf9e96180b466e 100644 (file)
@@ -23,12 +23,12 @@ ScriptDependentPriceSpecification::ScriptDependentPriceSpecification(QString uni
        setValidThrough(validThrough);
        INIT_PROPERTY(mScript);
        INIT_PROPERTY(mSpec);
+       setType(RESOURCE__SCRIPTDEPENDENTPRICESPECIFICATION);
 }
 
 ScriptDependentPriceSpecification::ScriptDependentPriceSpecification(ScriptDependentPriceSpecification* o) :
        DependentPriceSpecification(o)
 {
-       setType(RESOURCE__SCRIPTDEPENDENTPRICESPECIFICATION);
        SET_PROPERTY_REFERENCE(PROPERTY__PROGRAMCODE,mScript,Variant);
        SET_PROPERTY_REFERENCE(PROPERTY__TERMS,mSpec,Map);
 }
index 2d94d88f014ea35a5808aee8cb7b7d815ed97409..54a588758ee19a818c3d7ed298d529e7aa8529d7 100644 (file)
@@ -22,7 +22,6 @@ TimeDependentPriceSpecification::TimeDependentPriceSpecification(QString unit, Q
 TimeDependentPriceSpecification::TimeDependentPriceSpecification(TimeDependentPriceSpecification* o) :
        DependentPriceSpecification(o)
 {
-       setType(RESOURCE__TIMEDEPENDENTPRICESPECIFICATION);
 }
 
 TimeDependentPriceSpecification::~TimeDependentPriceSpecification()
index da559142ae7349a942cde4fb206d427e23b739fc..df2cd6633e9a7ccb4f6c02564a3dd662db499387 100644 (file)
@@ -27,7 +27,6 @@ TravelDistanceDependentPriceSpecification::TravelDistanceDependentPriceSpecifica
        LocationDependentPriceSpecification(o)
 {
        SET_PROPERTY_REFERENCE(PROPERTY__CALCULATIONMETHOD, mCalculationMethod, CalculationMethod)
-       setType(RESOURCE__TRAVELDISTANCEDEPENDENTPRICESPECIFICATION);
 }
 
 TravelDistanceDependentPriceSpecification::~TravelDistanceDependentPriceSpecification()
index 96087f29291196a918de50a4311afac3e56cbc27..3bae69636358f03fe832877379e161f54e0cac99 100644 (file)
@@ -9,7 +9,7 @@ TravelDistanceDurationDependentPriceSpecification::TravelDistanceDurationDepende
 }
 
 TravelDistanceDurationDependentPriceSpecification::TravelDistanceDurationDependentPriceSpecification(QString unit, QString secondaryUnit, QString secondaryQuantity, QDateTime validFrom, QDateTime validThrough) :
-       LocationDependentPriceSpecification()
+       TravelDistanceDurationDependentPriceSpecification()
 {
        setQuantity(RESOURCE__CURRENCY);
        setUnit(unit);
index bcd32e4bdc594dc312897383357f1acbd5a8d89b..a2c8516d946e04b0a6a796e7d986ee2c3cd21239 100644 (file)
@@ -26,7 +26,6 @@ ZonePopulationDependentPriceSpecification::ZonePopulationDependentPriceSpecifica
 {
        SET_PROPERTY_REFERENCE(PROPERTY__CALCULATIONMETHOD, mCalculationMethod, CalculationMethod)
        SET_PROPERTY_REFERENCE(PROPERTY__ZONE, mZone, Zone)
-       setType(RESOURCE__ZONEPOPULATIONDEPENDENTPRICESPECIFICATION);
 }
 
 ZonePopulationDependentPriceSpecification::~ZonePopulationDependentPriceSpecification()