mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
refactor: replace util::Ref by std::any (C++17)
This commit is contained in:
@@ -6,14 +6,11 @@
|
||||
#ifndef BITCOIN_RPC_REQUEST_H
|
||||
#define BITCOIN_RPC_REQUEST_H
|
||||
|
||||
#include <any>
|
||||
#include <string>
|
||||
|
||||
#include <univalue.h>
|
||||
|
||||
namespace util {
|
||||
class Ref;
|
||||
} // namespace util
|
||||
|
||||
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);
|
||||
UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id);
|
||||
std::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id);
|
||||
@@ -38,14 +35,14 @@ public:
|
||||
std::string URI;
|
||||
std::string authUser;
|
||||
std::string peerAddr;
|
||||
const util::Ref& context;
|
||||
const std::any& context;
|
||||
|
||||
explicit JSONRPCRequest(const util::Ref& context) : id(NullUniValue), params(NullUniValue), context(context) {}
|
||||
explicit JSONRPCRequest(const std::any& context) : id(NullUniValue), params(NullUniValue), context(context) {}
|
||||
|
||||
//! Initializes request information from another request object and the
|
||||
//! given context. The implementation should be updated if any members are
|
||||
//! added or removed above.
|
||||
JSONRPCRequest(const JSONRPCRequest& other, const util::Ref& context)
|
||||
JSONRPCRequest(const JSONRPCRequest& other, const std::any& context)
|
||||
: id(other.id), strMethod(other.strMethod), params(other.params), mode(other.mode), URI(other.URI),
|
||||
authUser(other.authUser), peerAddr(other.peerAddr), context(context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user