diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-12-01 00:36:36 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-03-29 23:29:42 +0200 |
commit | 8dbb87a3932f81e23ba7afd865b9aeeb535f0c20 (patch) | |
tree | 2b1376e9bb8f6792946c6fabdffdc6a5a73fd8d2 /src/rpc/request.h | |
parent | 95cccf8a4b392959c1fd7ec0647e04eb13880865 (diff) |
refactor: replace util::Ref by std::any (C++17)
Diffstat (limited to 'src/rpc/request.h')
-rw-r--r-- | src/rpc/request.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rpc/request.h b/src/rpc/request.h index 27d06f3c92..e1569673f6 100644 --- a/src/rpc/request.h +++ b/src/rpc/request.h @@ -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) { |