Fabcoin Core  0.16.2
P2P Digital Currency
NetFace.h
Go to the documentation of this file.
1 
5 #ifndef JSONRPC_CPP_STUB_DEV_RPC_NETFACE_H_
6 #define JSONRPC_CPP_STUB_DEV_RPC_NETFACE_H_
7 
8 #include "ModularServer.h"
9 
10 namespace dev {
11  namespace rpc {
12  class NetFace : public ServerInterface<NetFace>
13  {
14  public:
16  {
17  this->bindAndAddMethod(jsonrpc::Procedure("net_version", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &dev::rpc::NetFace::net_versionI);
18  this->bindAndAddMethod(jsonrpc::Procedure("net_peerCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &dev::rpc::NetFace::net_peerCountI);
19  this->bindAndAddMethod(jsonrpc::Procedure("net_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &dev::rpc::NetFace::net_listeningI);
20  }
21 
22  inline virtual void net_versionI(const Json::Value &request, Json::Value &response)
23  {
24  (void)request;
25  response = this->net_version();
26  }
27  inline virtual void net_peerCountI(const Json::Value &request, Json::Value &response)
28  {
29  (void)request;
30  response = this->net_peerCount();
31  }
32  inline virtual void net_listeningI(const Json::Value &request, Json::Value &response)
33  {
34  (void)request;
35  response = this->net_listening();
36  }
37  virtual std::string net_version() = 0;
38  virtual std::string net_peerCount() = 0;
39  virtual bool net_listening() = 0;
40  };
41 
42  }
43 }
44 #endif //JSONRPC_CPP_STUB_DEV_RPC_NETFACE_H_
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
virtual bool net_listening()=0
virtual void net_peerCountI(const Json::Value &request, Json::Value &response)
Definition: NetFace.h:27
virtual std::string net_version()=0
void bindAndAddMethod(jsonrpc::Procedure const &_proc, MethodPointer _pointer)
Definition: ModularServer.h:59
virtual std::string net_peerCount()=0
virtual void net_versionI(const Json::Value &request, Json::Value &response)
Definition: NetFace.h:22
Config::Value_type Value
virtual void net_listeningI(const Json::Value &request, Json::Value &response)
Definition: NetFace.h:32