30#ifndef PT_JSONRPC_RESPONDER_H
31#define PT_JSONRPC_RESPONDER_H
33#include <Pt/JsonRpc/Api.h>
34#include <Pt/JsonRpc/Fault.h>
35#include <Pt/JsonRpc/Formatter.h>
36#include <Pt/Remoting/Responder.h>
37#include <Pt/Json/JsonReader.h>
38#include <Pt/Json/JsonWriter.h>
39#include <Pt/TextStream.h>
40#include <Pt/NonCopyable.h>
41#include <Pt/Utf8Codec.h>
161 std::string _methodName;
Composes types during serialization.
Definition Composer.h:101
Manages the decomposition of types during serialization.
Definition Decomposer.h:121
JSON-RPC fault exception.
Definition Fault.h:44
Maps parameter names to positional indices for named parameters.
Definition ProcedureDeclaration.h:49
Responder(const ServiceDeclaration &decl, Remoting::ServiceDefinition &def)
Construct with ServiceDeclaration and ServiceDefinition.
virtual ~Responder()
Destructor.
virtual void onCancel()
Cancels all operations.
void finishMessage()
Execute the service procedure synchronously.
void beginMessage(std::istream &is)
Begin parsing a JSON-RPC request from a stream.
void beginFault(std::ostream &os, const Fault &fault)
Begin formatting a JSON-RPC error response.
void beginResult(std::ostream &os)
Begin formatting a JSON-RPC success response.
virtual void onReady()
The service procedure has finished.
void setFault(int rc, const char *msg)
Mark the procedure as failed.
bool advanceResult()
Continue formatting the result.
bool parseMessage()
Parse available data from the input stream.
void finishResult()
Finish formatting the result response.
bool isFailed() const
Indicates if the procedure has failed.
virtual void onFault(const Fault &fault)=0
The service procedure has failed.
virtual void onResult()=0
The service procedure has finished.
void finishMessage(System::EventLoop &loop)
Execute the service procedure after parsing completes.
Declares named parameter mappings for JSON-RPC procedures.
Definition ServiceDeclaration.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
Dispatches requests to a service procedure.
Definition Responder.h:50
Remote service definition.
Definition ServiceDefinition.h:59
Event loop of a thread or process.
Definition EventLoop.h:83
Convert between unicode and UTF-8.
Definition Utf8Codec.h:44
JSON-RPC 2.0 services and clients.
Core module.
Definition Allocator.h:33