WriteServLog(Logger::get()),
noTariff(NO_TARIFF_NAME)
{
-ReadTariffs();
}
//-----------------------------------------------------------------------------
int TariffsImpl::ReadTariffs()
tariffs.erase(ti);
}
-auto ni = onDelNotifiers.begin();
-while (ni != onDelNotifiers.end())
- {
- (*ni)->Notify(td);
- ++ni;
- }
+m_onDelCallbacks.notify(td);
WriteServLog("%s Tariff \'%s\' deleted.",
admin->logStr().c_str(),
return -1;
}
-// Fire all "on add" notifiers
-auto ni = onAddNotifiers.begin();
-while (ni != onAddNotifiers.end())
- {
- (*ni)->Notify(tariffs.back().GetTariffData());
- ++ni;
- }
+m_onAddCallbacks.notify(tariffs.back().GetTariffData());
WriteServLog("%s Tariff \'%s\' added.",
admin->logStr().c_str(), name.c_str());
}
}
//-----------------------------------------------------------------------------
-void TariffsImpl::AddNotifierAdd(NotifierBase<TariffData> * n)
-{
-std::lock_guard<std::mutex> lock(m_mutex);
-onAddNotifiers.insert(n);
-}
-//-----------------------------------------------------------------------------
-void TariffsImpl::DelNotifierAdd(NotifierBase<TariffData> * n)
-{
-std::lock_guard<std::mutex> lock(m_mutex);
-onAddNotifiers.erase(n);
-}
-//-----------------------------------------------------------------------------
-void TariffsImpl::AddNotifierDel(NotifierBase<TariffData> * n)
-{
-std::lock_guard<std::mutex> lock(m_mutex);
-onDelNotifiers.insert(n);
-}
-//-----------------------------------------------------------------------------
-void TariffsImpl::DelNotifierDel(NotifierBase<TariffData> * n)
-{
-std::lock_guard<std::mutex> lock(m_mutex);
-onDelNotifiers.erase(n);
-}
-//-----------------------------------------------------------------------------