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>
21 #ifndef __STG_SGCONFIG_PARSER_SERVICES_H__
22 #define __STG_SGCONFIG_PARSER_SERVICES_H__
26 #include "stg/service_conf.h"
28 #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 SERVICE_CONF_RES m_service;
167 SERVICES & m_services;
172 } // namespace PARSER