8 #include "stg/plugin.h"
10 #include "stg/logger.h"
11 #include "configproto.h"
13 class STG_CONFIG_SETTINGS {
15 STG_CONFIG_SETTINGS() : errorStr(), port(0) {}
16 virtual ~STG_CONFIG_SETTINGS() {}
17 const std::string & GetStrError() const { return errorStr; }
18 int ParseSettings(const MODULE_SETTINGS & s);
19 uint16_t GetPort() const { return port; }
24 //-----------------------------------------------------------------------------
25 class STG_CONFIG :public PLUGIN {
28 virtual ~STG_CONFIG(){}
30 void SetUsers(USERS * u) { users = u; }
31 void SetTariffs(TARIFFS * t) { tariffs = t; }
32 void SetAdmins(ADMINS * a) { admins = a; }
33 void SetStore(STORE * s) { store = s; }
34 void SetStgSettings(const SETTINGS * s) { stgSettings = s; }
35 void SetSettings(const MODULE_SETTINGS & s) { settings = s; }
40 int Reload() { return 0; }
41 bool IsRunning() { return isRunning; }
43 const std::string & GetStrError() const { return errorStr; }
44 std::string GetVersion() const;
45 uint16_t GetStartPosition() const { return 20; }
46 uint16_t GetStopPosition() const { return 20; }
49 STG_CONFIG(const STG_CONFIG & rvalue);
50 STG_CONFIG & operator=(const STG_CONFIG & rvalue);
52 static void * Run(void *);
54 mutable std::string errorStr;
55 STG_CONFIG_SETTINGS stgConfigSettings;
65 MODULE_SETTINGS settings;
66 const SETTINGS * stgSettings;
68 //-----------------------------------------------------------------------------