$Author: faust $
*/
-#include <cassert>
-#include <algorithm>
-#include <vector>
+#include "tariffs_impl.h"
-#include "stg/locker.h"
#include "stg/logger.h"
#include "stg/store.h"
#include "stg/admin.h"
#include "stg/admin_conf.h"
-#include "tariffs_impl.h"
+
+#include <cassert>
+#include <algorithm>
using STG::TariffsImpl;
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);
-}
-//-----------------------------------------------------------------------------