#include <Pt/JsonRpc/Client.h>
A client for JSON-RPC 2.0 remote procedure calls.
Inherits Client.
Inherited by HttpClient.
|
|
| Client () |
| | Constructor.
|
|
virtual | ~Client () |
| | Destructor.
|
|
bool | isFailed () const |
| | Indicates if the procedure has failed.
|
| void | setProcedure (const ProcedureDeclaration *decl) |
| | Set procedure declaration for named parameters.
|
|
const RemoteCall * | activeProcedure () const |
| | The currently executing procedure.
|
|
void | cancel () |
| | Cancels the currently executing procedure.
|
|
| virtual void | onCancel () |
| | Cancels the remote procedure call.
|
| virtual void | onBeginInvoke ()=0 |
| | Begin an asynchronous invocation.
|
|
virtual void | onEndInvoke ()=0 |
| | End an asynchronous invocation.
|
| virtual void | onInvoke ()=0 |
| | Perform a synchronous invocation.
|
|
void | beginMessage (std::ostream &os) |
| | Begin formatting a JSON-RPC request to a stream.
|
| bool | advanceMessage () |
| | Continue formatting the request.
|
|
void | finishMessage () |
| | Finish formatting the request.
|
|
void | beginResult (std::istream &is) |
| | Begin parsing a JSON-RPC response from a stream.
|
| bool | parseResult () |
| | Parse available response data.
|
|
void | processResult (std::istream &is) |
| | Parse the entire response synchronously.
|
|
void | setFault (int rc, const char *msg) |
| | Mark the current procedure as failed.
|
| void | setReady () |
| | Parses the XML-RPC result.
|
◆ setProcedure()
If set, parameters will be sent as a JSON object with named keys. If not set, parameters are sent as a JSON array.
◆ onCancel()
| virtual void onCancel |
( |
| ) |
|
|
protectedvirtual |
Derived Clients implement this method to cancel the remote procedure call.
Implements Client.
Reimplemented in HttpClient.
◆ onBeginInvoke()
| virtual void onBeginInvoke |
( |
| ) |
|
|
protectedpure virtual |
Derived Clients implement this to send the formatted request.
Implemented in HttpClient.
◆ onInvoke()
| virtual void onInvoke |
( |
| ) |
|
|
protectedpure virtual |
Derived Clients implement this to send the request and receive the response.
Implemented in HttpClient.
◆ advanceMessage()
- Returns
- true if all parameters are formatted.
◆ parseResult()
- Returns
- true if parsing is complete.
◆ setReady()
This method is used by derived Clients after the XML-RPC result has been parsed by parseResult(). The current RemoteProcedure will receive completion notification to process the result.