Bitcoin ABC  0.22.12
P2P Digital Currency
httprpc.h
Go to the documentation of this file.
1 // Copyright (c) 2015 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_HTTPRPC_H
6 #define BITCOIN_HTTPRPC_H
7 
8 #include <httpserver.h>
9 #include <rpc/server.h>
10 
11 class Config;
12 
13 namespace util {
14 class Ref;
15 } // namespace util
16 
18 private:
21 
22  bool ProcessHTTPRequest(HTTPRequest *request);
23 
24 public:
26 
27  HTTPRPCRequestProcessor(Config &configIn, RPCServer &rpcServerIn,
28  const util::Ref &contextIn)
29  : config(configIn), rpcServer(rpcServerIn), context(contextIn) {}
30 
31  static bool DelegateHTTPRequest(HTTPRPCRequestProcessor *requestProcessor,
32  HTTPRequest *request) {
33  return requestProcessor->ProcessHTTPRequest(request);
34  }
35 };
36 
41 bool StartHTTPRPC(HTTPRPCRequestProcessor &httpRPCRequestProcessor);
42 
44 void InterruptHTTPRPC();
45 
50 void StopHTTPRPC();
51 
56 void StartREST(const util::Ref &context);
57 
59 void InterruptREST();
60 
65 void StopREST();
66 
67 #endif // BITCOIN_HTTPRPC_H
bool StartHTTPRPC(HTTPRPCRequestProcessor &httpRPCRequestProcessor)
Start HTTP RPC subsystem.
Definition: httprpc.cpp:454
Definition: httprpc.h:13
void StopHTTPRPC()
Stop HTTP RPC subsystem.
Definition: httprpc.cpp:479
void StopREST()
Stop HTTP REST subsystem.
Definition: rest.cpp:781
bool ProcessHTTPRequest(HTTPRequest *request)
Definition: httprpc.cpp:289
static bool DelegateHTTPRequest(HTTPRPCRequestProcessor *requestProcessor, HTTPRequest *request)
Definition: httprpc.h:31
Definition: config.h:19
const util::Ref & context
Definition: httprpc.h:25
Class for registering and managing all RPC calls.
Definition: server.h:41
Type-safe dynamic reference.
Definition: ref.h:21
RPCServer & rpcServer
Definition: httprpc.h:20
void StartREST(const util::Ref &context)
Start HTTP REST subsystem.
Definition: rest.cpp:769
void InterruptREST()
Interrupt RPC REST subsystem.
Definition: rest.cpp:779
HTTPRPCRequestProcessor(Config &configIn, RPCServer &rpcServerIn, const util::Ref &contextIn)
Definition: httprpc.h:27
In-flight HTTP request.
Definition: httpserver.h:74
void InterruptHTTPRPC()
Interrupt HTTP RPC subsystem.
Definition: httprpc.cpp:475