Bitcoin
|
#include <server.h>
Public Member Functions | |
CRPCTable () | |
std::string | help (const std::string &name, const JSONRPCRequest &helpreq) const |
UniValue | execute (const JSONRPCRequest &request) const |
std::vector< std::string > | listCommands () const |
bool | appendCommand (const std::string &name, const CRPCCommand *pcmd) |
bool | removeCommand (const std::string &name, const CRPCCommand *pcmd) |
Private Attributes | |
std::map< std::string, std::vector< const CRPCCommand * > > | mapCommands |
Bitcoin RPC command dispatcher.
CRPCTable::CRPCTable | ( | ) |
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.
UniValue CRPCTable::execute | ( | const JSONRPCRequest & | request | ) | const |
Execute a method.
request | The JSONRPCRequest to execute |
an | exception (UniValue) when an error happens. |
std::string CRPCTable::help | ( | const std::string & | name, |
const JSONRPCRequest & | helpreq | ||
) | const |
std::vector< std::string > CRPCTable::listCommands | ( | ) | const |
Returns a list of registered commands
bool CRPCTable::removeCommand | ( | const std::string & | name, |
const CRPCCommand * | pcmd | ||
) |
|
private |