]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/rpcconfig/info_methods.h
snma agent -> smux
[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 private:
34     TARIFFS * tariffs;
35     USERS * users;
36     size_t dayFee;
37     const std::vector<std::string> & dirNames;
38 };
39
40 class METHOD_LOGIN : public xmlrpc_c::method
41 {
42 public:
43     METHOD_LOGIN(RPC_CONFIG * c)
44         : config(c)
45     {
46     }
47
48     void execute(xmlrpc_c::paramList const & paramList,
49                  xmlrpc_c::value *   const   retvalP);
50 private:
51     RPC_CONFIG * config;
52 };
53
54 class METHOD_LOGOUT : public xmlrpc_c::method
55 {
56 public:
57     METHOD_LOGOUT(RPC_CONFIG * c)
58         : config(c)
59     {
60     }
61
62     void execute(xmlrpc_c::paramList const & paramList,
63                  xmlrpc_c::value *   const   retvalP);
64 private:
65     RPC_CONFIG * config;
66 };
67
68 #endif