]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/sgconfig/stgconfig.h
Removed unused variables.
[stg.git] / projects / stargazer / plugins / configuration / sgconfig / stgconfig.h
1 #ifndef STGCONFIG_H
2 #define STGCONFIG_H
3
4 #include "configproto.h"
5
6 #include "stg/plugin.h"
7 #include "stg/logger.h"
8
9 #include <string>
10
11 #include <pthread.h>
12
13 class STG_CONFIG_SETTINGS {
14 public:
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; }
20 private:
21     std::string errorStr;
22     uint16_t    port;
23 };
24 //-----------------------------------------------------------------------------
25 class STG_CONFIG :public PLUGIN {
26 public:
27     STG_CONFIG();
28     virtual ~STG_CONFIG(){}
29
30     void                SetUsers(USERS * users) { config.SetUsers(users); }
31     void                SetTariffs(TARIFFS * tariffs) { config.SetTariffs(tariffs); }
32     void                SetAdmins(ADMINS * admins) { config.SetAdmins(admins); }
33     void                SetStore(STORE * store) { config.SetStore(store); }
34     void                SetStgSettings(const SETTINGS * settings) { config.SetStgSettings(settings); }
35     void                SetSettings(const MODULE_SETTINGS & s) { settings = s; }
36     int                 ParseSettings();
37
38     int                 Start();
39     int                 Stop();
40     int                 Reload() { return 0; }
41     bool                IsRunning() { return isRunning; }
42
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; }
47
48 private:
49     STG_CONFIG(const STG_CONFIG & rvalue);
50     STG_CONFIG & operator=(const STG_CONFIG & rvalue);
51
52     static void *       Run(void *);
53
54     mutable std::string errorStr;
55     STG_CONFIG_SETTINGS stgConfigSettings;
56     pthread_t           thread;
57     bool                nonstop;
58     bool                isRunning;
59     PLUGIN_LOGGER       logger;
60     CONFIGPROTO         config;
61     MODULE_SETTINGS     settings;
62 };
63 //-----------------------------------------------------------------------------
64
65 #endif