X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1347f3d1e04bedd1508589173f577673ee2c5554..1cb912e4f90473f78d2f0f10ab5c9b2c5bd36440:/projects/stargazer/plugins/other/smux/tables.cpp?ds=inline diff --git a/projects/stargazer/plugins/other/smux/tables.cpp b/projects/stargazer/plugins/other/smux/tables.cpp index c3e3ef54..ead98f38 100644 --- a/projects/stargazer/plugins/other/smux/tables.cpp +++ b/projects/stargazer/plugins/other/smux/tables.cpp @@ -1,21 +1,32 @@ -#include -#include -#include -#include +#include "tables.h" #include "stg/user_property.h" #include "stg/tariffs.h" +#include "stg/tariff_conf.h" #include "stg/users.h" -#include "tables.h" +#include +#include +#include +#include -std::pair TD2Info(const TARIFF_DATA & td); +using STG::TariffUsersTable; + +namespace +{ + +std::pair TD2Info(const STG::TariffData & td) +{ + return std::make_pair(td.tariffConf.name, 0); +} + +} void TariffUsersTable::UpdateSensors(Sensors & sensors) const { std::map data; -std::list tdl; +std::vector tdl; tariffs.GetTariffsData(&tdl); std::transform(tdl.begin(), tdl.end(), @@ -25,12 +36,12 @@ std::transform(tdl.begin(), int handle = users.OpenSearch(); assert(handle && "USERS::OpenSearch is always correct"); -USER_PTR user; +STG::User* user; while (!users.SearchNext(handle, &user)) { if (user->GetDeleted()) continue; - std::string tariffName(user->GetProperty().tariffName.ConstData()); + std::string tariffName(user->GetProperties().tariffName.ConstData()); std::map::iterator it(data.lower_bound(tariffName)); if (it == data.end() || it->first != tariffName) @@ -57,8 +68,3 @@ while (it != data.end()) ++it; } } - -std::pair TD2Info(const TARIFF_DATA & td) -{ -return std::make_pair(td.tariffConf.name, 0); -}