X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b35652569fcfeaa0ca1679dfb30648b008de61ed..4213664cbb7a96bee57fec935878348cebbc7d40:/include/stg/services.h?ds=sidebyside diff --git a/include/stg/services.h b/include/stg/services.h index 140391d0..5d3b2bee 100644 --- a/include/stg/services.h +++ b/include/stg/services.h @@ -18,30 +18,32 @@ * Author : Maxim Mamontov */ -#ifndef SERVICES_H -#define SERVICES_H - -#include "service_conf.h" +#pragma once #include -class ADMIN; - -class SERVICES { -public: - virtual ~SERVICES() {} - 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) const = 0; - virtual bool Find(const std::string & name, SERVICE_CONF_RES * service) const = 0; - virtual bool Exists(const std::string & name) const = 0; - virtual const std::string & GetStrError() const = 0; +namespace STG +{ + +struct Admin; +struct ServiceConf; +struct ServiceConfOpt; + +struct Services { + virtual ~Services() = default; + + virtual int Add(const ServiceConf& service, const Admin* admin) = 0; + virtual int Del(const std::string& name, const Admin* admin) = 0; + virtual int Change(const ServiceConf& service, const Admin* admin) = 0; + virtual bool Find(const std::string& name, ServiceConf* service) const = 0; + virtual bool Find(const std::string& name, ServiceConfOpt* service) const = 0; + virtual bool Exists(const std::string& name) const = 0; + virtual const std::string& GetStrError() const = 0; virtual size_t Count() const = 0; virtual int OpenSearch() const = 0; - virtual int SearchNext(int, SERVICE_CONF * service) const = 0; + virtual int SearchNext(int, ServiceConf* service) const = 0; virtual int CloseSearch(int) const = 0; }; -#endif +}