X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/0c9d10cb3d9399280fe5eca715287d2454788654..6171920df2f880303b54c19d7c5169c64b485585:/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h index c96163fe..f31257df 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h @@ -40,6 +40,18 @@ namespace PARSER class GET_TARIFFS: public BASE_PARSER { public: + class FACTORY : public BASE_PARSER::FACTORY + { + public: + FACTORY(const ADMIN & admin, const TARIFFS & tariffs) + : m_admin(admin), m_tariffs(tariffs) + {} + virtual BASE_PARSER * create() { return new GET_TARIFFS(m_admin, m_tariffs); } + private: + const ADMIN & m_admin; + const TARIFFS & m_tariffs; + }; + GET_TARIFFS(const ADMIN & admin, const TARIFFS & tariffs) : BASE_PARSER(admin, "GetTariffs"), m_tariffs(tariffs) {} @@ -52,6 +64,18 @@ class GET_TARIFFS: public BASE_PARSER class ADD_TARIFF: public BASE_PARSER { public: + class FACTORY : public BASE_PARSER::FACTORY + { + public: + FACTORY(const ADMIN & admin, TARIFFS & tariffs) + : m_admin(admin), m_tariffs(tariffs) + {} + virtual BASE_PARSER * create() { return new ADD_TARIFF(m_admin, m_tariffs); } + private: + const ADMIN & m_admin; + TARIFFS & m_tariffs; + }; + ADD_TARIFF(const ADMIN & admin, TARIFFS & tariffs) : BASE_PARSER(admin, "AddTariff"), m_tariffs(tariffs) {} int Start(void * data, const char * el, const char ** attr); @@ -66,6 +90,19 @@ class ADD_TARIFF: public BASE_PARSER class DEL_TARIFF: public BASE_PARSER { public: + class FACTORY : public BASE_PARSER::FACTORY + { + public: + FACTORY(const ADMIN & admin, TARIFFS & tariffs, const USERS & users) + : m_admin(admin), m_tariffs(tariffs), m_users(users) + {} + virtual BASE_PARSER * create() { return new DEL_TARIFF(m_admin, m_users, m_tariffs); } + private: + const ADMIN & m_admin; + TARIFFS & m_tariffs; + const USERS & m_users; + }; + DEL_TARIFF(const ADMIN & admin, const USERS & users, TARIFFS & tariffs) : BASE_PARSER(admin, "DelTariff"), m_users(users), m_tariffs(tariffs) {} int Start(void * data, const char * el, const char ** attr); @@ -81,10 +118,21 @@ class DEL_TARIFF: public BASE_PARSER class CHG_TARIFF: public BASE_PARSER { public: + class FACTORY : public BASE_PARSER::FACTORY + { + public: + FACTORY(const ADMIN & admin, TARIFFS & tariffs) + : m_admin(admin), m_tariffs(tariffs) + {} + virtual BASE_PARSER * create() { return new CHG_TARIFF(m_admin, m_tariffs); } + private: + const ADMIN & m_admin; + TARIFFS & m_tariffs; + }; + CHG_TARIFF(const ADMIN & admin, TARIFFS & tariffs) : BASE_PARSER(admin, "SetTariff"), m_tariffs(tariffs) {} int Start(void * data, const char * el, const char ** attr); - int End(void * data, const char * el); private: TARIFF_DATA_RES td; @@ -94,7 +142,7 @@ class CHG_TARIFF: public BASE_PARSER void CreateAnswer(); }; -} -} +} // namespace PARSER +} // namespace STG #endif