]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/sgconfig-ng/stgconfig.h
Merge branch 'naffanya-dev'
[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                SetStgSettings(const SETTINGS * s) { stgSettings = s; }
33     void                SetSettings(const MODULE_SETTINGS & s) { modSettings = s; }
34     int                 ParseSettings();
35
36     int                 Start();
37     int                 Stop();
38     int                 Reload() { return 0; }
39     bool                IsRunning();
40
41     const std::string & GetStrError() const { return errorStr; }
42     const std::string   GetVersion() const { return PLUGIN_VERSION; }
43     uint16_t            GetStartPosition() const { return 20; }
44     uint16_t            GetStopPosition() const { return 20; }
45
46 private:
47     USERS * users;
48     TARIFFS * tariffs;
49     ADMINS * admins;
50     STORE * store;
51     const SETTINGS * stgSettings;
52     MODULE_SETTINGS modSettings;
53
54     MAIN_THREAD ct;
55
56     mutable std::string errorStr;
57
58     boost::thread * thread;
59
60 };
61
62 extern "C" PLUGIN * GetPlugin();
63
64 #endif