Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::rpc::variant_connection Class Reference

Implements JSON-RPC 2.0 over a set of io streams. More...

#include <variant_connection.hpp>

Public Types

typedef std::function< variant(const variants &)> method
 
typedef std::function< variant(const variant_object &)> named_param_method
 

Public Member Functions

 variant_connection (fc::variant_stream::ptr in, fc::variant_stream::ptr out)
 
 ~variant_connection ()
 
future< void > exec ()
 
logger get_logger () const
 
void set_logger (const logger &l)
 
server interface

Adding methods to the interface allows the remote side to call them.

void add_method (const fc::string &name, method)
 
void add_named_param_method (const fc::string &name, named_param_method)
 
void remove_method (const fc::string &name)
 
client interface
void notice (const fc::string &method)
 
void notice (const fc::string &method, const variants &args)
 
void notice (const fc::string &method, const variant_object &named_args)
 
future< fc::variantasync_call (const fc::string &method, const variant_object &args)
 args will be handled as named params
 
future< fc::variantasync_call (const fc::string &method, mutable_variant_object args)
 
future< fc::variantasync_call (const fc::string &method, const variants &args)
 Sending in an array of variants will be handled as positional arguments.
 
future< fc::variantasync_call (const fc::string &method)
 
future< fc::variantasync_call (const fc::string &method, const fc::variant &a1)
 
future< fc::variantasync_call (const fc::string &method, const fc::variant &a1, const fc::variant &a2)
 
future< fc::variantasync_call (const fc::string &method, const fc::variant &a1, const fc::variant &a2, const fc::variant &a3)
 
template<typename Result >
Result call (const fc::string &method, const fc::variant &a1, const fc::variant &a2, const fc::variant &a3, microseconds timeout=microseconds::maximum())
 
template<typename Result >
Result call (const fc::string &method, const fc::variant &a1, const fc::variant &a2, microseconds timeout=microseconds::maximum())
 
template<typename Result >
Result call (const fc::string &method, const fc::variant &a1, microseconds timeout=microseconds::maximum())
 
template<typename Result >
Result call (const fc::string &method, variant_object a1, microseconds timeout=microseconds::maximum())
 
template<typename Result >
Result call (const fc::string &method, mutable_variant_object a1, microseconds timeout=microseconds::maximum())
 
template<typename Result >
Result call (const fc::string &method, microseconds timeout=microseconds::maximum())
 
variant call (const fc::string &method, const variant_object &named_args)
 Sending in a variant_object will be issued as named parameters.
 

Detailed Description

Each JSON RPC message is expected to be on its own line, violators will be prosecuted to the fullest extent of the law.

Definition at line 18 of file variant_connection.hpp.

Member Typedef Documentation

◆ method

Definition at line 21 of file variant_connection.hpp.

◆ named_param_method

Constructor & Destructor Documentation

◆ variant_connection()

fc::rpc::variant_connection::variant_connection ( fc::variant_stream::ptr in,
fc::variant_stream::ptr out )

◆ ~variant_connection()

fc::rpc::variant_connection::~variant_connection ( )

Member Function Documentation

◆ add_method()

void fc::rpc::variant_connection::add_method ( const fc::string & name,
method  )

◆ add_named_param_method()

void fc::rpc::variant_connection::add_named_param_method ( const fc::string & name,
named_param_method  )

◆ async_call() [1/7]

future< fc::variant > fc::rpc::variant_connection::async_call ( const fc::string & method)

◆ async_call() [2/7]

future< fc::variant > fc::rpc::variant_connection::async_call ( const fc::string & method,
const fc::variant & a1 )

◆ async_call() [3/7]

future< fc::variant > fc::rpc::variant_connection::async_call ( const fc::string & method,
const fc::variant & a1,
const fc::variant & a2 )

◆ async_call() [4/7]

