X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e98faf4414f7b9f5bcb318ca12e26e1aea183b70..92430d277d40e31dcdcd527047e40ee5a19af399:/include/stg/tariff_conf.h diff --git a/include/stg/tariff_conf.h b/include/stg/tariff_conf.h index 52e1fc1c..79ade2eb 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), @@ -157,7 +158,8 @@ struct TARIFF_CONF passiveCost(0), name(), period(TARIFF::MONTH), - changePolicy(TARIFF::ALLOW) + changePolicy(TARIFF::ALLOW), + changePolicyTimeout(0) {} TARIFF_CONF(const std::string & n) @@ -167,7 +169,8 @@ struct TARIFF_CONF passiveCost(0), name(n), period(TARIFF::MONTH), - changePolicy(TARIFF::ALLOW) + changePolicy(TARIFF::ALLOW), + changePolicyTimeout(0) {} }; //----------------------------------------------------------------------------- @@ -180,7 +183,8 @@ struct TARIFF_CONF_RES passiveCost(), name(), period(), - changePolicy() + changePolicy(), + changePolicyTimeout() {} TARIFF_CONF_RES & operator=(const TARIFF_CONF & tc) @@ -191,6 +195,8 @@ struct TARIFF_CONF_RES passiveCost = tc.passiveCost; name = tc.name; period = tc.period; + changePolicy = tc.changePolicy; + changePolicyTimeout = tc.changePolicyTimeout; return *this; } @@ -203,6 +209,8 @@ struct TARIFF_CONF_RES passiveCost.maybeSet(tc.passiveCost); traffType.maybeSet(tc.traffType); period.maybeSet(tc.period); + changePolicy.maybeSet(tc.changePolicy); + changePolicyTimeout.maybeSet(tc.changePolicyTimeout); return tc; } @@ -212,6 +220,8 @@ struct TARIFF_CONF_RES RESETABLE passiveCost; RESETABLE name; RESETABLE period; + RESETABLE changePolicy; + RESETABLE changePolicyTimeout; }; //----------------------------------------------------------------------------- struct TARIFF_DATA @@ -252,6 +262,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;