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