8 #include "configproto.h"
12 extern "C" PLUGIN * GetPlugin();
16 //-----------------------------------------------------------------------------
17 class STG_CONFIG_SETTINGS {
19 STG_CONFIG_SETTINGS();
20 virtual ~STG_CONFIG_SETTINGS() {}
21 const string & GetStrError() const;
22 int ParseSettings(const MODULE_SETTINGS & s);
25 int ParseIntInRange(const string & str, int min, int max, int * val);
29 //-----------------------------------------------------------------------------
30 class STG_CONFIG: public PLUGIN {
33 virtual ~STG_CONFIG() {}
35 void SetUsers(USERS * u) { users = u; }
36 void SetTariffs(TARIFFS * t) { tariffs = t; }
37 void SetAdmins(ADMINS * a) { admins = a; }
38 void SetStore(STORE * s) { store = s; }
39 void SetTraffcounter(TRAFFCOUNTER *) {}
40 void SetStgSettings(const SETTINGS * s) { stgConfigSettings = s; }
41 void SetSettings(const MODULE_SETTINGS & s) { settings = s; }
46 int Reload() { return 0; }
47 bool IsRunning() { return running; }
49 const string & GetStrError() const { return errorStr; }
50 string GetVersion() const;
51 uint16_t GetStartPosition() const;
52 uint16_t GetStopPosition() const;
55 static void * Run(void *);
57 bool PrepareNetwork();
58 bool FinalizeNetwork();
59 void AcceptConnection();
61 mutable string errorStr;
62 STG_CONFIG_SETTINGS stgConfigSettings;
71 MODULE_SETTINGS settings;
72 const SETTINGS * stgSettings;
74 std::list<ConnectionThread *> connections;
78 //-----------------------------------------------------------------------------