- ADD_ADMIN(const ADMIN & admin, ADMINS & admins)
- : BASE_PARSER(admin, "AddAdmin"), m_admins(admins) {}
- int Start(void * data, const char * el, const char ** attr);
+ class FACTORY : public BASE_PARSER::FACTORY
+ {
+ public:
+ explicit FACTORY(Admins & admins) : m_admins(admins) {}
+ BASE_PARSER * create(const Admin & admin) override { return new ADD_ADMIN(admin, m_admins); }
+ static void Register(REGISTRY & registry, Admins & admins)
+ { registry[ToLower(tag)] = new FACTORY(admins); }
+ private:
+ Admins & m_admins;
+ };
+
+ static const char * tag;
+
+ ADD_ADMIN(const Admin & admin, Admins & admins)
+ : BASE_PARSER(admin, tag), m_admins(admins) {}
+ int Start(void * data, const char * el, const char ** attr) override;