future< fc::variant > fc::rpc::variant_connection::async_call ( const fc::string & method,
const fc::variant & a1,
const fc::variant & a2,
const fc::variant & a3 )

◆ async_call() [5/7]

future< fc::variant > fc::rpc::variant_connection::async_call ( const fc::string & method,
const variant_object & args )
Here is the caller graph for this function:

◆ async_call() [6/7]

future< fc::variant > fc::rpc::variant_connection::async_call ( const fc::string & method,
const variants & args )

◆ async_call() [7/7]

future< fc::variant > fc::rpc::variant_connection::async_call ( const fc::string & method,
mutable_variant_object args )

◆ call() [1/7]

template<typename Result >
Result fc::rpc::variant_connection::call ( const fc::string & method,
const fc::variant & a1,
const fc::variant & a2,
const fc::variant & a3,
microseconds timeout = microseconds::maximum() )
inline

Definition at line 80 of file variant_connection.hpp.

85 {
86 return async_call( method, a1, a2, a3 ).wait(timeout).as<Result>();
87 }
future< fc::variant > async_call(const fc::string &method, const variant_object &args)
args will be handled as named params
std::function< variant(const variants &)> method
Here is the call graph for this function:

◆ call() [2/7]

template<typename Result >
Result fc::rpc::variant_connection::call ( const fc::string & method,
const fc::variant & a1,
const fc::variant & a2,
microseconds timeout = microseconds::maximum() )
inline

Definition at line 90 of file variant_connection.hpp.

94 {
95 return async_call( method, a1, a2 ).wait(timeout).as<Result>();
96 }
Here is the call graph for this function:

◆ call() [3/7]

template<typename Result >
Result fc::rpc::variant_connection::call ( const fc::string & method,
const fc::variant & a1,
microseconds timeout = microseconds::maximum() )
inline

Definition at line 99 of file variant_connection.hpp.

102 {
103 return async_call( method, a1 ).wait(timeout).as<Result>();
104 }
Here is the call graph for this function:

◆ call() [4/7]

variant fc::rpc::variant_connection::call ( const fc::string & method,
const variant_object & named_args )

◆ call() [5/7]

template<typename Result >
Result fc::rpc::variant_connection::call ( const fc::string & method,
microseconds timeout = microseconds::maximum() )
inline

Definition at line 123 of file variant_connection.hpp.

124 {
125 return async_call( method ).wait(timeout).as<Result>();
126 }
Here is the call graph for this function:

◆ call() [6/7]

template<typename Result >
Result fc::rpc::variant_connection::call ( const fc::string & method,
mutable_variant_object a1,
microseconds timeout = microseconds::maximum() )
inline

Definition at line 114 of file variant_connection.hpp.

117 {
118 return async_call( method, variant_object( fc::move(a1) ) ).wait(timeout).as<Result>();
119 }
Here is the call graph for this function:

◆ call() [7/7]

template<typename Result >
Result fc::rpc::variant_connection::call ( const fc::string & method,
variant_object a1,
microseconds timeout = microseconds::maximum() )
inline

Definition at line 107 of file variant_connection.hpp.

110 {
111 return async_call( method, fc::move(a1) ).wait(timeout).as<Result>();
112 }
Here is the call graph for this function:

◆ exec()

future< void > fc::rpc::variant_connection::exec ( )

Starts processing messages from input

◆ get_logger()

logger fc::rpc::variant_connection::get_logger ( ) const

◆ notice() [1/3]

void fc::rpc::variant_connection::notice ( const fc::string & method)

◆ notice() [2/3]

void fc::rpc::variant_connection::notice ( const fc::string & method,
const variant_object & named_args )

◆ notice() [3/3]

void fc::rpc::variant_connection::notice ( const fc::string & method,
const variants & args )

◆ remove_method()

void fc::rpc::variant_connection::remove_method ( const fc::string & name)

◆ set_logger()

void fc::rpc::variant_connection::set_logger ( const logger & l)

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