X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c016156ebb870d9d81219b8c4165aa75703f1e85..46b0747592074017ff0ea4b33d4a7194235886e5:/projects/stargazer/plugins/other/smux/tables.cpp diff --git a/projects/stargazer/plugins/other/smux/tables.cpp b/projects/stargazer/plugins/other/smux/tables.cpp deleted file mode 100644 index 023b90b2..00000000 --- a/projects/stargazer/plugins/other/smux/tables.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include - -#include "stg/user_property.h" - -#include "tables.h" - -void TariffUsersTable::UpdateSensors(Sensors & sensors) const -{ -std::map data; - -int handle = users.OpenSearch(); -if (!handle) - return; - -USER_PTR user; -while (!users.SearchNext(handle, &user)) - { - std::string tariffName(user->GetProperty().tariffName.ConstData()); - std::map::iterator it; - it = data.lower_bound(tariffName); - if (it == data.end() || - it->first != tariffName) - { - data.insert(it, std::make_pair(tariffName, 1)); - } - else - { - ++it->second; - } - } - -users.CloseSearch(handle); - -size_t idx = 1; -OID prefixOid(prefix); - -std::map::const_iterator it(data.begin()); -while (it != data.end()) - { - sensors[prefixOid.copyWithSuffix(2, idx)] = new ConstSensor(it->first); - sensors[prefixOid.copyWithSuffix(3, idx)] = new ConstSensor(it->second); - ++idx; - ++it; - } -}