30#ifndef PT_JSONRPC_CLIENT_H
31#define PT_JSONRPC_CLIENT_H
33#include <Pt/JsonRpc/Api.h>
34#include <Pt/JsonRpc/Fault.h>
35#include <Pt/JsonRpc/Formatter.h>
36#include <Pt/Remoting/Client.h>
37#include <Pt/Json/JsonReader.h>
38#include <Pt/Json/JsonWriter.h>
39#include <Pt/Composer.h>
40#include <Pt/Decomposer.h>
41#include <Pt/Utf8Codec.h>
42#include <Pt/TextStream.h>
43#include <Pt/NonCopyable.h>
78 virtual void onBeginCall(
Composer& r, Remoting::RemoteCall& method,
Decomposer** argv,
unsigned argc);
80 virtual void onEndCall();
82 virtual void onCall(
Composer& r, Remoting::RemoteCall& method,
Decomposer** argv,
unsigned argc);
173 std::string _faultMessage;
Composes types during serialization.
Definition Composer.h:101
Manages the decomposition of types during serialization.
Definition Decomposer.h:121
virtual void onBeginInvoke()=0
Begin an asynchronous invocation.
virtual void onEndInvoke()=0
End an asynchronous invocation.
void beginResult(std::istream &is)
Begin parsing a JSON-RPC response from a stream.
virtual void onCancel()
Cancels the remote procedure call.
void finishMessage()
Finish formatting the request.
void processResult(std::istream &is)
Parse the entire response synchronously.
bool advanceMessage()
Continue formatting the request.
void setProcedure(const ProcedureDeclaration *decl)
Set procedure declaration for named parameters.
virtual ~Client()
Destructor.
void setFault(int rc, const char *msg)
Mark the current procedure as failed.
virtual void onInvoke()=0
Perform a synchronous invocation.
bool parseResult()
Parse available response data.
bool isFailed() const
Indicates if the procedure has failed.
void beginMessage(std::ostream &os)
Begin formatting a JSON-RPC request to a stream.
JSON-RPC fault exception.
Definition Fault.h:44
Maps parameter names to positional indices for named parameters.
Definition ProcedureDeclaration.h:49
Reads JSON as a Stream of Nodes.
Definition JsonReader.h:51
Writes JSON to a text stream.
Definition JsonWriter.h:46
JSON document node.
Definition Node.h:52
A client for remote procedure calls.
Definition Client.h:48
Convert between unicode and UTF-8.
Definition Utf8Codec.h:44
JSON-RPC 2.0 services and clients.
Core module.
Definition Allocator.h:33