]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/rpcconfig/info_methods.h
Merge branch 'stg-2.409-radius'
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / info_methods.h
1 #ifndef __INFO_METHODS_H__
2 #define __INFO_METHODS_H__
3
4 #include <string>
5 #include <vector>
6
7 #include <xmlrpc-c/base.hpp>
8 #include <xmlrpc-c/registry.hpp>
9
10 #include "stg/users.h"
11 #include "stg/tariffs.h"
12
13 // Forward declaration
14 class RPC_CONFIG;
15 class SETTINGS;
16
17 class METHOD_INFO : public xmlrpc_c::method
18 {
19 public:
20     METHOD_INFO(TARIFFS * t,
21                 USERS * u,
22                 size_t df,
23                 const std::vector<std::string> & dn)
24         : tariffs(t),
25           users(u),
26           dayFee(df),
27           dirNames(dn)
28     {
29     }
30
31     void execute(xmlrpc_c::paramList const & paramList,
32                  xmlrpc_c::value *   const   retvalP);
33
34 private:
35     METHOD_INFO(const METHOD_INFO & rvalue);
36     METHOD_INFO & operator=(const METHOD_INFO & rvalue);
37
38     TARIFFS * tariffs;
39     USERS * users;
40     size_t dayFee;
41     const std::vector<std::string> & dirNames;
42 };
43
44 class METHOD_LOGIN : public xmlrpc_c::method
45 {
46 public:
47     explicit METHOD_LOGIN(RPC_CONFIG * c)
48         : config(c)
49     {
50     }
51
52     void execute(xmlrpc_c::paramList const & paramList,
53                  xmlrpc_c::value *   const   retvalP);
54
55 private:
56     METHOD_LOGIN(const METHOD_LOGIN & rvalue);
57     METHOD_LOGIN & operator=(const METHOD_LOGIN & rvalue);
58
59     RPC_CONFIG * config;
60 };
61
62 class METHOD_LOGOUT : public xmlrpc_c::method
63 {
64 public:
65     explicit METHOD_LOGOUT(RPC_CONFIG * c)
66         : config(c)
67     {
68     }
69
70     void execute(xmlrpc_c::paramList const & paramList,
71                  xmlrpc_c::value *   const   retvalP);
72
73 private:
74     METHOD_LOGOUT(const METHOD_LOGOUT & rvalue);
75     METHOD_LOGOUT & operator=(const METHOD_LOGOUT & rvalue);
76
77     RPC_CONFIG * config;
78 };
79
80 #endif