Monero
jsonrpc_structs.h
Go to the documentation of this file.
1 #ifndef JSONRPC_STRUCTS_H
2 #define JSONRPC_STRUCTS_H
3 
4 #include <string>
5 #include <cstdint>
8 
9 namespace epee
10 {
11  namespace json_rpc
12  {
13  template<typename t_param>
14  struct request
15  {
19  t_param params;
20 
21  request(): id{}, params{} {}
22 
25  KV_SERIALIZE(id)
29  };
30 
31  struct error
32  {
35 
36  error(): code(0) {}
37 
42  };
43 
44  struct dummy_error
45  {
48  };
49 
50  struct dummy_result
51  {
54  };
55 
56  template<typename t_param, typename t_error>
57  struct response
58  {
60  t_param result;
62  t_error error;
63 
64  response(): result{}, id(), error{} {}
65 
68  KV_SERIALIZE(id)
72  };
73 
74  template<typename t_param>
75  struct response<t_param, dummy_error>
76  {
78  t_param result;
80 
81  response(): result{}, id{} {}
82 
85  KV_SERIALIZE(id)
88  };
89 
90  template<typename t_error>
91  struct response<dummy_result, t_error>
92  {
94  t_error error;
96 
97  response(): error{}, id{} {}
98 
101  KV_SERIALIZE(id)
104  };
105 
107  }
108 }
109 
110 #endif /* JSONRPC_STRUCTS_H */
error()
Definition: jsonrpc_structs.h:36
int64_t code
Definition: jsonrpc_structs.h:33
std::string jsonrpc
Definition: jsonrpc_structs.h:59
std::string jsonrpc
Definition: jsonrpc_structs.h:16
Definition: jsonrpc_structs.h:31
t_error error
Definition: jsonrpc_structs.h:94
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:18
::std::string string
Definition: gtest-port.h:1097
request()
Definition: jsonrpc_structs.h:21
boost::variant< uint64_t, uint32_t, uint16_t, uint8_t, int64_t, int32_t, int16_t, int8_t, double, bool, std::string, section, array_entry > storage_entry
Definition: portable_storage_base.h:161
tools::wallet2::message_signature_result_t result
Definition: signature.cpp:62
#define KV_SERIALIZE(varialble)
Definition: keyvalue_serialization.h:120
Definition: jsonrpc_structs.h:50
std::string method
Definition: jsonrpc_structs.h:17
const portMappingElt code
Definition: portlistingparse.c:22
response()
Definition: jsonrpc_structs.h:64
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:95
t_param result
Definition: jsonrpc_structs.h:78
std::string message
Definition: jsonrpc_structs.h:34
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:79
epee::serialization::storage_entry id
Definition: jsonrpc_structs.h:61
response()
Definition: jsonrpc_structs.h:81
Definition: jsonrpc_structs.h:44
Definition: jsonrpc_structs.h:14
TODO: (mj-xmr) This will be reduced in an another PR.
Definition: byte_slice.h:39
std::string jsonrpc
Definition: jsonrpc_structs.h:77
t_error error
Definition: jsonrpc_structs.h:62
response()
Definition: jsonrpc_structs.h:97
signed __int64 int64_t
Definition: stdint.h:135
t_param result
Definition: jsonrpc_structs.h:60
t_param params
Definition: jsonrpc_structs.h:19
#define END_KV_SERIALIZE_MAP()
Definition: keyvalue_serialization.h:118
std::string jsonrpc
Definition: jsonrpc_structs.h:93
error
Tracks LMDB error codes.
Definition: error.h:44
tuple message
Definition: gtest_output_test.py:331
#define BEGIN_KV_SERIALIZE_MAP()
Definition: keyvalue_serialization.h:43
Definition: jsonrpc_structs.h:57