BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
Public Member Functions | Public Attributes | List of all members
fc::detail::any_api Class Reference

#include <api_connection.hpp>

Inheritance diagram for fc::detail::any_api:
fc::api_base

Public Member Functions

 any_api (api_id_type api_id, const std::shared_ptr< fc::api_connection > &con)
 
virtual uint64_t get_handle () const override
 
virtual api_id_type register_api (api_connection &conn) const override
 
- Public Member Functions inherited from fc::api_base
 api_base ()
 
virtual ~api_base ()
 
template<typename T >
api< T, identity_member_with_optionalsas ()
 
template<typename T >
api< T > as ()
 

Public Attributes

api_id_type _api_id
 
std::weak_ptr< fc::api_connection_api_connection
 

Detailed Description

If api<T> is returned from a remote method, the API is eagerly bound to api<T> of the correct type in api_visitor::from_variant(). This binding [1] needs a reference to the api_connection, which is made available to from_variant() as a parameter.

However, in the case of a remote method which returns api_base which can subsequently be cast by the caller with as<T>, we need to keep track of the connection because the binding is done later (when the client code actually calls as<T>).

[1] The binding actually happens in get_remote_api().

Definition at line 91 of file api_connection.hpp.

Constructor & Destructor Documentation

fc::detail::any_api::any_api ( api_id_type  api_id,
const std::shared_ptr< fc::api_connection > &  con 
)
inline

Definition at line 94 of file api_connection.hpp.

Member Function Documentation

virtual uint64_t fc::detail::any_api::get_handle ( ) const
inlineoverridevirtual

Implements fc::api_base.

Definition at line 97 of file api_connection.hpp.

virtual api_id_type fc::detail::any_api::register_api ( api_connection conn) const
inlineoverridevirtual

Implements fc::api_base.

Definition at line 100 of file api_connection.hpp.

Member Data Documentation

std::weak_ptr<fc::api_connection> fc::detail::any_api::_api_connection

Definition at line 104 of file api_connection.hpp.

api_id_type fc::detail::any_api::_api_id

Definition at line 103 of file api_connection.hpp.


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