X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c0fff5a4f4e765e5bb9f01a5d380cbdc098d04e6..2574a28cbf000603bc31f61593dbf061ff56c1d5:/include/stg/plugin.h diff --git a/include/stg/plugin.h b/include/stg/plugin.h index 2deabcc3..9e0b362c 100644 --- a/include/stg/plugin.h +++ b/include/stg/plugin.h @@ -18,53 +18,46 @@ * Author : Boris Mikhailenko */ -/* - $Revision: 1.12 $ - $Date: 2010/03/04 11:53:14 $ - $Author: faust $ -*/ - - -#ifndef PLUGIN_H -#define PLUGIN_H +#pragma once #include - -#include "noncopyable.h" -#include "os_int.h" -#include "admins.h" -#include "users.h" -#include "tariffs.h" -#include "services.h" -#include "corporations.h" - -class TRAFFCOUNTER; -class SETTINGS; -class STORE; -struct MODULE_SETTINGS; - -class PLUGIN : private NONCOPYABLE { -public: - virtual ~PLUGIN() {} - virtual void SetUsers(USERS *) {} - virtual void SetTariffs(TARIFFS *) {} - virtual void SetAdmins(ADMINS *) {} - virtual void SetServices(SERVICES *) {} - virtual void SetCorporations(CORPORATIONS *) {} - virtual void SetTraffcounter(TRAFFCOUNTER *) {} - virtual void SetStore(STORE *) {} - virtual void SetStgSettings(const SETTINGS *) {} - virtual void SetSettings(const MODULE_SETTINGS &) {} - virtual int ParseSettings() = 0; - - virtual int Start() = 0; - virtual int Stop() = 0; - virtual int Reload(const MODULE_SETTINGS &) = 0; - virtual bool IsRunning() = 0; - virtual const std::string & GetStrError() const = 0; - virtual std::string GetVersion() const = 0; - virtual uint16_t GetStartPosition() const = 0; - virtual uint16_t GetStopPosition() const = 0; +#include + +namespace STG +{ + +struct TraffCounter; +struct Settings; +struct Store; +struct Admins; +class Users; +class Tariffs; +struct Services; +struct Corporations; +struct ModuleSettings; + +struct Plugin { + virtual ~Plugin() = default; + + virtual void SetUsers(Users*) {} + virtual void SetTariffs(Tariffs*) {} + virtual void SetAdmins(Admins*) {} + virtual void SetServices(Services*) {} + virtual void SetCorporations(Corporations*) {} + virtual void SetTraffcounter(TraffCounter*) {} + virtual void SetStore(Store*) {} + virtual void SetStgSettings(const Settings*) {} + virtual void SetSettings(const ModuleSettings&) {} + virtual int ParseSettings() = 0; + + virtual int Start() = 0; + virtual int Stop() = 0; + virtual int Reload(const ModuleSettings&) = 0; + virtual bool IsRunning() = 0; + virtual const std::string& GetStrError() const = 0; + virtual std::string GetVersion() const = 0; + virtual uint16_t GetStartPosition() const = 0; + virtual uint16_t GetStopPosition() const = 0; }; -#endif +}