C++: Some code cleanup
[smartapi.git] / Common / C++ / SmartAPI / smartapi / model / DependentPriceSpecification.h
1 #ifndef DEPENDENTPRICESPECIFICATION_H
2 #define DEPENDENTPRICESPECIFICATION_H
3
4 #include "PriceSpecification.h"
5 #include "smartapi/model/Condition.h"
6
7
8 class DependentPriceSpecification : public PriceSpecification
9 {
10 public:
11         DependentPriceSpecification(QString identifierUri = QString());
12         DependentPriceSpecification(QString unit, QString secondaryUnit, QString secondaryQuantity, QDateTime validFrom, QDateTime validThrough);
13         DependentPriceSpecification(DependentPriceSpecification* o);
14         ~DependentPriceSpecification();
15
16         Resource* serialize(Model* model);
17         void parse(Statement* statement);
18         virtual void clearReferences(QSet<GraphItem*>* trash);
19
20         bool hasCondition()                                                                     { return !mConditions.isEmpty(); }
21         PropertyList<Condition*> getConditions()                        { return mConditions; }
22         void addCondition(Condition* condition)                         { mConditions.append(condition); }
23         void setConditions(PropertyList<Condition*> list)       { mConditions = list; add(PROPERTY__LIST, &mConditions); }
24
25
26 private:
27         PropertyList<Condition*> mConditions;
28 };
29
30 #endif // DEPENDENTPRICESPECIFICATION_H