X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/638e02a86c3c80557ef75c38f9e6f3f56628ede1..cd109e618baab42a4490851aef6f779612512eea:/include/stg/tariff_conf.h diff --git a/include/stg/tariff_conf.h b/include/stg/tariff_conf.h index ef8f15c2..a33247d6 100644 --- a/include/stg/tariff_conf.h +++ b/include/stg/tariff_conf.h @@ -149,6 +149,7 @@ struct TARIFF_CONF std::string name; TARIFF::PERIOD period; TARIFF::CHANGE_POLICY changePolicy; + time_t changePolicyTimeout; TARIFF_CONF() : fee(0), @@ -156,7 +157,9 @@ struct TARIFF_CONF traffType(TARIFF::TRAFF_UP_DOWN), passiveCost(0), name(), - period(TARIFF::MONTH) + period(TARIFF::MONTH), + changePolicy(TARIFF::ALLOW), + changePolicyTimeout(0) {} TARIFF_CONF(const std::string & n) @@ -165,7 +168,9 @@ struct TARIFF_CONF traffType(TARIFF::TRAFF_UP_DOWN), passiveCost(0), name(n), - period(TARIFF::MONTH) + period(TARIFF::MONTH), + changePolicy(TARIFF::ALLOW), + changePolicyTimeout(0) {} }; //----------------------------------------------------------------------------- @@ -177,7 +182,8 @@ struct TARIFF_CONF_RES traffType(), passiveCost(), name(), - period() + period(), + changePolicy() {} TARIFF_CONF_RES & operator=(const TARIFF_CONF & tc) @@ -188,6 +194,7 @@ struct TARIFF_CONF_RES passiveCost = tc.passiveCost; name = tc.name; period = tc.period; + changePolicy = tc.changePolicy; return *this; } @@ -200,6 +207,7 @@ struct TARIFF_CONF_RES passiveCost.maybeSet(tc.passiveCost); traffType.maybeSet(tc.traffType); period.maybeSet(tc.period); + changePolicy.maybeSet(tc.changePolicy); return tc; } @@ -209,6 +217,7 @@ struct TARIFF_CONF_RES RESETABLE passiveCost; RESETABLE name; RESETABLE period; + RESETABLE changePolicy; }; //----------------------------------------------------------------------------- struct TARIFF_DATA @@ -249,6 +258,14 @@ struct TARIFF_DATA_RES dirPrice(DIR_NUM) {} + TARIFF_DATA_RES & operator=(const TARIFF_DATA & td) + { + tariffConf = td.tariffConf; + for (size_t i = 0; i < DIR_NUM; ++i) + dirPrice[i] = td.dirPrice[i]; + return *this; + } + TARIFF_DATA GetData() const { TARIFF_DATA td;