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>
51 class ProcedureDeclaration;
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;
187 #endif // PT_JSONRPC_CLIENT_H
Core module.
Definition: Allocator.h:33
virtual void onCancel()
Cancels the remote procedure call.
Manages the decomposition of types during serialization.
Definition: Decomposer.h:44
Convert between unicode and UTF-8.
Definition: Utf8Codec.h:44
Maps parameter names to positional indices for named parameters.
Definition: ProcedureDeclaration.h:49
virtual void onEndInvoke()=0
End an asynchronous invocation.
void beginMessage(std::ostream &os)
Begin formatting a JSON-RPC request to a stream.
void beginResult(std::istream &is)
Begin parsing a JSON-RPC response from a stream.
JSON document node.
Definition: Node.h:52
virtual void onBeginInvoke()=0
Begin an asynchronous invocation.
Reads JSON as a Stream of Nodes.
Definition: JsonReader.h:51
void setFault(int rc, const char *msg)
Mark the current procedure as failed.
void setProcedure(const ProcedureDeclaration *decl)
Set procedure declaration for named parameters.
void finishMessage()
Finish formatting the request.
A client for JSON-RPC 2.0 remote procedure calls.
Definition: Client.h:56
Composes types during serialization.
Definition: Composer.h:43
bool parseResult()
Parse available response data.
A client for remote procedure calls.
Definition: Client.h:48
virtual void onInvoke()=0
Perform a synchronous invocation.
virtual ~Client()
Destructor.
bool isFailed() const
Indicates if the procedure has failed.
JSON-RPC fault exception.
Definition: Fault.h:44
bool advanceMessage()
Continue formatting the request.
void processResult(std::istream &is)
Parse the entire response synchronously.
Writes JSON to a text stream.
Definition: JsonWriter.h:46