Electroneum
Loading...
Searching...
No Matches
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
9namespace epee
10{
11 namespace json_rpc
12 {
13 template<typename t_param>
30
31 struct error
32 {
34 std::string message;
35
36 error(): code(0) {}
37
39 KV_SERIALIZE(code)
42 };
43
49
55
56 template<typename t_param, typename t_error>
57 struct response
58 {
59 std::string jsonrpc;
60 t_param result;
62 t_error error;
63
64 response(): result{}, id(), error{} {}
65
67 KV_SERIALIZE(jsonrpc)
68 KV_SERIALIZE(id)
69 KV_SERIALIZE(result)
72 };
73
74 template<typename t_param>
75 struct response<t_param, dummy_error>
76 {
77 std::string jsonrpc;
78 t_param result;
80
81 response(): result{}, id{} {}
82
84 KV_SERIALIZE(jsonrpc)
85 KV_SERIALIZE(id)
86 KV_SERIALIZE(result)
88 };
89
90 template<typename t_error>
91 struct response<dummy_result, t_error>
92 {
93 std::string jsonrpc;
94 t_error error;
96
97 response(): error{}, id{} {}
98
100 KV_SERIALIZE(jsonrpc)
101 KV_SERIALIZE(id)
104 };
105
107 }
108}
109
110#endif /* JSONRPC_STRUCTS_H */
std::string message("Message requiring signing")
#define KV_SERIALIZE(varialble)
#define END_KV_SERIALIZE_MAP()
#define BEGIN_KV_SERIALIZE_MAP()
response< dummy_result, error > error_response
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
signed __int64 int64_t
Definition stdint.h:135
epee::serialization::storage_entry id
epee::serialization::storage_entry id
epee::serialization::storage_entry id