2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Author : Maxim Mamontov <faust@stargazer.dp.ua>
25 #include "stg/service_conf.h"
27 #include "stg/common.h"
39 class GET_SERVICES: public BASE_PARSER
42 class FACTORY : public BASE_PARSER::FACTORY
45 FACTORY(const Services & services) : m_services(services) {}
46 virtual BASE_PARSER * create(const Admin & admin) { return new GET_SERVICES(admin, m_services); }
47 static void Register(REGISTRY & registry, const Services & services)
48 { registry[ToLower(tag)] = new FACTORY(services); }
50 const Services & m_services;
53 static const char * tag;
55 GET_SERVICES(const Admin & admin, const Services & services)
56 : BASE_PARSER(admin, tag), m_services(services) {}
59 const Services & m_services;
64 class GET_SERVICE: public BASE_PARSER
67 class FACTORY : public BASE_PARSER::FACTORY
70 FACTORY(const Services & services) : m_services(services) {}
71 virtual BASE_PARSER * create(const Admin & admin) { return new GET_SERVICE(admin, m_services); }
72 static void Register(REGISTRY & registry, Services & services)
73 { registry[ToLower(tag)] = new FACTORY(services); }
75 const Services & m_services;
78 static const char * tag;
80 GET_SERVICE(const Admin & admin, const Services & services)
81 : BASE_PARSER(admin, tag), m_services(services) {}
82 int Start(void * data, const char * el, const char ** attr);
86 const Services & m_services;
91 class ADD_SERVICE: public BASE_PARSER
94 class FACTORY : public BASE_PARSER::FACTORY
97 FACTORY(Services & services) : m_services(services) {}
98 virtual BASE_PARSER * create(const Admin & admin) { return new ADD_SERVICE(admin, m_services); }
99 static void Register(REGISTRY & registry, Services & services)
100 { registry[ToLower(tag)] = new FACTORY(services); }
102 Services & m_services;
105 static const char * tag;
107 ADD_SERVICE(const Admin & admin, Services & services)
108 : BASE_PARSER(admin, tag), m_services(services) {}
109 int Start(void * data, const char * el, const char ** attr);
113 Services & m_services;
118 class DEL_SERVICE: public BASE_PARSER
121 class FACTORY : public BASE_PARSER::FACTORY
124 FACTORY(Services & services) : m_services(services) {}
125 virtual BASE_PARSER * create(const Admin & admin) { return new DEL_SERVICE(admin, m_services); }
126 static void Register(REGISTRY & registry, Services & services)
127 { registry[ToLower(tag)] = new FACTORY(services); }
129 Services & m_services;
132 static const char * tag;
134 DEL_SERVICE(const Admin & admin, Services & services)
135 : BASE_PARSER(admin, tag), m_services(services) {}
136 int Start(void * data, const char * el, const char ** attr);
140 Services & m_services;
145 class CHG_SERVICE: public BASE_PARSER
148 class FACTORY : public BASE_PARSER::FACTORY
151 FACTORY(Services & services) : m_services(services) {}
152 virtual BASE_PARSER * create(const Admin & admin) { return new CHG_SERVICE(admin, m_services); }
153 static void Register(REGISTRY & registry, Services & services)
154 { registry[ToLower(tag)] = new FACTORY(services); }
156 Services & m_services;
159 static const char * tag;
161 CHG_SERVICE(const Admin & admin, Services & services)
162 : BASE_PARSER(admin, tag), m_services(services) {}
163 int Start(void * data, const char * el, const char ** attr);
166 ServiceConfOpt m_service;
167 Services & m_services;
172 } // namespace PARSER