Bitcoin
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 JSONRPCRequest &request, UniValue &result, bool last_handler)>
 

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 (const char *category, const char *name, rpcfn_type fn, std::initializer_list< const char * > args)
 Simplified constructor taking plain rpcfn_type function pointer. More...
 

Public Attributes

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

Member Typedef Documentation

◆ Actor

using CRPCCommand::Actor = std::function<bool(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.

Constructor & Destructor Documentation

◆ CRPCCommand() [1/2]

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.

◆ CRPCCommand() [2/2]

CRPCCommand::CRPCCommand ( const char *  category,
const char *  name,
rpcfn_type  fn,
std::initializer_list< const char * >  args 
)
inline

Simplified constructor taking plain rpcfn_type function pointer.

Member Data Documentation

◆ actor

Actor CRPCCommand::actor

◆ argNames

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

◆ category

std::string CRPCCommand::category

◆ name

std::string CRPCCommand::name

◆ unique_id

intptr_t CRPCCommand::unique_id

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