Electroneum
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 
39  KV_SERIALIZE(code)
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)
69  KV_SERIALIZE(result)
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)
86  KV_SERIALIZE(result)
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 */
epee::serialization::storage_entry id
::std::string string
Definition: gtest-port.h:1097
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
#define KV_SERIALIZE(varialble)
epee::serialization::storage_entry id
epee::serialization::storage_entry id
epee::serialization::storage_entry id
std::string message("Message requiring signing")
signed __int64 int64_t
Definition: stdint.h:135
#define END_KV_SERIALIZE_MAP()
error
Tracks LMDB error codes.
Definition: error.h:44
#define BEGIN_KV_SERIALIZE_MAP()