]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/sgconfig-ng/stgconfig.h
28e52d1cb0651b025f6e124599244a6dcc99b40f
[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 "base_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 BASE_STORE;
20 class TRAFFCOUNTER;
21 class SETTINGS;
22
23 class STGCONFIG2 : public BASE_PLUGIN
24 {
25 public:
26     STGCONFIG2();
27     virtual ~STGCONFIG2();
28
29     void                SetUsers(USERS * u) { users = u; };
30     void                SetTariffs(TARIFFS * t) { tariffs = t; };
31     void                SetAdmins(ADMINS * a) { admins = a; };
32     void                SetStore(BASE_STORE * s) { store = s; };
33     void                SetTraffcounter(TRAFFCOUNTER *) {};
34     void                SetStgSettings(const SETTINGS * s) { stgSettings = s; };
35     void                SetSettings(const MODULE_SETTINGS & s) { modSettings = s; };
36     int                 ParseSettings();
37
38     int                 Start();
39     int                 Stop();
40     int                 Reload() { return 0; };
41     bool                IsRunning();
42
43     const std::string & GetStrError() const { return errorStr; };
44     const std::string   GetVersion() const { return PLUGIN_VERSION; };
45     uint16_t            GetStartPosition() const { return 220; };
46     uint16_t            GetStopPosition() const { return 220; };
47
48 private:
49     USERS * users;
50     TARIFFS * tariffs;
51     ADMINS * admins;
52     BASE_STORE * store;
53     const SETTINGS * stgSettings;
54     MODULE_SETTINGS modSettings;
55
56     MAIN_THREAD ct;
57
58     mutable std::string errorStr;
59
60     boost::thread * thread;
61
62 };
63
64 extern "C" BASE_PLUGIN * GetPlugin();
65
66 #endif