Bitcoin ABC  0.24.7
P2P Digital Currency
Public Types | Public Member Functions | Public Attributes | List of all members
CRPCCommand Class Reference

#include <server.h>

Public Types

using Actor = std::function< bool(const Config &config, const JSONRPCRequest &request, UniValue &result, bool last_handler)>
 RPC method handler reading request and assigning result. More...
 

Public Member Functions

 CRPCCommand (std::string _category, std::string _name, Actor _actor, std::vector< std::string > _args, intptr_t _unique_id)
 Constructor taking Actor callback supporting multiple handlers. More...
 
 CRPCCommand (std::string _category, std::string name_in, RpcMethodFnType _fn, std::vector< std::string > args_in)
 Simplified constructor taking plain RpcMethodFnType function pointer. More...
 
 CRPCCommand (const char *_category, const char *_name, rpcfn_type _fn, std::initializer_list< const char * > _args)
 Simplified constructor taking plain const_rpcfn_type function pointer. More...
 

Public Attributes

std::string category
 
std::string name
 
Actor actor
 
std::vector< std::string > argNames
 
intptr_t unique_id
 

Detailed Description

Definition at line 149 of file server.h.

Member Typedef Documentation

◆ Actor

using CRPCCommand::Actor = std::function<bool(const Config &config, const JSONRPCRequest &request, UniValue &result, bool last_handler)>

RPC method handler reading request and assigning result.

Should return true if request is fully handled, false if it should be passed on to subsequent handlers.

Definition at line 156 of file server.h.

Constructor & Destructor Documentation

◆ CRPCCommand() [1/3]

CRPCCommand::CRPCCommand ( std::string  _category,
std::string  _name,
Actor  _actor,
std::vector< std::string >  _args,
intptr_t  _unique_id 
)
inline

Constructor taking Actor callback supporting multiple handlers.

Definition at line 159 of file server.h.

◆ CRPCCommand() [2/3]

CRPCCommand::CRPCCommand ( std::string  _category,
std::string  name_in,
RpcMethodFnType  _fn,
std::vector< std::string >  args_in 
)
inline

Simplified constructor taking plain RpcMethodFnType function pointer.

Definition at line 166 of file server.h.

◆ CRPCCommand() [3/3]

CRPCCommand::CRPCCommand ( const char *  _category,
const char *  _name,
rpcfn_type  _fn,
std::initializer_list< const char * >  _args 
)
inline

Simplified constructor taking plain const_rpcfn_type function pointer.

Definition at line 181 of file server.h.

Member Data Documentation

◆ actor

Actor CRPCCommand::actor

Definition at line 194 of file server.h.

◆ argNames

std::vector<std::string> CRPCCommand::argNames

Definition at line 195 of file server.h.

◆ category

std::string CRPCCommand::category

Definition at line 192 of file server.h.

◆ name

std::string CRPCCommand::name

Definition at line 193 of file server.h.

◆ unique_id

intptr_t CRPCCommand::unique_id

Definition at line 196 of file server.h.


The documentation for this class was generated from the following file: