Merge branch 'master' of ssh://jani@git.smart-api.io/srv/git/smartapi.git
authorjani <jani@asema.com>
Tue, 15 Jan 2019 10:57:02 +0000 (12:57 +0200)
committerjani <jani@asema.com>
Tue, 15 Jan 2019 10:57:02 +0000 (12:57 +0200)
Common/C++/SmartAPI/smartapi.pro
Common/C++/SmartAPI/smartapi/common/RESOURCE.h
Common/C++/SmartAPI/smartapi/model/ZonePopulationDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ZonePopulationDependentPriceSpecification.h [new file with mode: 0644]

index 27168692f67292d0bc8b1b4b5945d9662472c456..c42c148ab1493745bb7838f50032467a21338948 100644 (file)
@@ -166,6 +166,7 @@ SOURCES += smartapi/agents/Agent.cpp \
         smartapi/model/TravelDistanceDependentPriceSpecification.cpp \
         smartapi/model/DistanceDependentPriceSpecification.cpp \
         smartapi/model/ZoneDependentPriceSpecification.cpp \
+        smartapi/model/ZonePopulationDependentPriceSpecification.cpp \
         smartapi/model/ZoneTravelDependentPriceSpecification.cpp \
         smartapi/model/TravelDistanceDurationDependentPriceSpecification.cpp \
         smartapi/model/ZoneTravelDurationDependentPriceSpecification.cpp \
@@ -306,6 +307,7 @@ HEADERS += smartapi/agents/Agent.h \
         smartapi/model/TravelDistanceDependentPriceSpecification.h \
         smartapi/model/DistanceDependentPriceSpecification.h \
         smartapi/model/ZoneDependentPriceSpecification.h \
+        smartapi/model/ZonePopulationDependentPriceSpecification.h \
         smartapi/model/ZoneTravelDependentPriceSpecification.h \
         smartapi/model/TravelDistanceDurationDependentPriceSpecification.h \
         smartapi/model/ZoneTravelDurationDependentPriceSpecification.h \
index f6605f00a37fa02f1d759768f39ffcf80859690a..1c7f0a3473d9a613707b59bed6471062137f6189 100644 (file)
 #define RESOURCE__ZONETRAVELDEPENDENTPRICESPECIFICATION                "http://smart-api.io/ontology/1.0/smartapi#ZoneTravelDependentPriceSpecification"
 #define RESOURCE__ZONETRAVELDURATIONDEPENDENTPRICESPECIFICATION                "http://smart-api.io/ontology/1.0/smartapi#ZoneTravelDurationDependentPriceSpecification"
 
+#define RESOURCE__ZONEPOPULATIONDEPENDENTPRICESPECIFICATION            "http://smart-api.io/ontology/1.0/smartapi#ZonePopulationDependentPriceSpecification"
+
 #endif //__RESOURCE_H__
diff --git a/Common/C++/SmartAPI/smartapi/model/ZonePopulationDependentPriceSpecification.cpp b/Common/C++/SmartAPI/smartapi/model/ZonePopulationDependentPriceSpecification.cpp
new file mode 100644 (file)
index 0000000..aef163b
--- /dev/null
@@ -0,0 +1,47 @@
+#include "ZonePopulationDependentPriceSpecification.h"
+
+#include "smartapi/common/RESOURCE.h"
+
+ZonePopulationDependentPriceSpecification::ZonePopulationDependentPriceSpecification(QString identifierUri) :
+       DependentPriceSpecification(identifierUri)
+{
+       setType(RESOURCE__ZONETRAVELDEPENDENTPRICESPECIFICATION);
+}
+
+ZonePopulationDependentPriceSpecification::ZonePopulationDependentPriceSpecification(QString unit, QString secondaryUnit, QString secondaryQuantity, QDateTime validFrom, QDateTime validThrough) :
+       ZonePopulationDependentPriceSpecification()
+{
+       setQuantity(RESOURCE__CURRENCY);
+       setUnit(unit);
+       setSecondaryUnit(secondaryUnit);
+       setSecondaryQuantity(secondaryQuantity);
+       setValidFrom(validFrom);
+       setValidThrough(validThrough);
+}
+
+ZonePopulationDependentPriceSpecification::ZonePopulationDependentPriceSpecification(ZonePopulationDependentPriceSpecification* o) :
+       DependentPriceSpecification(o)
+{
+}
+
+ZonePopulationDependentPriceSpecification::~ZonePopulationDependentPriceSpecification()
+{
+}
+
+void ZonePopulationDependentPriceSpecification::clearReferences(QSet<GraphItem*>* trash)
+{
+       INIT_CLEAR(DependentPriceSpecification,trash);
+       FINISH_CLEAR(DependentPriceSpecification,trash);
+}
+
+Resource* ZonePopulationDependentPriceSpecification::serialize(Model* model)
+{
+       INIT_SERIALIZE(DependentPriceSpecification,model)
+       FINISH_SERIALIZE(DependentPriceSpecification)
+}
+
+void ZonePopulationDependentPriceSpecification::parse(Statement* statement)
+{
+       INIT_PARSE(statement)
+       FINISH_PARSE(DependentPriceSpecification)
+}
diff --git a/Common/C++/SmartAPI/smartapi/model/ZonePopulationDependentPriceSpecification.h b/Common/C++/SmartAPI/smartapi/model/ZonePopulationDependentPriceSpecification.h
new file mode 100644 (file)
index 0000000..14f556b
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef ZONEPOPULATIONDEPENDENTPRICESPECIFICATION_H
+#define ZONEPOPULATIONDEPENDENTPRICESPECIFICATION_H
+
+#include "smartapi/model/DependentPriceSpecification.h"
+
+class ZonePopulationDependentPriceSpecification : public DependentPriceSpecification
+{
+public:
+       ZonePopulationDependentPriceSpecification(QString identifierUri = QString());
+       ZonePopulationDependentPriceSpecification(QString unit, QString secondaryUnit, QString secondaryQuantity, QDateTime validFrom, QDateTime validThrough);
+       ZonePopulationDependentPriceSpecification(ZonePopulationDependentPriceSpecification* o);
+       ~ZonePopulationDependentPriceSpecification();
+
+       virtual void clearReferences(QSet<GraphItem*>* trash);
+       Resource* serialize(Model* model);
+       void parse(Statement* statement);
+
+       bool isTimeDependent() { return false; }
+
+};
+
+#endif // ZONEPOPULATIONDEPENDENTPRICESPECIFICATION_H