]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/sgconfig-ng/stgconfig.h
Rename BASE_AUTH and BASE_STORE to AUTH and STORE
[stg.git] / projects / stargazer / plugins / configuration / sgconfig-ng / stgconfig.h
1 #ifndef __STGCONFIG_H__
2 #define __STGCONFIG_H__
3
4 #include <string>
5
6 #include "plugin.h"
7 #include "os_int.h"
8 #include "main_thread.h"
9
10 #define PLUGIN_VERSION "stgconfig v.2.0"
11
12 namespace boost {
13     class thread;
14 };
15
16 class USERS;
17 class TARIFFS;
18 class ADMINS;
19 class STORE;
20 class TRAFFCOUNTER;
21 class SETTINGS;
22
23 class STGCONFIG2 : public PLUGIN {
24 public:
25     STGCONFIG2();
26     virtual ~STGCONFIG2();
27
28     void                SetUsers(USERS * u) { users = u; }
29     void                SetTariffs(TARIFFS * t) { tariffs = t; }
30     void                SetAdmins(ADMINS * a) { admins = a; }
31     void                SetStore(STORE * s) { store = s; }
32     void                SetTraffcounter(TRAFFCOUNTER *) {}
33     void                SetStgSettings(const SETTINGS * s) { stgSettings = s; }
34     void                SetSettings(const MODULE_SETTINGS & s) { modSettings = s; }
35     int                 ParseSettings();
36
37     int                 Start();
38     int                 Stop();
39     int                 Reload() { return 0; }
40     bool                IsRunning();
41
42     const std::string & GetStrError() const { return errorStr; }
43     const std::string   GetVersion() const { return PLUGIN_VERSION; }
44     uint16_t            GetStartPosition() const { return 220; }
45     uint16_t            GetStopPosition() const { return 220; }
46
47 private:
48     USERS * users;
49     TARIFFS * tariffs;
50     ADMINS * admins;
51     STORE * store;
52     const SETTINGS * stgSettings;
53     MODULE_SETTINGS modSettings;
54
55     MAIN_THREAD ct;
56
57     mutable std::string errorStr;
58
59     boost::thread * thread;
60
61 };
62
63 extern "C" PLUGIN * GetPlugin();
64
65 #endif