CppCMS
Public Member Functions | Friends
cppcms::rpc::json_call Class Reference

This class represents single call of json-rpc method. More...

#include <cppcms/rpc_json.h>

Inheritance diagram for cppcms::rpc::json_call:
booster::noncopyable

List of all members.

Public Member Functions

 ~json_call ()
std::string method ()
bool notification ()
json::array const & params ()
http::contextcontext ()
void return_result (json::value const &)
void return_error (json::value const &)

Friends

class json_rpc_server

Detailed Description

This class represents single call of json-rpc method.

It is used for handling asynchronous responses only. Similar API is provided in json_rpc_server class for synchronous methods.


Constructor & Destructor Documentation

Destructor. Automatically deletes appropriate context as once it given to user it owns it.


Member Function Documentation

Get context associated with the call. This you may wait on events like async_on_peer_reset of http::context via this member.

Get the name of method that was called

Check if method call is notification only. You should not return a value.

Note: if you do not add restriction when binding json-rpc method on the role of the call you should always check this value. Otherwise trying to call return_result or return_error would throw.

Get call parameters as json::array (vector of json::value)

Complete method response with a error. Throws call_error if the method was called as notification

Complete method response with a result. Throws call_error if the method was called as notification


The documentation for this class was generated from the following file: