- }
-
- DIRPRICE_DATA GetData() const
- {
- DIRPRICE_DATA dd;
- dd.hDay = hDay.data();
- dd.hNight = hNight.data();
- dd.mDay = mDay.data();
- dd.mNight = mNight.data();
- dd.noDiscount = noDiscount.data();
- dd.priceDayA = priceDayA.data();
- dd.priceDayB = priceDayB.data();
-
- dd.priceNightA = priceNightA.data();
- dd.priceNightB = priceNightB.data();
- dd.singlePrice = singlePrice.data();
- dd.threshold = threshold.data();
- return dd;
- }
-
- RESETABLE<int> hDay;
- RESETABLE<int> mDay;
- RESETABLE<int> hNight;
- RESETABLE<int> mNight;
- RESETABLE<double> priceDayA;
- RESETABLE<double> priceNightA;
- RESETABLE<double> priceDayB;
- RESETABLE<double> priceNightB;
- RESETABLE<int> threshold;
- RESETABLE<int> singlePrice;
- RESETABLE<int> noDiscount;
+ }
+
+ void splice(const DirPriceDataOpt & rhs) noexcept
+ {
+ STG::splice(hDay, rhs.hDay);
+ STG::splice(mDay, rhs.mDay);
+ STG::splice(hNight, rhs.hNight);
+ STG::splice(mNight, rhs.mNight);
+ STG::splice(priceDayA, rhs.priceDayA);
+ STG::splice(priceNightA, rhs.priceNightA);
+ STG::splice(priceDayB, rhs.priceDayB);
+ STG::splice(priceNightB, rhs.priceNightB);
+ STG::splice(threshold, rhs.threshold);
+ STG::splice(singlePrice, rhs.singlePrice);
+ STG::splice(noDiscount, rhs.noDiscount);
+ }
+
+ DirPriceData get(const DirPriceData& defaultValue) const noexcept
+ {
+ DirPriceData res;
+ res.hDay = hDay.value_or(defaultValue.hDay);
+ res.mDay = mDay.value_or(defaultValue.mDay);
+ res.hNight = hNight.value_or(defaultValue.hNight);
+ res.mNight = mNight.value_or(defaultValue.mNight);
+ res.priceDayA = priceDayA.value_or(defaultValue.priceDayA);
+ res.priceNightA = priceNightA.value_or(defaultValue.priceNightA);
+ res.priceDayB = priceDayB.value_or(defaultValue.priceDayB);
+ res.priceNightB = priceNightB.value_or(defaultValue.priceNightB);
+ res.threshold = threshold.value_or(defaultValue.threshold);
+ res.singlePrice = singlePrice.value_or(defaultValue.singlePrice);
+ res.noDiscount = noDiscount.value_or(defaultValue.noDiscount);
+ return res;
+ }
+
+ std::optional<int> hDay;
+ std::optional<int> mDay;
+ std::optional<int> hNight;
+ std::optional<int> mNight;
+ std::optional<double> priceDayA;
+ std::optional<double> priceNightA;
+ std::optional<double> priceDayB;
+ std::optional<double> priceNightB;
+ std::optional<int> threshold;
+ std::optional<int> singlePrice;
+ std::optional<int> noDiscount;