X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..4931ba9476c58923e2f9020bce6bc1a7ca40aaed:/projects/stargazer/plugin_runner.h diff --git a/projects/stargazer/plugin_runner.h b/projects/stargazer/plugin_runner.h index 2889300d..412c5141 100644 --- a/projects/stargazer/plugin_runner.h +++ b/projects/stargazer/plugin_runner.h @@ -26,29 +26,31 @@ #ifndef PLUGIN_RUNNER_H #define PLUGIN_RUNNER_H -#include + #include -#include "base_plugin.h" -#include "base_settings.h" -#include "traffcounter.h" -#include "tariffs.h" -#include "admins.h" -#include "users.h" +#include "stg/module_settings.h" +#include "stg/plugin.h" +#include "stg/os_int.h" + +class SETTINGS_IMPL; +class ADMINS_IMPL; +class TARIFFS_IMPL; +class USERS_IMPL; +class TRAFFCOUNTER; +class STORE; -using namespace std; //----------------------------------------------------------------------------- -class PLUGIN_RUNNER -{ +class PLUGIN_RUNNER { public: - PLUGIN_RUNNER(const string & pluginFileName, + PLUGIN_RUNNER(const std::string & pluginFileName, const MODULE_SETTINGS & ms, - ADMINS * admins, - TARIFFS * tariffs, - USERS * users, + ADMINS_IMPL * admins, + TARIFFS_IMPL * tariffs, + USERS_IMPL * users, TRAFFCOUNTER * tc, - BASE_STORE * store, - const SETTINGS * s); + STORE * store, + const SETTINGS_IMPL * s); PLUGIN_RUNNER(const PLUGIN_RUNNER & rvalue); ~PLUGIN_RUNNER(); @@ -60,36 +62,34 @@ public: int Restart(); bool IsRunning(); - const string & GetStrError() const; - BASE_PLUGIN * GetPlugin(); - const string & GetFileName() const { return pluginFileName; }; + const std::string & GetStrError() const { return errorStr; } + PLUGIN * GetPlugin(); + const std::string & GetFileName() const { return pluginFileName; } int Load(); int Unload(); - uint16_t GetStartPosition() const; - uint16_t GetStopPosition() const; + uint16_t GetStartPosition() const { return plugin->GetStartPosition(); } + uint16_t GetStopPosition() const { return plugin->GetStopPosition(); } private: - string pluginFileName; - string pluginSettingFileName; + std::string pluginFileName; + std::string pluginSettingFileName; - BASE_PLUGIN * plugin; - int isPluginLoaded; - string errorStr; + PLUGIN * plugin; + bool isPluginLoaded; + std::string errorStr; void * libHandle; bool isRunning; - ADMINS * admins; - TARIFFS * tariffs; - USERS * users; - BASE_STORE * store; + ADMINS_IMPL * admins; + TARIFFS_IMPL * tariffs; + USERS_IMPL * users; + STORE * store; TRAFFCOUNTER * traffCnt; - const SETTINGS * stgSettings; + const SETTINGS_IMPL * stgSettings; MODULE_SETTINGS modSettings; }; //----------------------------------------------------------------------------- #endif //PLUGIN_RUNNER_H - -