Bitcoin Core  0.18.99
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
CRPCTable Class Reference

Bitcoin RPC command dispatcher. More...

#include <server.h>

Public Member Functions

 CRPCTable ()
 
std::string help (const std::string &name, const JSONRPCRequest &helpreq) const
 
UniValue execute (const JSONRPCRequest &request) const
 Execute a method. More...
 
std::vector< std::string > listCommands () const
 Returns a list of registered commands. More...
 
bool appendCommand (const std::string &name, const CRPCCommand *pcmd)
 Appends a CRPCCommand to the dispatch table. More...
 
bool removeCommand (const std::string &name, const CRPCCommand *pcmd)
 

Private Attributes

std::map< std::string, std::vector< const CRPCCommand * > > mapCommands
 

Detailed Description

Bitcoin RPC command dispatcher.

Definition at line 135 of file server.h.

Constructor & Destructor Documentation

◆ CRPCTable()

CRPCTable::CRPCTable ( )

Definition at line 250 of file server.cpp.

Member Function Documentation

◆ appendCommand()

bool CRPCTable::appendCommand ( const std::string &  name,
const CRPCCommand pcmd 
)

Appends a CRPCCommand to the dispatch table.

Returns false if RPC server is already running (dump concurrency protection).

Commands with different method names but the same unique_id will be considered aliases, and only the first registered method name will show up in the help text command listing. Aliased commands do not have to have the same behavior. Server and client code can distinguish between calls based on method name, and aliased commands can also register different names, types, and numbers of parameters.

Definition at line 262 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

UniValue CRPCTable::execute ( const JSONRPCRequest request) const

Execute a method.

Parameters
requestThe JSONRPCRequest to execute
Returns
Result of the call.
Exceptions
anexception (UniValue) when an error happens.

Definition at line 454 of file server.cpp.

Here is the call graph for this function:

◆ help()

std::string CRPCTable::help ( const std::string &  name,
const JSONRPCRequest helpreq 
) const

Definition at line 78 of file server.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listCommands()

std::vector< std::string > CRPCTable::listCommands ( ) const

Returns a list of registered commands.

Returns
List of registered commands.

Definition at line 494 of file server.cpp.

◆ removeCommand()

bool CRPCTable::removeCommand ( const std::string &  name,
const CRPCCommand pcmd 
)

Definition at line 271 of file server.cpp.

Member Data Documentation

◆ mapCommands

std::map<std::string, std::vector<const CRPCCommand*> > CRPCTable::mapCommands
private

Definition at line 138 of file server.h.


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