Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::api_base Class Referenceabstract

#include <api.hpp>

Inheritance diagram for fc::api_base:

Public Member Functions

 api_base ()
 
virtual ~api_base ()
 
virtual uint64_t get_handle () const =0
 
virtual api_id_type register_api (api_connection &conn) const =0
 
template<typename T >
api< T, identity_memberas ()
 
template<typename T >
api< Tas ()
 

Detailed Description

Definition at line 48 of file api.hpp.

Constructor & Destructor Documentation

◆ api_base()

fc::api_base::api_base ( )
inline

Definition at line 51 of file api.hpp.

51{}

◆ ~api_base()

virtual fc::api_base::~api_base ( )
inlinevirtual

Definition at line 52 of file api.hpp.

52{}

Member Function Documentation

◆ as() [1/2]

template<typename T >
api< T, identity_member > fc::api_base::as ( )

◆ as() [2/2]

template<typename T >
api< T > fc::api_base::as ( )

Definition at line 465 of file api_connection.hpp.

466 {
467 // TODO: this method should probably be const (if it is not too hard)
468 api<T>* maybe_requested_type = dynamic_cast< api<T>* >(this);
469 if( maybe_requested_type != nullptr )
470 return *maybe_requested_type;
471
472 detail::any_api* maybe_any = dynamic_cast< detail::any_api* >(this);
473 FC_ASSERT( maybe_any != nullptr );
474 std::shared_ptr< api_connection > api_conn = maybe_any->_api_connection.lock();
475 FC_ASSERT( api_conn );
476 return api_conn->get_remote_api<T>( maybe_any->_api_id );
477 }
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
#define T(meth, val, expected)

◆ get_handle()

virtual uint64_t fc::api_base::get_handle ( ) const
pure virtual

◆ register_api()

virtual api_id_type fc::api_base::register_api ( api_connection & conn) const
pure virtual

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