#include "corp_conf.h"
+class ADMIN;
+
class CORPORATIONS {
public:
- virtual int Add(const CORP_CONF & corp) = 0;
- virtual int Del(const std::string & name) = 0;
- virtual int Change(const CORP_CONF & corp) = 0;
- virtual bool FindCorp(const std::string & name, CORP_CONF & corp) = 0;
- virtual bool CorpExists(const std::string & name) const = 0;
+ virtual int Add(const CORP_CONF & corp, const ADMIN * admin) = 0;
+ virtual int Del(const std::string & name, const ADMIN * admin) = 0;
+ virtual int Change(const CORP_CONF & corp, const ADMIN * admin) = 0;
+ virtual bool Find(const std::string & name, CORP_CONF * corp) = 0;
+ virtual bool Exists(const std::string & name) const = 0;
virtual const std::string & GetStrError() const = 0;
virtual size_t Count() const = 0;
#include "service_conf.h"
+class ADMIN;
+
class SERVICES {
public:
- virtual int Add(const SERVICE_CONF & service) = 0;
- virtual int Del(const std::string & name) = 0;
- virtual int Change(const SERVICE_CONF & service) = 0;
- virtual bool FindService(const std::string & name, SERVICE_CONF & service) = 0;
- virtual bool ServiceExists(const std::string & name) const = 0;
+ virtual int Add(const SERVICE_CONF & service, const ADMIN * admin) = 0;
+ virtual int Del(const std::string & name, const ADMIN * admin) = 0;
+ virtual int Change(const SERVICE_CONF & service, const ADMIN * admin) = 0;
+ virtual bool Find(const std::string & name, SERVICE_CONF * service) = 0;
+ virtual bool Exists(const std::string & name) const = 0;
virtual const std::string & GetStrError() const = 0;
virtual size_t Count() const = 0;
bool Exists(const std::string & name) const;
const std::string & GetStrError() const { return strError; }
+ size_t Count() const { return data.size(); }
+
int OpenSearch() const;
int SearchNext(int, CORP_CONF * corp) const;
int CloseSearch(int) const;
#include "users_impl.h"
#include "admins_impl.h"
#include "tariffs_impl.h"
+#include "services_impl.h"
+#include "corps_impl.h"
#include "traffcounter_impl.h"
#include "plugin_runner.h"
#include "store_loader.h"
ADMINS_IMPL * admins = NULL;
USERS_IMPL * users = NULL;
TRAFFCOUNTER_IMPL * traffCnt = NULL;
+SERVICES_IMPL * services = NULL;
+CORPORATIONS_IMPL * corps = NULL;
int msgID = -11;
{
admins = new ADMINS_IMPL(dataStore);
users = new USERS_IMPL(settings, dataStore, tariffs, admins->GetSysAdmin());
traffCnt = new TRAFFCOUNTER_IMPL(users, settings->GetRulesFileName());
+services = new SERVICES_IMPL(dataStore);
+corps = new CORPORATIONS_IMPL(dataStore);
traffCnt->SetMonitorDir(settings->GetMonitorDir());
modSettings = settings->GetModulesSettings();
admins,
tariffs,
users,
+ services,
+ corps,
traffCnt,
dataStore,
settings)
StopStgTimer();
WriteServLog("StgTimer: Stop successfull.");
+delete corps;
+delete services;
delete traffCnt;
delete users;
delete admins;
#include "admins_impl.h"
#include "tariffs_impl.h"
#include "users_impl.h"
+#include "services_impl.h"
+#include "corps_impl.h"
//-----------------------------------------------------------------------------
PLUGIN_RUNNER::PLUGIN_RUNNER(const std::string & pFileName,
ADMINS_IMPL * a,
TARIFFS_IMPL * t,
USERS_IMPL * u,
+ SERVICES_IMPL * svc,
+ CORPORATIONS_IMPL * crp,
TRAFFCOUNTER * tc,
STORE * st,
const SETTINGS_IMPL * s)
admins(a),
tariffs(t),
users(u),
+ services(svc),
+ corps(crp),
store(st),
traffCnt(tc),
stgSettings(s),
admins(rvalue.admins),
tariffs(rvalue.tariffs),
users(rvalue.users),
+ services(rvalue.services),
+ corps(rvalue.corps),
store(rvalue.store),
traffCnt(rvalue.traffCnt),
stgSettings(rvalue.stgSettings),
admins = rvalue.admins;
tariffs = rvalue.tariffs;
users = rvalue.users;
+services = rvalue.services;
+corps = rvalue.corps;
store = rvalue.store;
traffCnt = rvalue.traffCnt;
stgSettings = rvalue.stgSettings;
plugin->SetTariffs(tariffs);
plugin->SetAdmins(admins);
plugin->SetUsers(users);
+plugin->SetServices(services);
+plugin->SetCorporations(corps);
plugin->SetTraffcounter(traffCnt);
plugin->SetStore(store);
plugin->SetStgSettings(stgSettings);
class ADMINS_IMPL;
class TARIFFS_IMPL;
class USERS_IMPL;
+class SERVICES_IMPL;
+class CORPORATIONS_IMPL;
class TRAFFCOUNTER;
class STORE;
ADMINS_IMPL * admins,
TARIFFS_IMPL * tariffs,
USERS_IMPL * users,
+ SERVICES_IMPL * services,
+ CORPORATIONS_IMPL * corporations,
TRAFFCOUNTER * tc,
STORE * store,
const SETTINGS_IMPL * s);
ADMINS_IMPL * admins;
TARIFFS_IMPL * tariffs;
USERS_IMPL * users;
+ SERVICES_IMPL * services;
+ CORPORATIONS_IMPL * corps;
STORE * store;
TRAFFCOUNTER * traffCnt;
const SETTINGS_IMPL * stgSettings;
bool Exists(const std::string & name) const;
const std::string & GetStrError() const { return strError; }
+ size_t Count() const { return data.size(); }
+
int OpenSearch() const;
int SearchNext(int, SERVICE_CONF * service) const;
int CloseSearch(int) const;