Fabcoin Core  0.16.2
P2P Digital Currency
WhisperFace.h
Go to the documentation of this file.
1 
5 #ifndef JSONRPC_CPP_STUB_DEV_RPC_WHISPERFACE_H_
6 #define JSONRPC_CPP_STUB_DEV_RPC_WHISPERFACE_H_
7 
8 #include "ModularServer.h"
9 
10 namespace dev {
11  namespace rpc {
12  class WhisperFace : public ServerInterface<WhisperFace>
13  {
14  public:
16  {
17  this->bindAndAddMethod(jsonrpc::Procedure("shh_post", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &dev::rpc::WhisperFace::shh_postI);
18  this->bindAndAddMethod(jsonrpc::Procedure("shh_newIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &dev::rpc::WhisperFace::shh_newIdentityI);
19  this->bindAndAddMethod(jsonrpc::Procedure("shh_hasIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::WhisperFace::shh_hasIdentityI);
20  this->bindAndAddMethod(jsonrpc::Procedure("shh_newGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &dev::rpc::WhisperFace::shh_newGroupI);
21  this->bindAndAddMethod(jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &dev::rpc::WhisperFace::shh_addToGroupI);
22  this->bindAndAddMethod(jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &dev::rpc::WhisperFace::shh_newFilterI);
23  this->bindAndAddMethod(jsonrpc::Procedure("shh_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::WhisperFace::shh_uninstallFilterI);
24  this->bindAndAddMethod(jsonrpc::Procedure("shh_getFilterChanges", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::WhisperFace::shh_getFilterChangesI);
25  this->bindAndAddMethod(jsonrpc::Procedure("shh_getMessages", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::WhisperFace::shh_getMessagesI);
26  }
27 
28  inline virtual void shh_postI(const Json::Value &request, Json::Value &response)
29  {
30  response = this->shh_post(request[0u]);
31  }
32  inline virtual void shh_newIdentityI(const Json::Value &request, Json::Value &response)
33  {
34  (void)request;
35  response = this->shh_newIdentity();
36  }
37  inline virtual void shh_hasIdentityI(const Json::Value &request, Json::Value &response)
38  {
39  response = this->shh_hasIdentity(request[0u].asString());
40  }
41  inline virtual void shh_newGroupI(const Json::Value &request, Json::Value &response)
42  {
43  response = this->shh_newGroup(request[0u].asString(), request[1u].asString());
44  }
45  inline virtual void shh_addToGroupI(const Json::Value &request, Json::Value &response)
46  {
47  response = this->shh_addToGroup(request[0u].asString(), request[1u].asString());
48  }
49  inline virtual void shh_newFilterI(const Json::Value &request, Json::Value &response)
50  {
51  response = this->shh_newFilter(request[0u]);
52  }
53  inline virtual void shh_uninstallFilterI(const Json::Value &request, Json::Value &response)
54  {
55  response = this->shh_uninstallFilter(request[0u].asString());
56  }
57  inline virtual void shh_getFilterChangesI(const Json::Value &request, Json::Value &response)
58  {
59  response = this->shh_getFilterChanges(request[0u].asString());
60  }
61  inline virtual void shh_getMessagesI(const Json::Value &request, Json::Value &response)
62  {
63  response = this->shh_getMessages(request[0u].asString());
64  }
65  virtual bool shh_post(const Json::Value& param1) = 0;
66  virtual std::string shh_newIdentity() = 0;
67  virtual bool shh_hasIdentity(const std::string& param1) = 0;
68  virtual std::string shh_newGroup(const std::string& param1, const std::string& param2) = 0;
69  virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0;
70  virtual std::string shh_newFilter(const Json::Value& param1) = 0;
71  virtual bool shh_uninstallFilter(const std::string& param1) = 0;
72  virtual Json::Value shh_getFilterChanges(const std::string& param1) = 0;
73  virtual Json::Value shh_getMessages(const std::string& param1) = 0;
74  };
75 
76  }
77 }
78 #endif //JSONRPC_CPP_STUB_DEV_RPC_WHISPERFACE_H_
virtual std::string shh_addToGroup(const std::string &param1, const std::string &param2)=0
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
virtual void shh_uninstallFilterI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:53
virtual void shh_newFilterI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:49
virtual void shh_hasIdentityI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:37
virtual void shh_postI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:28
virtual Json::Value shh_getFilterChanges(const std::string &param1)=0
void bindAndAddMethod(jsonrpc::Procedure const &_proc, MethodPointer _pointer)
Definition: ModularServer.h:59
virtual void shh_getMessagesI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:61
Config::Value_type Value
virtual std::string shh_newFilter(const Json::Value &param1)=0
virtual std::string shh_newIdentity()=0
virtual bool shh_hasIdentity(const std::string &param1)=0
virtual void shh_newGroupI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:41
virtual bool shh_post(const Json::Value &param1)=0
virtual Json::Value shh_getMessages(const std::string &param1)=0
virtual void shh_newIdentityI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:32
virtual void shh_addToGroupI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:45
virtual bool shh_uninstallFilter(const std::string &param1)=0
virtual void shh_getFilterChangesI(const Json::Value &request, Json::Value &response)
Definition: WhisperFace.h:57
std::string asString(bytes const &_b)
Converts byte array to a string containing the same (binary) data.
Definition: CommonData.h:79
virtual std::string shh_newGroup(const std::string &param1, const std::string &param2)=0